diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-04 22:18:44 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-04 22:18:44 +0800 |
| commit | 38b1268028d4d631de15ca85826c241e39c82675 (patch) | |
| tree | 8359891236b3cd766068cf87cfbd566ac507fc93 /test/base/HandlerRegistryTest.cpp | |
| parent | ef6cff0f308d49326bbe0c3b557cb8ab6cca455b (diff) | |
| download | cru-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.cpp | 37 |
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); -} |
