Commit 99ce6d2d authored by gejun's avatar gejun

fix UT which is broken by incorrect patch

parent 9740ea9d
......@@ -589,7 +589,7 @@ TEST_F(ExecutionQueueTest, random_cancel) {
int64_t expected = 0;
for (int i = 0; i < 100000; ++i) {
bthread::TaskHandle h;
AddTask t = {0};
AddTask t;
t.value = i;
t.cancel_task = false;
ASSERT_EQ(0, bthread::execution_queue_execute(queue_id, t, NULL, &h));
......
......@@ -506,21 +506,16 @@ TEST_F(BthreadTest, too_many_nosignal_threads) {
ASSERT_EQ(0, bthread_start_urgent(&tid, &attr, dummy_thread, NULL));
}
}
} // namespace
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
GFLAGS_NS::ParseCommandLineFlags(&argc, &argv, true);
return RUN_ALL_TESTS();
}
void* yield_thread(void*) {
static void* yield_thread(void*) {
bthread_yield();
return NULL;
}
TEST_F(test_bthread_suite, yield_single_thread) {
TEST_F(BthreadTest, yield_single_thread) {
bthread_t tid;
ASSERT_EQ(0, bthread_start_background(&tid, NULL, yield_thread, NULL));
ASSERT_EQ(0, bthread_join(tid, NULL));
}
} // namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment