mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
increased test coverage
This commit is contained in:
parent
643d1d5237
commit
7e1d9bbb50
@ -37,8 +37,7 @@ TEST(wf_timer, trigger)
|
|||||||
struct wf_timer_manager * manager = wf_timer_manager_create();
|
struct wf_timer_manager * manager = wf_timer_manager_create();
|
||||||
struct wf_timer * timer = wf_timer_create(manager, &on_timeout, reinterpret_cast<void*>(&triggered));
|
struct wf_timer * timer = wf_timer_create(manager, &on_timeout, reinterpret_cast<void*>(&triggered));
|
||||||
|
|
||||||
wf_timer_start(timer, 250);
|
wf_timer_start(timer, -1);
|
||||||
std::this_thread::sleep_for(500ms);
|
|
||||||
wf_timer_manager_check(manager);
|
wf_timer_manager_check(manager);
|
||||||
|
|
||||||
ASSERT_TRUE(triggered);
|
ASSERT_TRUE(triggered);
|
||||||
@ -135,3 +134,15 @@ TEST(wf_timer, multiple_timers)
|
|||||||
|
|
||||||
wf_timer_manager_dispose(manager);
|
wf_timer_manager_dispose(manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(wf_timer, dont_trigger_null_callback)
|
||||||
|
{
|
||||||
|
struct wf_timer_manager * manager = wf_timer_manager_create();
|
||||||
|
struct wf_timer * timer = wf_timer_create(manager, nullptr, nullptr);
|
||||||
|
|
||||||
|
wf_timer_start(timer, -1);
|
||||||
|
wf_timer_manager_check(manager);
|
||||||
|
|
||||||
|
wf_timer_dispose(timer);
|
||||||
|
wf_timer_manager_dispose(manager);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user