UnitTests: Rename .cpp (it was confusing the debugger)

This commit is contained in:
Jérôme Leclercq
2021-06-04 14:12:26 +02:00
parent 7c9bc16535
commit 8fe11711a3
49 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#include <Nazara/Core/ObjectRef.hpp>
#include <Catch/catch.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());
}
}
}
}