#include #include #include class Test : public Nz::RefCounted { }; SCENARIO("ObjectRef", "[CORE][OBJECTREF]") { GIVEN("A ObjectRef") { Nz::ObjectRef objectRef; WHEN("We have two objectRef handling the same object") { Test test; objectRef = &test; Nz::ObjectRef 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()); } } } }