From 236ccf3cd9b02a5fa1c422aa971e91cf5d3bcbfc Mon Sep 17 00:00:00 2001 From: Lars Ivar Hatledal Date: Thu, 29 Feb 2024 19:20:19 +0100 Subject: [PATCH] fix test --- tests/core/EventDispatcher_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/core/EventDispatcher_test.cpp b/tests/core/EventDispatcher_test.cpp index 82750fbb..14faf949 100644 --- a/tests/core/EventDispatcher_test.cpp +++ b/tests/core/EventDispatcher_test.cpp @@ -34,7 +34,7 @@ namespace { void onEvent(Event& event) override { auto* material = static_cast(event.target); - material->removeEventListener("dispose", this); + material->removeEventListener("dispose", *this); } }; @@ -51,15 +51,15 @@ TEST_CASE("Test events") { l1Called = true; }); - evt.addEventListener("test1", &l); - evt.addEventListener("test2", &l1); + evt.addEventListener("test1", l); + evt.addEventListener("test2", l1); evt.dispatchEvent("test1"); evt.dispatchEvent("test1"); REQUIRE(2 == l.numCalled); - evt.removeEventListener("test1", &l); + evt.removeEventListener("test1", l); evt.dispatchEvent("test1"); evt.dispatchEvent("test2"); @@ -67,14 +67,14 @@ TEST_CASE("Test events") { REQUIRE(2 == l.numCalled); REQUIRE(l1Called); - REQUIRE(!evt.hasEventListener("test1", &l)); - REQUIRE(evt.hasEventListener("test2", &l1)); + REQUIRE(!evt.hasEventListener("test1", l)); + REQUIRE(evt.hasEventListener("test2", l1)); OnMaterialDispose onDispose; auto material = MeshBasicMaterial::create(); - material->addEventListener("dispose", &onDispose); + material->addEventListener("dispose", onDispose); - REQUIRE(material->hasEventListener("dispose", &onDispose)); + REQUIRE(material->hasEventListener("dispose", onDispose)); material->dispose(); - REQUIRE(!material->hasEventListener("dispose", &onDispose)); + REQUIRE(!material->hasEventListener("dispose", onDispose)); }