Upgrade Platform

This commit is contained in:
Jérôme Leclercq
2021-05-24 21:06:55 +02:00
parent 8b0b5295f7
commit ba7c56ddfa
20 changed files with 322 additions and 389 deletions

View File

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