Move ComputeTest,GraphicsTest,RenderTest and Std140Debug to the tests folder

Also renamed NazaraUnitTests to UnitTests
This commit is contained in:
SirLynix
2022-12-26 08:44:11 +01:00
parent fe8715f1fb
commit 4b804dc613
71 changed files with 33 additions and 36 deletions

View File

@@ -0,0 +1,44 @@
#include <Nazara/Core/ObjectRef.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
class Test : public Nz::RefCounted
{
};
SCENARIO("ObjectRef", "[CORE][OBJECTREF]")
{
GIVEN("A ObjectRef")
{
Nz::ObjectRef<Test> objectRef;
WHEN("We have two objectRef handling the same object")
{
Test test;
objectRef = &test;
Nz::ObjectRef<Test> otherRef(&test);
THEN("Pointers the same")
{
REQUIRE(objectRef.IsValid());
REQUIRE(otherRef.IsValid());
}
objectRef.Reset(nullptr);
}
WHEN("We assign it to a simple font")
{
Test test;
THEN("Release suppress the reference to the object")
{
objectRef.Reset(&test);
objectRef.Release();
REQUIRE(!objectRef.IsValid());
}
}
}
}