feat add event_bus #1

Merged
tqcq merged 19 commits from feat/support_event_bus into master 2024-04-02 12:41:20 +08:00
2 changed files with 17 additions and 0 deletions
Showing only changes of commit 67f44c0202 - Show all commits

View File

@ -188,6 +188,7 @@ if(SLED_BUILD_TESTS)
src/sled/utility/move_on_copy_test.cc)
sled_add_test(NAME sled_symbolize_test SRCS
src/sled/debugging/symbolize_test.cc NO_MAIN)
sled_add_test(NAME sled_sigslot_test SRCS src/sled/sigslot_test.cc)
endif(SLED_BUILD_TESTS)
if(SLED_BUILD_FUZZ)

16
src/sled/sigslot_test.cc Normal file
View File

@ -0,0 +1,16 @@
#include <sled/sigslot.h>
struct DeleteSelf : public sigslot::has_slots<> {
void DeleteThis() {
delete this;
}
};
TEST_SUITE("sigslot") {
TEST_CASE("delete this") {
DeleteSelf* d = new DeleteSelf();
sigslot::signal0<> sig;
sig.connect(d, &DeleteSelf::DeleteThis);
sig.emit();
}
}