including light effects from different project

This commit is contained in:
2024-12-15 22:46:44 +01:00
parent e4621f8ad8
commit 6db9bd85a5
20 changed files with 1533 additions and 43 deletions
@@ -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);
}
}