From efa1266f10e90c0c46f47cc06645422142cb2d9f Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 3 Sep 2025 12:42:10 +0800 Subject: common -> base in test dir. --- test/common/HandlerRegistryTest.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 test/common/HandlerRegistryTest.cpp (limited to 'test/common/HandlerRegistryTest.cpp') diff --git a/test/common/HandlerRegistryTest.cpp b/test/common/HandlerRegistryTest.cpp deleted file mode 100644 index aacef70f..00000000 --- a/test/common/HandlerRegistryTest.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "cru/base/HandlerRegistry.h" - -#include - -#include - -TEST_CASE("HandlerRegistry", "[handler_registry]") { - using namespace cru; - HandlerRegistry registry; - - int counter = 1; - - auto tag1 = registry.AddHandler([&counter] { counter++; }); - auto tag2 = registry.AddHandler([&counter] { counter++; }); - - for (const auto& handler : registry) { - handler(); - } - - REQUIRE(counter == 3); - - registry.RemoveHandler(tag1); - - for (const auto& handler : registry) { - handler(); - } - - REQUIRE(counter == 4); - - registry.RemoveHandler(tag2); - - for (const auto& handler : registry) { - handler(); - } - - REQUIRE(counter == 4); -} -- cgit v1.2.3