including light effects from different project
This commit is contained in:
@@ -0,0 +1 @@
|
||||
unitTestsFrame()
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @file TestableUTest.cpp
|
||||
* @author Gustice
|
||||
* @brief
|
||||
*
|
||||
* @copyright Copyright (c) 2024
|
||||
*/
|
||||
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include "utils.hpp"
|
||||
#include "doctest/doctest.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace SingleActiveTests {
|
||||
|
||||
class Foo : public SingleActive<Foo> {
|
||||
public:
|
||||
int test{};
|
||||
|
||||
Foo() : SingleActive() {}
|
||||
};
|
||||
template <>
|
||||
bool Foo::SingleActive<Foo>::active{};
|
||||
|
||||
class Bar : public SingleActive<Bar> {
|
||||
public:
|
||||
int test{};
|
||||
|
||||
Bar() : SingleActive() {}
|
||||
};
|
||||
template <>
|
||||
bool Bar::SingleActive<Bar>::active{};
|
||||
|
||||
TEST_CASE("Sweet path") {
|
||||
{ // first instances
|
||||
Foo dut;
|
||||
} // destruction
|
||||
|
||||
{ // second instances
|
||||
Foo dut;
|
||||
} // destruction
|
||||
|
||||
{ // third instance
|
||||
Foo dut1;
|
||||
Bar dut2; // First instance of second class
|
||||
} // destruction
|
||||
|
||||
CHECK(true);
|
||||
}
|
||||
|
||||
TEST_CASE("Too many instances") {
|
||||
{
|
||||
Foo dut1;
|
||||
Foo *pDut2;
|
||||
CHECK_THROWS_WITH(pDut2 = new Foo, "Instance already active");
|
||||
}
|
||||
CHECK(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user