| 61 | }; |
| 62 | |
| 63 | TEST(ProcTaskReader, Self) { |
| 64 | std::vector<pid_t> tids; |
| 65 | ASSERT_TRUE(ReadThreadIDs(getpid(), &tids)); |
| 66 | EXPECT_TRUE(FindThreadID(getpid(), tids)); |
| 67 | EXPECT_TRUE(FindThreadID(sys_gettid(), tids)); |
| 68 | |
| 69 | ScopedBlockingThread thread1; |
| 70 | thread1.Start(); |
| 71 | |
| 72 | ScopedBlockingThread thread2; |
| 73 | thread2.Start(); |
| 74 | |
| 75 | pid_t thread1_tid = thread1.ThreadID(); |
| 76 | pid_t thread2_tid = thread2.ThreadID(); |
| 77 | |
| 78 | tids.clear(); |
| 79 | ASSERT_TRUE(ReadThreadIDs(getpid(), &tids)); |
| 80 | EXPECT_TRUE(FindThreadID(getpid(), tids)); |
| 81 | EXPECT_TRUE(FindThreadID(thread1_tid, tids)); |
| 82 | EXPECT_TRUE(FindThreadID(thread2_tid, tids)); |
| 83 | } |
| 84 | |
| 85 | TEST(ProcTaskReader, BadPID) { |
| 86 | std::vector<pid_t> tids; |
nothing calls this directly
no test coverage detected