aboutsummaryrefslogtreecommitdiff
path: root/test/base/HandlerRegistryTest.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-04 22:18:44 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-04 22:18:44 +0800
commit38b1268028d4d631de15ca85826c241e39c82675 (patch)
tree8359891236b3cd766068cf87cfbd566ac507fc93 /test/base/HandlerRegistryTest.cpp
parentef6cff0f308d49326bbe0c3b557cb8ab6cca455b (diff)
downloadcru-38b1268028d4d631de15ca85826c241e39c82675.tar.gz
cru-38b1268028d4d631de15ca85826c241e39c82675.tar.bz2
cru-38b1268028d4d631de15ca85826c241e39c82675.zip
Remove Event2 and HandlerRegistry.
Diffstat (limited to 'test/base/HandlerRegistryTest.cpp')
-rw-r--r--test/base/HandlerRegistryTest.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/test/base/HandlerRegistryTest.cpp b/test/base/HandlerRegistryTest.cpp
deleted file mode 100644
index aacef70f..00000000
--- a/test/base/HandlerRegistryTest.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "cru/base/HandlerRegistry.h"
-
-#include <catch2/catch_test_macros.hpp>
-
-#include <algorithm>
-
-TEST_CASE("HandlerRegistry", "[handler_registry]") {
- using namespace cru;
- HandlerRegistry<void()> 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);
-}