utest: fix build warnings 49/160649/2
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 17 Nov 2017 09:00:48 +0000 (11:00 +0200)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 17 Nov 2017 09:29:30 +0000 (11:29 +0200)
Change-Id: I14129f59849486d18beec5210b4763368fccd50f
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
utests/ut.cpp
utests/ut.h
utests/ut_tbm_bufmgr.cpp
utests/ut_tbm_surface.cpp
utests/ut_tbm_surface_internal.cpp
utests/ut_tbm_surface_queue.cpp

index b98a224d17fac090243eca560374d85090657932..dda84ef07595ae89fe96ebd91992b324601ee2dc 100644 (file)
@@ -65,7 +65,7 @@ void ut_set_default_tbm_env()
 int UtSurface::width = 720;
 int UtSurface::height = 1024;
 tbm_format UtSurface::format;
-int UtSurface::num_formats;
+uint32_t UtSurface::num_formats;
 tbm_format *UtSurface::formats;
 
 void UtSurface::SetUpTestCase()
@@ -74,10 +74,10 @@ void UtSurface::SetUpTestCase()
 
        ut_set_default_tbm_env();
 
-       result = tbm_surface_query_formats(&formats, &num_formats);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(&formats, &num_formats);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
-       for (int i = 0; i < num_formats; i++)
+       for (uint32_t i = 0; i < num_formats; i++)
                if (formats[i] == TBM_FORMAT_ARGB8888)
                        format = TBM_FORMAT_ARGB8888;
 
@@ -109,8 +109,8 @@ void UtSurface::TearDown()
 int UtSurfaceQueue::width = 720;
 int UtSurfaceQueue::height = 1024;
 int UtSurfaceQueue::format;
-int UtSurfaceQueue::num_formats;
-int *UtSurfaceQueue::formats;
+uint32_t UtSurfaceQueue::num_formats;
+tbm_format *UtSurfaceQueue::formats;
 
 void UtSurfaceQueue::SetUpTestCase()
 {
@@ -118,10 +118,10 @@ void UtSurfaceQueue::SetUpTestCase()
 
        ut_set_default_tbm_env();
 
-       result = tbm_surface_query_formats(&formats, &num_formats);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(&formats, &num_formats);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
-       for (int i = 0; i < num_formats; i++)
+       for (uint32_t i = 0; i < num_formats; i++)
                if (formats[i] == TBM_FORMAT_ARGB8888)
                        format = TBM_FORMAT_ARGB8888;
 
@@ -139,10 +139,10 @@ void UtSurfaceQueue::TearDownTestCase()
 void UtSurfaceQueue::SetUp()
 {
        alien_surface = tbm_surface_create(width, height, format);
-       ASSERT_NE(NULL, alien_surface);
+       ASSERT_NE((tbm_surface_h)NULL, alien_surface);
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, width, height, format, TBM_BO_DEFAULT);
-       ASSERT_NE(NULL, queue);
+       ASSERT_NE((tbm_surface_queue_h)NULL, queue);
 }
 
 void UtSurfaceQueue::TearDown()
index 2cfceaeb439572b62c7ec6a2ea18a62814606648..5ed7a43ab1f54b1d5bfbd25ba2fc03c53e2ebe1a 100644 (file)
@@ -63,7 +63,7 @@ public:
        static int height;
        static tbm_format format;
 
-       static int num_formats;
+       static uint32_t num_formats;
        static tbm_format *formats;
 
        tbm_surface_h surface;
@@ -85,8 +85,8 @@ public:
        static int height;
        static int format;
 
-       static int num_formats;
-       static int *formats;
+       static uint32_t num_formats;
+       static tbm_format *formats;
 
        tbm_surface_h alien_surface;
        tbm_surface_queue_h queue;
index 82baa0e854595c989b8fd06ae4f1aa9dd0b76778..cc9d0286531fb4042356eaec8342adf7b2bad8cc 100644 (file)
@@ -19,7 +19,7 @@ TEST_F(UtInit, BufmgrInitSuccessIniteTwice)
        ASSERT_TRUE(bufmgr == bufmgr2);
 
        bo = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo, NULL);
+       ASSERT_NE(nullptr, bo);
 }
 
 /* tbm_bo_alloc() */
@@ -30,7 +30,7 @@ TEST_F(UtBufmgrInit, BoAllocFailNulbufmgr)
 
        bo = tbm_bo_alloc(NULL, 128 * 128, TBM_BO_DEFAULT);
 
-       ASSERT_EQ(bo, NULL);
+       ASSERT_EQ(nullptr, bo);
 }
 
 TEST_F(UtBufmgrInit, BoAllocFailSizeLessThenZero)
@@ -39,7 +39,7 @@ TEST_F(UtBufmgrInit, BoAllocFailSizeLessThenZero)
 
        bo = tbm_bo_alloc(bufmgr, -1, TBM_BO_DEFAULT);
 
-       ASSERT_EQ(bo, NULL);
+       ASSERT_EQ(nullptr, bo);
 }
 
 TEST_F(UtBufmgrInit, BoAllocFailNoValidBufmgr)
@@ -49,7 +49,7 @@ TEST_F(UtBufmgrInit, BoAllocFailNoValidBufmgr)
 
        bo = tbm_bo_alloc((tbm_bufmgr)&bufmgr, -1, TBM_BO_DEFAULT);
 
-       ASSERT_EQ(bo, NULL);
+       ASSERT_EQ(nullptr, bo);
 }
 
 TEST_F(UtBufmgrInit, BoAllocSuccess)
@@ -58,7 +58,7 @@ TEST_F(UtBufmgrInit, BoAllocSuccess)
 
        ret_bo = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
 
-       ASSERT_NE(ret_bo, NULL);
+       ASSERT_NE(nullptr, ret_bo);
 }
 
 /* tbm_bo_ref() */
@@ -70,7 +70,7 @@ TEST(tbm_bo_ref, BoRefFailBufmgrWasNotInited)
 
        ret_bo = tbm_bo_ref((tbm_bo)&bo);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoRefFailNullBo)
@@ -79,7 +79,7 @@ TEST_F(UtBufmgrInit, BoRefFailNullBo)
 
        ret_bo = tbm_bo_ref(NULL);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoRefFailNoValidBo)
@@ -89,7 +89,7 @@ TEST_F(UtBufmgrInit, BoRefFailNoValidBo)
 
        ret_bo = tbm_bo_ref((tbm_bo)&bo);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBoInit, BoRefSuccess)
@@ -98,7 +98,7 @@ TEST_F(UtBoInit, BoRefSuccess)
 
        ret_bo = tbm_bo_ref(bo);
 
-       ASSERT_NE(ret_bo, NULL);
+       ASSERT_NE(nullptr, ret_bo);
 }
 
 /* tbm_bo_unref() */
@@ -111,7 +111,7 @@ TEST_F(UtBoInit, BoUnrefSuccess)
 
        ret_bo = tbm_bo_ref(bo);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 /* tbm_bo_map() */
@@ -123,7 +123,7 @@ TEST(tbm_bo_map, BoMapFailBufmgrWasNotInited)
 
        bo_handle = tbm_bo_map((tbm_bo)&bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBufmgrInit, BoMapFailNullBo)
@@ -132,7 +132,7 @@ TEST_F(UtBufmgrInit, BoMapFailNullBo)
 
        bo_handle = tbm_bo_map(NULL, TBM_DEVICE_CPU, TBM_OPTION_READ);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBufmgrInit, BoMapFailNoValidBo)
@@ -142,7 +142,7 @@ TEST_F(UtBufmgrInit, BoMapFailNoValidBo)
 
        bo_handle = tbm_bo_map((tbm_bo)&bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBoInit, BoMapSuccess)
@@ -151,7 +151,7 @@ TEST_F(UtBoInit, BoMapSuccess)
 
        bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
 
-       ASSERT_NE(bo_handle.ptr, NULL);
+       ASSERT_NE(nullptr, bo_handle.ptr);
 }
 
 /* tbm_bo_unmap() */
@@ -200,7 +200,7 @@ TEST_F(UtBoInit, BoUnmapSuccess)
        tbm_bo_handle bo_handle;
 
        bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
-       ASSERT_NE(bo_handle.ptr, NULL);
+       ASSERT_NE(nullptr, bo_handle.ptr);
 
        ret = tbm_bo_unmap(bo);
 
@@ -216,7 +216,7 @@ TEST(tbm_bo_get_handle, BoGetHandleFailBufmgrWasNotInited)
 
        bo_handle = tbm_bo_get_handle((tbm_bo)&bo, TBM_DEVICE_DEFAULT);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBufmgrInit, BoGetHandleFailNullBo)
@@ -225,7 +225,7 @@ TEST_F(UtBufmgrInit, BoGetHandleFailNullBo)
 
        bo_handle = tbm_bo_get_handle(NULL, TBM_DEVICE_DEFAULT);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBufmgrInit, BoGetHandleFailNoValidBo)
@@ -235,7 +235,7 @@ TEST_F(UtBufmgrInit, BoGetHandleFailNoValidBo)
 
        bo_handle = tbm_bo_get_handle((tbm_bo)&bo, TBM_DEVICE_DEFAULT);
 
-       ASSERT_EQ(bo_handle.ptr, NULL);
+       ASSERT_EQ(nullptr, bo_handle.ptr);
 }
 
 TEST_F(UtBoInit, BoGetHandleSuccess)
@@ -244,7 +244,7 @@ TEST_F(UtBoInit, BoGetHandleSuccess)
 
        bo_handle = tbm_bo_get_handle(bo, TBM_DEVICE_DEFAULT);
 
-       ASSERT_NE(bo_handle.ptr, NULL);
+       ASSERT_NE(nullptr, bo_handle.ptr);
 }
 
 /* tbm_bo_export() */
@@ -293,7 +293,7 @@ TEST_F(UtBoInit, BoExportSuccess)
 
        ret_key = tbm_bo_export(bo);
 
-       ASSERT_NE(ret_key, NULL);
+       ASSERT_NE(0, ret_key);
 }
 
 /* tbmBoExportfd() */
@@ -354,7 +354,7 @@ TEST(tbmBoImport, BoImportFailBufmgrWasNotInited)
 
        ret_bo = tbm_bo_import((tbm_bufmgr)&bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFailNullBufmgr)
@@ -366,7 +366,7 @@ TEST_F(UtBufmgrInit, BoImportFailNullBufmgr)
 
        ret_bo = tbm_bo_import(NULL, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFailNoValidBufmgr)
@@ -379,7 +379,7 @@ TEST_F(UtBufmgrInit, BoImportFailNoValidBufmgr)
 
        ret_bo = tbm_bo_import((tbm_bufmgr)&bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFailNoValidKey)
@@ -391,7 +391,7 @@ TEST_F(UtBufmgrInit, BoImportFailNoValidKey)
 
        ret_bo = tbm_bo_import(bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBoInit, BoImportSuccess)
@@ -407,7 +407,7 @@ TEST_F(UtBoInit, BoImportSuccess)
 
        ret_bo = tbm_bo_import(bufmgr, exported_bo_key);
 
-       ASSERT_NE(ret_bo, NULL);
+       ASSERT_NE(nullptr, ret_bo);
 }
 
 TEST_F(UtBoInit, BoImportSuccessWhenWeImportTwice)
@@ -423,10 +423,10 @@ TEST_F(UtBoInit, BoImportSuccessWhenWeImportTwice)
        ASSERT_NE(exported_bo_key, 0);
 
        ret_bo_1 = tbm_bo_import(bufmgr, exported_bo_key);
-       ASSERT_NE(ret_bo_1, NULL);
+       ASSERT_NE(nullptr, ret_bo_1);
 
        ret_bo_2 = tbm_bo_import(bufmgr, exported_bo_key);
-       ASSERT_NE(ret_bo_2, NULL);
+       ASSERT_NE(nullptr, ret_bo_2);
 
        ASSERT_EQ(ret_bo_1, ret_bo_2);
 }
@@ -440,7 +440,7 @@ TEST(tbmBoImportFd, BoImportFdFailBufmgrWasNotInited)
 
        ret_bo = tbm_bo_import_fd((tbm_bufmgr)&bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFdFailNullBufmgr)
@@ -452,7 +452,7 @@ TEST_F(UtBufmgrInit, BoImportFdFailNullBufmgr)
 
        ret_bo = tbm_bo_import_fd(NULL, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFdFailNoValidBufmgr)
@@ -465,7 +465,7 @@ TEST_F(UtBufmgrInit, BoImportFdFailNoValidBufmgr)
 
        ret_bo = tbm_bo_import_fd((tbm_bufmgr)&bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBufmgrInit, BoImportFdFailNoValidFd)
@@ -477,7 +477,7 @@ TEST_F(UtBufmgrInit, BoImportFdFailNoValidFd)
 
        ret_bo = tbm_bo_import_fd(bufmgr, 20);
 
-       ASSERT_EQ(ret_bo, NULL);
+       ASSERT_EQ(nullptr, ret_bo);
 }
 
 TEST_F(UtBoInit, BoImportFdSuccess)
@@ -493,7 +493,7 @@ TEST_F(UtBoInit, BoImportFdSuccess)
 
        ret_bo = tbm_bo_import_fd(bufmgr, exported_bo_fd);
 
-       ASSERT_NE(ret_bo, NULL);
+       ASSERT_NE(nullptr, ret_bo);
 }
 
 TEST_F(UtBoInit, BoImportFdSuccessWhenWeImportTwice)
@@ -509,10 +509,10 @@ TEST_F(UtBoInit, BoImportFdSuccessWhenWeImportTwice)
        ASSERT_NE(exported_bo_fd, 0);
 
        ret_bo_1 = tbm_bo_import_fd(bufmgr, exported_bo_fd);
-       ASSERT_NE(ret_bo_1, NULL);
+       ASSERT_NE(nullptr, ret_bo_1);
 
        ret_bo_2 = tbm_bo_import_fd(bufmgr, exported_bo_fd);
-       ASSERT_NE(ret_bo_2, NULL);
+       ASSERT_NE(nullptr, ret_bo_2);
 
        ASSERT_EQ(ret_bo_1, ret_bo_2);
 }
@@ -599,7 +599,7 @@ TEST_F(UtInit, BoLockedOnce)
        UtBufmgrInit();
 
        bo = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo, NULL);
+       ASSERT_NE(nullptr, bo);
 
        bo_handle1 = tbm_bo_map(bo, TBM_DEVICE_2D, TBM_OPTION_READ | TBM_OPTION_WRITE);
        bo_handle2 = tbm_bo_map(bo, TBM_DEVICE_2D, TBM_OPTION_READ | TBM_OPTION_WRITE);
@@ -626,7 +626,7 @@ TEST_F(UtInit, BoLockedAlways)
        UtBufmgrInit();
 
        bo = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo, NULL);
+       ASSERT_NE(nullptr, bo);
 
        bo_handle1 = tbm_bo_map(bo, TBM_DEVICE_2D, TBM_OPTION_READ | TBM_OPTION_WRITE);
        bo_handle2 = tbm_bo_map(bo, TBM_DEVICE_2D, TBM_OPTION_READ | TBM_OPTION_WRITE);
@@ -653,7 +653,7 @@ TEST_F(UtInit, BoLockedNone)
        UtBufmgrInit();
 
        bo = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo, NULL);
+       ASSERT_NE(nullptr, bo);
 
        bo_handle1 = tbm_bo_map(bo, TBM_DEVICE_2D, TBM_OPTION_READ | TBM_OPTION_WRITE);
        (void) bo_handle1;
@@ -672,7 +672,7 @@ TEST(BoSwap, BoSwapFailWhenBufmgrWasNotInited)
        int bo1, bo2;
        int ret;
 
-       ret = tbm_bo_swap((tbm_bo)&bo1, (tbm_bo)&bo1);
+       ret = tbm_bo_swap((tbm_bo)&bo1, (tbm_bo)&bo2);
 
        ASSERT_EQ(ret, 0);
 }
@@ -688,7 +688,6 @@ TEST_F(UtBufmgrInit, BoSwapFailNullAll)
 
 TEST_F(UtBoInit, BoSwapFailNoValidBo1)
 {
-       int bo1;
        int ret;
 
        ret = tbm_bo_swap((tbm_bo)&bo, bo);
@@ -713,10 +712,10 @@ TEST_F(UtBufmgrInit, BoSwapFailWhenBosSizeAreDifferent)
        tbm_error_e error;
 
        bo1 = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo1, NULL);
+       ASSERT_NE(nullptr, bo1);
 
        bo2 = tbm_bo_alloc(bufmgr, 256 * 256, TBM_BO_DEFAULT);
-       ASSERT_NE(bo2, NULL);
+       ASSERT_NE(nullptr, bo2);
 
        ret = tbm_bo_swap(bo1, bo2);
 
@@ -735,10 +734,10 @@ TEST_F(UtBufmgrInit, BoSwapSuccess)
        int ret;
 
        bo1 = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo1, NULL);
+       ASSERT_NE(nullptr, bo1);
 
        bo2 = tbm_bo_alloc(bufmgr, 128 * 128, TBM_BO_DEFAULT);
-       ASSERT_NE(bo2, NULL);
+       ASSERT_NE(nullptr, bo2);
 
        ret = tbm_bo_swap(bo1, bo2);
 
@@ -771,7 +770,6 @@ TEST_F(UtBufmgrInit, BoAddUserDataFailNullBo)
 
 TEST_F(UtBoInit, BoAddUserDataFailNoValidBo)
 {
-       int bo1;
        int ret;
 
        ret = tbm_bo_add_user_data((tbm_bo)&bo, 4887, NULL);
@@ -781,7 +779,6 @@ TEST_F(UtBoInit, BoAddUserDataFailNoValidBo)
 
 TEST_F(UtBoInit, BoAddUserDataSuccess)
 {
-       int bo1;
        int ret;
 
        ret = tbm_bo_add_user_data(bo, 4887, NULL);
@@ -790,7 +787,6 @@ TEST_F(UtBoInit, BoAddUserDataSuccess)
 
 TEST_F(UtBoInit, BoAddUserDataFailDataAlreadyExist)
 {
-       int bo1;
        int ret;
 
        ret = tbm_bo_add_user_data(bo, 4887, NULL);
index eb19fb2a88f988d5f09923747be47cab7aaf0b83..8edee92809622e8d2059c0b313332d1553c6c33d 100644 (file)
@@ -7,32 +7,32 @@
 
 TEST_F(UtInit, SurfaceQueryFormatsFailNull)
 {
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
        ut_set_default_tbm_env();
 
-       result = tbm_surface_query_formats(&formats, NULL);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(&formats, NULL);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 
-       result = tbm_surface_query_formats(NULL, &num);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(NULL, &num);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 }
 
 TEST_F(UtInit, SurfaceQueryFormatSuccess)
 {
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
        ut_set_default_tbm_env();
 
-       result = tbm_surface_query_formats(&formats, &num);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(&formats, &num);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
        ASSERT_NE(0, num);
-       ASSERT_NE(NULL, formats);
-       for (int i = 0; i < num; i++)
+       ASSERT_NE((tbm_format *)NULL, formats);
+       for (uint32_t i = 0; i < num; i++)
                ASSERT_NE(0, formats[i]);
        free(formats);
 }
@@ -44,31 +44,31 @@ TEST_F(UtInit, SurfaceCeateFailInvalidGeometry)
        ut_set_default_tbm_env();
 
        surface = tbm_surface_create(-1, 1024, TBM_FORMAT_ARGB8888);
-       ASSERT_EQ(NULL, surface); // Expected Value: NULL
+       ASSERT_EQ(nullptr, surface); // Expected Value: NULL
 
        surface = tbm_surface_create(720, -1, TBM_FORMAT_ARGB8888);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 
        surface = tbm_surface_create(720, 1024, 0);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 }
 
 TEST_F(UtInit, SurfaceCeateSuccess)
 {
        tbm_surface_h surface = NULL;
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
        ut_set_default_tbm_env();
 
-       result = tbm_surface_query_formats(&formats, &num);
+       result = (tbm_surface_error_e)tbm_surface_query_formats(&formats, &num);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
-       for (int i = 0; i < num; i++) {
+       for (uint32_t i = 0; i < num; i++) {
                surface = tbm_surface_create(720, 1024, formats[i]);
-               ASSERT_NE(NULL, surface);
-               result = tbm_surface_destroy(surface);
+               ASSERT_NE((tbm_surface_h)NULL, surface);
+               result = (tbm_surface_error_e)tbm_surface_destroy(surface);
                ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
        }
 }
@@ -136,7 +136,7 @@ TEST_F(UtSurface, SurfaceGetInfoInvalidInput)
        tbm_surface_info_s info;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_get_info(invalid_surface, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(invalid_surface, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_OPERATION, result);
 }
 
@@ -145,13 +145,13 @@ TEST_F(UtSurface, SurfaceGetInfoFailNull)
        tbm_surface_info_s info;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_get_info(surface, NULL);
+       result = (tbm_surface_error_e)tbm_surface_get_info(surface, NULL);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 
-       result = tbm_surface_get_info(NULL, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(NULL, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 
-       result = tbm_surface_get_info(NULL, NULL);
+       result = (tbm_surface_error_e)tbm_surface_get_info(NULL, NULL);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 }
 
@@ -160,7 +160,7 @@ TEST_F(UtSurface, SurfaceGetInfoSuccess)
        tbm_surface_info_s info;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_get_info(surface, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(surface, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
        ASSERT_EQ(this->format, info.format);
        ASSERT_EQ(this->height, info.height);
@@ -176,7 +176,7 @@ TEST_F(UtSurface, SurfaceMapFailInvalidInput)
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
        tbm_surface_h invalid_surface = (tbm_surface_h)1;
 
-       result = tbm_surface_map(invalid_surface, 0, &info);
+       result = (tbm_surface_error_e)tbm_surface_map(invalid_surface, 0, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_OPERATION, result);
 }
 
@@ -185,10 +185,10 @@ TEST_F(UtSurface, SurfaceMapFailNull)
        tbm_surface_info_s info;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_map(surface, 0, NULL);
+       result = (tbm_surface_error_e)tbm_surface_map(surface, 0, NULL);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 
-       result = tbm_surface_map(NULL, 0, &info);
+       result = (tbm_surface_error_e)tbm_surface_map(NULL, 0, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 }
 
@@ -197,7 +197,7 @@ TEST_F(UtSurface, SurfaceMapSuccess)
        tbm_surface_info_s info;
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_map(surface, 0, &info);
+       result = (tbm_surface_error_e)tbm_surface_map(surface, 0, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
        ASSERT_EQ(this->format, info.format);
        ASSERT_EQ(this->height, info.height);
@@ -206,7 +206,7 @@ TEST_F(UtSurface, SurfaceMapSuccess)
        ASSERT_GT(info.bpp, 0);
        ASSERT_GT(info.size, 0);
 
-       result = tbm_surface_unmap(surface);
+       result = (tbm_surface_error_e)tbm_surface_unmap(surface);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 }
 
@@ -214,7 +214,7 @@ TEST_F(UtSurface, SurfaceUnmapFailInvalidInput)
 {
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
        tbm_surface_h invalid_surface = (tbm_surface_h)1;
-       result = tbm_surface_unmap(invalid_surface);
+       result = (tbm_surface_error_e)tbm_surface_unmap(invalid_surface);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 }
 
@@ -222,7 +222,7 @@ TEST_F(UtSurface, SurfaceUnmapFailNull)
 {
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
 
-       result = tbm_surface_unmap(NULL);
+       result = (tbm_surface_error_e)tbm_surface_unmap(NULL);
        ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result);
 }
 
index a69b2d8495d4b83481634c5123882e88a803b265..664fe780fb46c11e1ea88730dc13b5912e526582 100644 (file)
@@ -9,7 +9,7 @@
 /* int tbm_surface_internal_query_supported_formats(uint32_t **formats, uint32_t *num) */
 TEST_F(UtInit, SurfaceInternalQueryFormatsFailNull)
 {
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
@@ -21,15 +21,15 @@ TEST_F(UtInit, SurfaceInternalQueryFormatsFailNull)
 
 TEST_F(UtInit, SurfaceInternalQueryFormatsSuccess)
 {
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
 
        ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
        ASSERT_NE(0, num);
-       ASSERT_NE(NULL, formats);
-       for (int i = 0; i < num; i++)
+       ASSERT_NE((tbm_format *)NULL, formats);
+       for (uint32_t i = 0; i < num; i++)
                ASSERT_NE(0, formats[i]);
 
        if (formats)
@@ -45,31 +45,31 @@ TEST_F(UtInit, SurfaceInternalCeatewithFlagsFailInvalidInput)
        ut_set_default_tbm_env();
 
        surface = tbm_surface_internal_create_with_flags(-1, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, surface); // Expected Value: NULL
+       ASSERT_EQ(nullptr, surface); // Expected Value: NULL
 
        surface = tbm_surface_internal_create_with_flags(720, -1, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 
        surface = tbm_surface_internal_create_with_flags(720, 1024, 0, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 
        surface = tbm_surface_internal_create_with_flags(720, 1024, 0, (TBM_BO_WC << 1));
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 }
 
 TEST_F(UtInit, SurfaceInternalCeatewithFlagsSuccess)
 {
        tbm_surface_h surface = NULL;
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
 
        ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
 
-       for (int i = 0; i < num; i++) {
+       for (uint32_t i = 0; i < num; i++) {
                surface = tbm_surface_internal_create_with_flags(720, 1024, formats[i], TBM_BO_DEFAULT);
-               ASSERT_NE(NULL, surface);
+               ASSERT_NE(nullptr, surface);
                tbm_surface_internal_destroy(surface);
        }
 
@@ -89,7 +89,7 @@ TEST_F(UtInit, SurfaceInternalSurfaceInteranlDestroyFailNULL)
 TEST_F(UtInit, SurfaceInteranlDestroyFailTwice)
 {
        tbm_surface_h surface = NULL;
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
@@ -132,7 +132,7 @@ TEST_F(UtSurfaceInternal, GetNumBosSuccess)
 TEST_F(UtSurfaceInternal, GetBoFailNULL)
 {
        tbm_bo bo = tbm_surface_internal_get_bo(NULL, 0);
-       ASSERT_EQ(NULL, bo);
+       ASSERT_EQ(nullptr, bo);
 }
 
 TEST_F(UtSurfaceInternal, GetBoFailInvalideInput)
@@ -143,16 +143,16 @@ TEST_F(UtSurfaceInternal, GetBoFailInvalideInput)
 
        /* invalid surface */
        bo = tbm_surface_internal_get_bo(invalide_surface, 0);
-       ASSERT_EQ(NULL, bo);
+       ASSERT_EQ(nullptr, bo);
 
        num = tbm_surface_internal_get_num_bos(surface);
        ASSERT_TRUE(num > 0);
 
        /* invalid index of bo */
        bo = tbm_surface_internal_get_bo(surface, -1);
-       ASSERT_EQ(NULL, bo);
+       ASSERT_EQ(nullptr, bo);
        bo = tbm_surface_internal_get_bo(surface, num);
-       ASSERT_EQ(NULL, bo);
+       ASSERT_EQ(nullptr, bo);
 }
 
 TEST_F(UtSurfaceInternal, GetBoSuccess)
@@ -165,7 +165,7 @@ TEST_F(UtSurfaceInternal, GetBoSuccess)
 
        for (int i = 0; i < num; i++) {
                bo = tbm_surface_internal_get_bo(surface, i);
-               ASSERT_NE(NULL, bo);
+               ASSERT_NE((tbm_bo)NULL, bo);
        }
 }
 
@@ -177,16 +177,16 @@ TEST_F(UtSurfaceInternal, CreateWithBosNullInput)
        tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
        tbm_bo bos[1];
 
-       result = tbm_surface_get_info(surface, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(surface, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
        surf = tbm_surface_internal_create_with_bos(NULL, NULL, 1);
 
        surf = tbm_surface_internal_create_with_bos(&info, NULL, 1);
-       ASSERT_EQ(NULL, surf);
+       ASSERT_EQ(nullptr, surf);
 
        surf = tbm_surface_internal_create_with_bos(NULL, bos, 1);
-       ASSERT_EQ(NULL, surf);
+       ASSERT_EQ(nullptr, surf);
 }
 
 TEST_F(UtSurfaceInternal, CreateWithBosFailInvalidInput)
@@ -197,7 +197,7 @@ TEST_F(UtSurfaceInternal, CreateWithBosFailInvalidInput)
        tbm_bo bos[4] = { NULL };
        int num;
 
-       result = tbm_surface_get_info(surface, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(surface, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
        num = tbm_surface_internal_get_num_bos(surface);
@@ -205,20 +205,20 @@ TEST_F(UtSurfaceInternal, CreateWithBosFailInvalidInput)
 
        for (int i = 0; i < num; i++) {
                bos[i] = tbm_surface_internal_get_bo(surface, i);
-               ASSERT_NE(NULL, bos[i]);
+               ASSERT_NE(nullptr, bos[i]);
        }
 
 
        /* wrong number of bo */
        surf = tbm_surface_internal_create_with_bos(&info, bos, num + 1);
-       ASSERT_EQ(NULL, surf);
+       ASSERT_EQ(nullptr, surf);
        surf = tbm_surface_internal_create_with_bos(&info, bos, num - 1);
-       ASSERT_EQ(NULL, surf);
+       ASSERT_EQ(nullptr, surf);
 
        /* invalid bo */
        bos[num-1] = NULL;
        surf = tbm_surface_internal_create_with_bos(&info, bos, num);
-       ASSERT_EQ(NULL, surf);
+       ASSERT_EQ(nullptr, surf);
 }
 
 TEST_F(UtSurfaceInternal, CreateWithBosSuccess)
@@ -229,7 +229,7 @@ TEST_F(UtSurfaceInternal, CreateWithBosSuccess)
        tbm_bo bos[4] = { NULL };
        int num = 0;
 
-       result = tbm_surface_get_info(surface, &info);
+       result = (tbm_surface_error_e)tbm_surface_get_info(surface, &info);
        ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result);
 
        num = tbm_surface_internal_get_num_bos(surface);
@@ -237,29 +237,29 @@ TEST_F(UtSurfaceInternal, CreateWithBosSuccess)
 
        for (int i = 0; i < num; i++) {
                bos[i] = tbm_surface_internal_get_bo(surface, i);
-               ASSERT_NE(NULL, bos[i]);
+               ASSERT_NE(nullptr, bos[i]);
        }
 
        surf = tbm_surface_internal_create_with_bos(&info, bos, num);
-       ASSERT_NE(NULL, surf);
+       ASSERT_NE(nullptr, surf);
        tbm_surface_internal_destroy(surf);
 
        /* set size plane to zero*/
        info.planes[0].size = 0;
        surf = tbm_surface_internal_create_with_bos(&info, bos, num);
-       ASSERT_NE(NULL, surf);
+       ASSERT_NE(nullptr, surf);
        tbm_surface_internal_destroy(surf);
 
        /* set bpp to zero*/
        info.bpp = 0;
        surf = tbm_surface_internal_create_with_bos(&info, bos, num);
-       ASSERT_NE(NULL, surf);
+       ASSERT_NE(nullptr, surf);
        tbm_surface_internal_destroy(surf);
 
        /* set size to zero*/
        info.size = 0;
        surf = tbm_surface_internal_create_with_bos(&info, bos, num);
-       ASSERT_NE(NULL, surf);
+       ASSERT_NE(nullptr, surf);
        tbm_surface_internal_destroy(surf);
 }
 
@@ -436,145 +436,144 @@ static int tbm_data_free_is_called = 0;
 void data_free_handle(void *user_data)
 {
        ASSERT_TRUE(user_data == &tbm_data_free_is_called);
-       int * is_called = user_data;
-       *((int *)user_data) = 1;
+       int *is_called = (int *)user_data;
+       *is_called = 1;
 }
 
 /* tbm_surface_internal_add_user_data(tbm_surface_h surface, unsigned long key, tbm_data_free data_free_func) */
 TEST_F(UtSurfaceInternal, AddUserDataFailNull)
 {
-       static const int key_ud;
-       ASSERT_FALSE(tbm_surface_internal_add_user_data(NULL, &key_ud, NULL));
+       static const unsigned long key_ud = 0;
+       ASSERT_FALSE(tbm_surface_internal_add_user_data(NULL, key_ud, NULL));
 }
 
 TEST_F(UtSurfaceInternal, AddUserDataFailInvaildInput)
 {
-       static const int key_ud;
+       static const unsigned long key_ud = 0;
        int surf;
-       ASSERT_FALSE(tbm_surface_internal_add_user_data((tbm_surface_h)&surf, &key_ud, NULL));
+       ASSERT_FALSE(tbm_surface_internal_add_user_data((tbm_surface_h)&surf, key_ud, NULL));
 }
 
 TEST_F(UtSurfaceInternal, AddUserDataSuccess)
 {
-       int key_ud;
-       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, &key_ud, NULL));
+       unsigned long key_ud;
+       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, key_ud, NULL));
 }
 
 TEST_F(UtSurfaceInternal, AddUserDataFailDoubleKey)
 {
-       int key_ud;
-       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, &key_ud, NULL));
+       unsigned long key_ud;
+       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, key_ud, NULL));
 
-       ASSERT_FALSE(tbm_surface_internal_add_user_data(surface, &key_ud, NULL));
+       ASSERT_FALSE(tbm_surface_internal_add_user_data(surface, key_ud, NULL));
 }
 
 /* tbm_surface_internal_set_user_data(tbm_surface_h surface, unsigned long key, void *data) */
 TEST_F(UtSurfaceInternal, SetUserDataFailNull)
 {
-       static const int key_ud;
-       ASSERT_FALSE(tbm_surface_internal_set_user_data(NULL, &key_ud, &tbm_data_free_is_called));
+       static const unsigned long key_ud = 0;
+       ASSERT_FALSE(tbm_surface_internal_set_user_data(NULL, key_ud, &tbm_data_free_is_called));
 }
 
 TEST_F(UtSurfaceInternal, SetUserDataFailInvaildInput)
 {
-       static const int key_ud;
+       static const unsigned long key_ud = 0;
        int surf;
 
        ASSERT_FALSE(tbm_surface_internal_set_user_data(surface,
-                       &key_ud, &tbm_data_free_is_called)) << "invalid key";
+                       key_ud, &tbm_data_free_is_called)) << "invalid key";
 
        ASSERT_FALSE(tbm_surface_internal_set_user_data((tbm_surface_h)&surf,
-                       &key_ud, &tbm_data_free_is_called)) << "invalid surface";
+                       key_ud, &tbm_data_free_is_called)) << "invalid surface";
 
 }
 
 TEST_F(UtSurfaceInternal, SetUserDataSuccess)
 {
-       int key_ud;
-       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, &key_ud, data_free_handle));
+       unsigned long key_ud;
+       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, key_ud, data_free_handle));
 
        /*the first call*/
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, &tbm_data_free_is_called));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, &tbm_data_free_is_called));
 
        /*the second call: previous data has to be released*/
        tbm_data_free_is_called = 0;
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, NULL));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, NULL));
        ASSERT_TRUE(tbm_data_free_is_called);
 
        /*the third call: previous data(NULL) hasn't to be released*/
        tbm_data_free_is_called = 0;
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, NULL));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, NULL));
        ASSERT_FALSE(tbm_data_free_is_called);
 }
 
 /* tbm_surface_internal_get_user_data(tbm_surface_h surface, unsigned long key, void **data) */
 TEST_F(UtSurfaceInternal, GetUserDataFailNull)
 {
-       static const int key_ud;
-       int * data = NULL;
-       ASSERT_FALSE(tbm_surface_internal_get_user_data(NULL, &key_ud, &data));
+       static const unsigned long key_ud = 0;
+       int *data = NULL;
+       ASSERT_FALSE(tbm_surface_internal_get_user_data(NULL, key_ud, (void **)&data));
 
-       ASSERT_FALSE(tbm_surface_internal_get_user_data(surface, &key_ud, NULL));
+       ASSERT_FALSE(tbm_surface_internal_get_user_data(surface, key_ud, NULL));
 }
 
 TEST_F(UtSurfaceInternal, GetUserDataFailInvaildInput)
 {
-       static const int key_ud;
+       static const unsigned long key_ud = 0;
        int surf;
-       int * data = NULL;
+       int *data = NULL;
 
        ASSERT_FALSE(tbm_surface_internal_get_user_data(surface,
-                       &key_ud, &data)) << "invalid key";
+                       key_ud, (void **)&data)) << "invalid key" << std::endl;
 
        ASSERT_FALSE(tbm_surface_internal_get_user_data((tbm_surface_h)&surf,
-                       &key_ud, &data)) << "invalid surface";
+                       key_ud, (void **)&data)) << "invalid surface" << std::endl;
 
 }
 
 TEST_F(UtSurfaceInternal, GetUserDataSuccess)
 {
-       int key_ud;
-       int * data = NULL;
+       unsigned long key_ud;
+       int *data = NULL;
 
-       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, &key_ud, data_free_handle));
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, &tbm_data_free_is_called));
+       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, key_ud, data_free_handle));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, &tbm_data_free_is_called));
 
        /* check set data */
-       ASSERT_TRUE(tbm_surface_internal_get_user_data(surface, &key_ud, &data));
+       ASSERT_TRUE(tbm_surface_internal_get_user_data(surface, key_ud, (void **)&data));
        ASSERT_TRUE(data == &tbm_data_free_is_called);
 
        /* check if data is NULL */
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, NULL));
-       ASSERT_TRUE(tbm_surface_internal_get_user_data(surface, &key_ud, &data));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, NULL));
+       ASSERT_TRUE(tbm_surface_internal_get_user_data(surface, key_ud, (void **)&data));
        ASSERT_TRUE(data == NULL);
 }
 
 /* tbm_surface_internal_delete_user_data(tbm_surface_h surface, unsigned long key) */
 TEST_F(UtSurfaceInternal, DeleteUserDataFailNull)
 {
-       static const int key_ud;
-       ASSERT_FALSE(tbm_surface_internal_delete_user_data(NULL, &key_ud));
+       static const int key_ud = 0;
+       ASSERT_FALSE(tbm_surface_internal_delete_user_data(NULL, key_ud));
 }
 
 TEST_F(UtSurfaceInternal, DeleteUserDataFailInvaildInput)
 {
-       static const int key_ud;
+       static const int key_ud = 0;
        int surf;
-       ASSERT_FALSE(tbm_surface_internal_delete_user_data(surface, &key_ud)) << "invalid key";
-
-       ASSERT_FALSE(tbm_surface_internal_delete_user_data((tbm_surface_h)&surf, &key_ud)) << "invalid surface";
+       ASSERT_FALSE(tbm_surface_internal_delete_user_data(surface, key_ud)) << "invalid key";
 
+       ASSERT_FALSE(tbm_surface_internal_delete_user_data((tbm_surface_h)&surf, key_ud)) << "invalid surface";
 }
 
 TEST_F(UtSurfaceInternal, DeleteUserDataSuccess)
 {
-       int key_ud;
+       unsigned long key_ud;
 
-       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, &key_ud, data_free_handle));
-       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, &key_ud, &tbm_data_free_is_called));
+       ASSERT_TRUE(tbm_surface_internal_add_user_data(surface, key_ud, data_free_handle));
+       ASSERT_TRUE(tbm_surface_internal_set_user_data(surface, key_ud, &tbm_data_free_is_called));
 
        tbm_data_free_is_called = 0;
-       ASSERT_TRUE(tbm_surface_internal_delete_user_data(surface, &key_ud));
+       ASSERT_TRUE(tbm_surface_internal_delete_user_data(surface, key_ud));
        ASSERT_TRUE(tbm_data_free_is_called);
-       ASSERT_FALSE(tbm_surface_internal_set_user_data(surface, &key_ud, &tbm_data_free_is_called));
+       ASSERT_FALSE(tbm_surface_internal_set_user_data(surface, key_ud, &tbm_data_free_is_called));
 }
index 246c0d725a07313608db5c03347e39e9170a7b48..ca819072d4772e95a8e069505f8481ce9dc28ba3 100644 (file)
@@ -46,22 +46,22 @@ TEST(UtSurfaceQueueCreate, CreateFailInvalidInput)
        ut_set_default_tbm_env();
 
        queue = tbm_surface_queue_create(-1, 720, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue); // Expected Value: NULL
+       ASSERT_EQ(nullptr, queue); // Expected Value: NULL
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, -1, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, 720, -1, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, 720, 1024, 0, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 }
 
 TEST(UtSurfaceQueueCreate, CreateSuccess)
 {
        tbm_surface_queue_h queue = NULL;
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
@@ -69,7 +69,7 @@ TEST(UtSurfaceQueueCreate, CreateSuccess)
        ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, 720, 1024, formats[0], TBM_BO_DEFAULT);
-       ASSERT_NE(NULL, queue);
+       ASSERT_NE(nullptr, queue);
 
        tbm_surface_queue_destroy(queue);
 
@@ -86,22 +86,22 @@ TEST(UtSurfaceQueueCreate, SequenceCreateFailInvalidInput)
        ut_set_default_tbm_env();
 
        queue = tbm_surface_queue_sequence_create(-1, 720, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue); // Expected Value: NULL
+       ASSERT_EQ(nullptr, queue); // Expected Value: NULL
 
        queue = tbm_surface_queue_sequence_create(QUEUE_SIZE, -1, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 
        queue = tbm_surface_queue_sequence_create(QUEUE_SIZE, 720, -1, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 
        queue = tbm_surface_queue_sequence_create(QUEUE_SIZE, 720, 1024, 0, TBM_BO_DEFAULT);
-       ASSERT_EQ(NULL, queue);
+       ASSERT_EQ(nullptr, queue);
 }
 
 TEST(UtSurfaceQueueCreate, SequenceCreateSuccess)
 {
        tbm_surface_queue_h queue = NULL;
-       int num = 0;
+       uint32_t num = 0;
        tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
@@ -109,7 +109,7 @@ TEST(UtSurfaceQueueCreate, SequenceCreateSuccess)
        ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
 
        queue = tbm_surface_queue_create(QUEUE_SIZE, 720, 1024, formats[0], TBM_BO_DEFAULT);
-       ASSERT_NE(NULL, queue);
+       ASSERT_NE(nullptr, queue);
 
        free(formats);
 }
@@ -159,12 +159,12 @@ TEST_F(UtSurfaceQueue, DequeueSuccess)
        for (int i = 0; i < QUEUE_SIZE; i++) {
                result = tbm_surface_queue_dequeue(queue, &surface);
                ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-               ASSERT_NE(NULL, surface);
+               ASSERT_NE((tbm_surface_h)NULL, surface);
        }
 
        result = tbm_surface_queue_dequeue(queue, &surface);
        ASSERT_NE(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 }
 
 /* tbm_surface_queue_error_e tbm_surface_queue_get_surfaces( tbm_surface_queue_h surface_queue,
@@ -207,7 +207,7 @@ TEST_F(UtSurfaceQueue, GetSurfacesSuccess)
        for (int i = 0; i < QUEUE_SIZE; i++) {
                result = tbm_surface_queue_dequeue(queue, &surface);
                ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-               ASSERT_NE(NULL, surface);
+               ASSERT_NE(nullptr, surface);
        }
 
        /* test */
@@ -215,7 +215,7 @@ TEST_F(UtSurfaceQueue, GetSurfacesSuccess)
        ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
        ASSERT_EQ(QUEUE_SIZE, num);
        for (int i = 0; i < QUEUE_SIZE; i++)
-               ASSERT_NE(NULL, surfaces[i]);
+               ASSERT_NE(nullptr, surfaces[i]);
 }
 
 /* tbm_surface_queue_error_e tbm_surface_queue_cancel_dequeue(
@@ -255,13 +255,13 @@ TEST_F(UtSurfaceQueue, CancelDequeueSuccess)
        for (int i = 0; i < QUEUE_SIZE; i++) {
                result = tbm_surface_queue_dequeue(queue, &surface);
                ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-               ASSERT_NE(NULL, surface);
+               ASSERT_NE(nullptr, surface);
        }
 
        last_surface = surface;
        result = tbm_surface_queue_dequeue(queue, &surface);
        ASSERT_NE(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 
        /* test */
        result = tbm_surface_queue_cancel_dequeue(queue, last_surface);
@@ -381,7 +381,7 @@ TEST_F(UtSurfaceQueue, AcquireSuccess)
        /* test: acquire empty queue*/
        result = tbm_surface_queue_acquire(queue, &acquired_surface);
        ASSERT_NE(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-       ASSERT_EQ(NULL, acquired_surface);
+       ASSERT_EQ(nullptr, acquired_surface);
 }
 
 /* tbm_surface_queue_error_e tbm_surface_queue_cancel_acquire(
@@ -437,7 +437,7 @@ TEST_F(UtSurfaceQueue, CancelAcquireSuccess)
        last_surface = surface;
        result = tbm_surface_queue_acquire(queue, &surface);
        ASSERT_NE(TBM_SURFACE_QUEUE_ERROR_NONE, result);
-       ASSERT_EQ(NULL, surface);
+       ASSERT_EQ(nullptr, surface);
 
        /* test */
        result = tbm_surface_queue_cancel_acquire(queue, last_surface);