feat add sigslot test case
Some checks failed
linux-x64-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x64-gcc / linux-gcc (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (push) Failing after 1m54s
linux-arm-gcc / linux-gcc-armhf (push) Failing after 1m51s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 23m27s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Has been cancelled
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Has been cancelled
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (pull_request) Failing after 3m0s
linux-arm-gcc / linux-gcc-armhf (pull_request) Failing after 1m56s
linux-arm-gcc / linux-gcc-arm (pull_request) Failing after 13m17s
linux-mips64-gcc / linux-gcc-mips64el (Release) (pull_request) Failing after 43m40s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (pull_request) Failing after 1h10m59s
linux-x64-gcc / linux-gcc (Debug) (pull_request) Failing after 1h10m55s
linux-x64-gcc / linux-gcc (Release) (pull_request) Failing after 1h10m53s

This commit is contained in:
tqcq 2024-04-02 08:59:21 +08:00
parent 94f1572347
commit 67f44c0202
2 changed files with 17 additions and 0 deletions

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();
}
}