| 77 | } // namespace |
| 78 | |
| 79 | TEST(SimpleThreadTest, CreateAndJoin) { |
| 80 | int stack_int = 0; |
| 81 | |
| 82 | SetIntRunner runner(&stack_int, 7); |
| 83 | EXPECT_EQ(0, stack_int); |
| 84 | |
| 85 | DelegateSimpleThread thread(&runner, "int_setter"); |
| 86 | EXPECT_FALSE(thread.HasBeenStarted()); |
| 87 | EXPECT_FALSE(thread.HasBeenJoined()); |
| 88 | EXPECT_EQ(0, stack_int); |
| 89 | |
| 90 | thread.Start(); |
| 91 | EXPECT_TRUE(thread.HasBeenStarted()); |
| 92 | EXPECT_FALSE(thread.HasBeenJoined()); |
| 93 | |
| 94 | thread.Join(); |
| 95 | EXPECT_TRUE(thread.HasBeenStarted()); |
| 96 | EXPECT_TRUE(thread.HasBeenJoined()); |
| 97 | EXPECT_EQ(7, stack_int); |
| 98 | } |
| 99 | |
| 100 | TEST(SimpleThreadTest, WaitForEvent) { |
| 101 | // Create a thread, and wait for it to signal us. |
nothing calls this directly
no test coverage detected