ut: improve code coverage
[platform/core/uifw/libtdm.git] / ut / src / ut_tdm_backend.cpp
index 79465d9..019dd3c 100644 (file)
 #include "gtest/gtest.h"
 
 #include "tbm_stubs.h"
-#include "pthread_stubs.h"
-#include "stdlib_stubs.h"
-
-#define pthread_mutex_lock ut_pthread_mutex_lock
-#define calloc ut_calloc
-#define free ut_free
-#define pthread_mutex_init ut_pthread_mutex_init
-#define pthread_mutex_unlock ut_pthread_mutex_unlock
+#include "stub_pthread.h"
+#include "stub_stdlib.h"
 
 #include "tdm_backend.c"
 
 static void _init_test()
 {
-       TBM_BUFMGR_DEINIT_CALLED = 0;
-       TBM_BO_GET_USER_DATA_NULL = 0;
-       PTHREAD_MUTEX_INIT_ERROR = 0;
-       CALLOC_ERROR = 0;
-       CALLOC_RETURN_BUFFER = 0;
-       FREE_CALLED = 0;
+       stub_pthread_init();
+       stub_tbm_init();
+       stub_stdlib_init();
 }
 
 /* tdm_backend_register_func_capture */
@@ -237,6 +228,7 @@ TEST(tdm_backend_register_func_display, work_flow_success_1)
        _init_test();
 
        dpy.module_data = &module;
+       module.abi_version = 0x00020000;
 
        error = tdm_backend_register_func_display(&dpy, &func_display);