Utilities
Some checks failed
Bigfoot / Build & Test Debug (push) Successful in 1m20s
Bigfoot / Build & Test Release (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo (push) Has been cancelled

This commit is contained in:
2026-02-16 20:58:47 +01:00
parent ee1dc86273
commit d4d71a8369
16 changed files with 541 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
/*********************************************************************
* \file Singleton.cpp
*
* \author Romain BOULLARD
* \date February 2026
*********************************************************************/
#include <Singleton.hpp>
#include <gtest/gtest.h>
namespace Bin2CPP
{
class SingletonFixture: public ::testing::Test
{
protected:
Singleton<std::uint8_t>::Lifetime m_lifetime{8};
};
/****************************************************************************************/
TEST_F(SingletonFixture, HasInstance_ShouldReturnTrueIfSingletonIsInitialized)
{
EXPECT_TRUE(Singleton<std::uint8_t>::HasInstance());
}
/****************************************************************************************/
TEST_F(SingletonFixture, HasInstance_ShouldReturnFaleIfSingletonIsNotInitialized)
{
EXPECT_FALSE(Singleton<std::uint32_t>::HasInstance());
}
/****************************************************************************************/
TEST_F(SingletonFixture, Instance_ShouldReturnTheInstance)
{
EXPECT_EQ(Singleton<std::uint8_t>::Instance(), 8);
}
} // namespace Bin2CPP