Fix unit tests for the exporting engine (#7784)

This commit is contained in:
Vladimir Kobal 2020-01-23 10:34:45 +02:00 committed by GitHub
parent 940844c49c
commit 352c3941f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View File

@ -969,6 +969,7 @@ if(BUILD_TESTING)
-Wl,--wrap=notify_workers
-Wl,--wrap=send_internal_metrics
-Wl,--wrap=now_realtime_sec
-Wl,--wrap=uv_thread_set_name_np
-Wl,--wrap=uv_thread_create
-Wl,--wrap=uv_mutex_lock
-Wl,--wrap=uv_mutex_unlock

View File

@ -790,6 +790,7 @@ if ENABLE_UNITTESTS
-Wl,--wrap=notify_workers \
-Wl,--wrap=send_internal_metrics \
-Wl,--wrap=now_realtime_sec \
-Wl,--wrap=uv_thread_set_name_np \
-Wl,--wrap=uv_thread_create \
-Wl,--wrap=uv_mutex_lock \
-Wl,--wrap=uv_mutex_unlock \

View File

@ -17,6 +17,14 @@ time_t __wrap_now_realtime_sec(void)
return mock_type(time_t);
}
void __wrap_uv_thread_set_name_np(uv_thread_t ut, const char* name)
{
(void)ut;
(void)name;
function_called();
}
void __wrap_info_int(const char *file, const char *function, const unsigned long line, const char *fmt, ...)
{
(void)file;

View File

@ -25,6 +25,8 @@ void init_connectors_in_tests(struct engine *engine)
expect_value(__wrap_uv_thread_create, worker, simple_connector_worker);
expect_value(__wrap_uv_thread_create, arg, engine->connector_root->instance_root);
expect_function_call(__wrap_uv_thread_set_name_np);
assert_int_equal(__real_init_connectors(engine), 0);
assert_int_equal(engine->now, 2);