mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
20 lines
411 B
C++
20 lines
411 B
C++
|
|
#include "gtest/gtest.h"
|
|
|
|
#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));
|
|
}
|