Skip to content

Commit f7e0bc6

Browse files
authored
Add coroutine_base.get_init_msec test (swoole#3964)
1 parent fa5e371 commit f7e0bc6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core-tests/src/coroutine/base.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ TEST(coroutine_base, get_current) {
2323
ASSERT_EQ(cid, _cid);
2424
}
2525

26+
TEST(coroutine_base, get_init_msec) {
27+
Coroutine::create([](void *arg) {
28+
auto co = Coroutine::get_current();
29+
long init_msec = co->get_init_msec();
30+
31+
ASSERT_GT(init_msec, 0);
32+
});
33+
}
34+
2635
TEST(coroutine_base, yield_resume) {
2736
long _cid;
2837
long cid = Coroutine::create(
@@ -162,4 +171,3 @@ TEST(coroutine_base, get_elapsed) {
162171
&elapsed_time);
163172
ASSERT_GE(elapsed_time, 2);
164173
}
165-

0 commit comments

Comments
 (0)