feat add event_bus #1
@ -188,6 +188,7 @@ if(SLED_BUILD_TESTS)
|
|||||||
src/sled/utility/move_on_copy_test.cc)
|
src/sled/utility/move_on_copy_test.cc)
|
||||||
sled_add_test(NAME sled_symbolize_test SRCS
|
sled_add_test(NAME sled_symbolize_test SRCS
|
||||||
src/sled/debugging/symbolize_test.cc NO_MAIN)
|
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)
|
endif(SLED_BUILD_TESTS)
|
||||||
|
|
||||||
if(SLED_BUILD_FUZZ)
|
if(SLED_BUILD_FUZZ)
|
||||||
|
16
src/sled/sigslot_test.cc
Normal file
16
src/sled/sigslot_test.cc
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user