SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [41/59]

SpicesTest::TEST ( Semaphore_test ,
Increase  )

Testing Spices::Semaphore::Increase.

Definition at line 40 of file Semaphore_test.h.

40 {
41
43
45
46 std::thread t([&]() {
47 std::this_thread::sleep_for(std::chrono::seconds(1));
48 sem.Increase();
49 });
50
51 // Should not block here.
52 EXPECT_EQ(sem.GetSign(), 0);
53
54 t.join();
55
56 // Should block here.
57 EXPECT_EQ(sem.GetSign(), 1);
58 }
#define SPICESTEST_PROFILE_FUNCTION()
void Increase()
Increase this semaphore sign.
Definition Semaphore.h:45
const int GetSign() const
Get this semaphore current sign.
Definition Semaphore.h:70
std::semaphore Implementation.
Definition Semaphore.h:16

References Spices::semaphore::GetSign(), and Spices::semaphore::Increase().