add some simple event tests

This commit is contained in:
mutouyun 2023-07-29 13:27:22 +08:00
parent f5908cfe69
commit 7ec99c3394

View File

@ -4,4 +4,16 @@
#include <libipc/event.h>
TEST(event, open_close) {
auto evt = ipc::evt_open("test");
ASSERT_TRUE(evt);
ASSERT_EQ(ipc::evt_name(*evt), "test");
ASSERT_TRUE(ipc::evt_close(*evt));
}
TEST(event, set_wait) {
auto evt = ipc::evt_open("test");
ASSERT_TRUE(evt);
ASSERT_TRUE(ipc::evt_set(*evt));
ASSERT_TRUE(ipc::evt_wait(*evt, 0));
ASSERT_TRUE(ipc::evt_close(*evt));
}