utest: change the some UtInit testcase to the SurfaceInternalTest 98/170598/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 20 Feb 2018 11:09:13 +0000 (20:09 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 20 Feb 2018 11:09:13 +0000 (20:09 +0900)
Change-Id: Id0f24df179318c845799f0f89e18d876c4d49647

utests/ut_tbm_surface_internal.cpp

index cdade18..361359f 100644 (file)
@@ -39,71 +39,58 @@ TEST_F(UtInit, SurfaceInternalQueryFormatsSuccess)
 
 
 /* tbm_surface_h tbm_surface_internal_create_with_flags(int width, int height, int format, int flags) */
-TEST_F(UtInit, SurfaceInternalCeatewithFlagsFailInvalidInput)
+TEST_F(SurfaceInternalTest, SurfaceInternalCeatewithFlagsFailInvalidInput)
 {
-       tbm_surface_h surface = NULL;
+       tbm_surface_h surf1 = NULL;
 
        ut_set_default_tbm_env();
 
-       surface = tbm_surface_internal_create_with_flags(-1, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(nullptr, surface); // Expected Value: NULL
+       surf1 = tbm_surface_internal_create_with_flags(-1, 1024, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
+       ASSERT_EQ(nullptr, surf1); // Expected Value: NULL
 
-       surface = tbm_surface_internal_create_with_flags(720, -1, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
-       ASSERT_EQ(nullptr, surface);
+       surf1 = tbm_surface_internal_create_with_flags(720, -1, TBM_FORMAT_ARGB8888, TBM_BO_DEFAULT);
+       ASSERT_EQ(nullptr, surf1);
 
-       surface = tbm_surface_internal_create_with_flags(720, 1024, 0, TBM_BO_DEFAULT);
-       ASSERT_EQ(nullptr, surface);
+       surf1 = tbm_surface_internal_create_with_flags(720, 1024, 0, TBM_BO_DEFAULT);
+       ASSERT_EQ(nullptr, surf1);
 
-       surface = tbm_surface_internal_create_with_flags(720, 1024, 0, (TBM_BO_WC << 1));
-       ASSERT_EQ(nullptr, surface);
+       surf1 = tbm_surface_internal_create_with_flags(720, 1024, 0, (TBM_BO_WC << 1));
+       ASSERT_EQ(nullptr, surf1);
 }
 
-TEST_F(UtInit, SurfaceInternalCeatewithFlagsSuccess)
+TEST_F(SurfaceInternalTest, SurfaceInternalCeatewithFlagsSuccess)
 {
-       tbm_surface_h surface = NULL;
+       tbm_surface_h surf1 = NULL;
        uint32_t num = 0;
-       tbm_format *formats = NULL;
 
        ut_set_default_tbm_env();
 
-       ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
-
        for (uint32_t i = 0; i < num; i++) {
-               surface = tbm_surface_internal_create_with_flags(720, 1024, formats[i], TBM_BO_DEFAULT);
-               ASSERT_NE(nullptr, surface);
+               surf1 = tbm_surface_internal_create_with_flags(720, 1024, formats[i], TBM_BO_DEFAULT);
+               ASSERT_NE(nullptr, surf1);
                tbm_surface_internal_destroy(surface);
        }
-
-       if (formats)
-               free(formats);
 }
 
 
 /* void tbm_surface_internal_destroy(tbm_surface_h surface) */
-TEST_F(UtInit, SurfaceInternalSurfaceInteranlDestroyFailNULL)
+TEST_F(SurfaceInternalTest, SurfaceInternalSurfaceInteranlDestroyFailNULL)
 {
        ut_set_default_tbm_env();
 
        tbm_surface_internal_destroy(NULL);
 }
 
-TEST_F(UtInit, SurfaceInteranlDestroyFailTwice)
+TEST_F(SurfaceInternalTest, SurfaceInteranlDestroyFailTwice)
 {
-       tbm_surface_h surface = NULL;
-       uint32_t num = 0;
-       tbm_format *formats = NULL;
-
-       ASSERT_TRUE(tbm_surface_internal_query_supported_formats(&formats, &num));
-       ASSERT_TRUE(formats != NULL);
-       ASSERT_TRUE(num > 0);
+       tbm_surface_h surf = NULL;
 
-       surface = tbm_surface_internal_create_with_flags(720, 1024, formats[0], TBM_BO_DEFAULT);
+       surf = tbm_surface_internal_create_with_flags(720, 1024, formats[0], TBM_BO_DEFAULT);
 
-       tbm_surface_internal_destroy(surface);
+       tbm_surface_internal_destroy(surf);
 
-       tbm_surface_internal_destroy(surface);
+       tbm_surface_internal_destroy(surf);
 
-       free(formats);
 }
 
 
@@ -288,12 +275,12 @@ TEST_F(SurfaceInternalTest, UnrefSuccess)
 }
 
 /* void tbm_surface_internal_ref(tbm_surface_h surface) */
-TEST_F(UtInit, RefFailNull)
+TEST_F(SurfaceInternalTest, RefFailNull)
 {
        tbm_surface_internal_ref(NULL);
 }
 
-TEST_F(UtInit, RefFailInvaildInput)
+TEST_F(SurfaceInternalTest, RefFailInvaildInput)
 {
        int surf;
        tbm_surface_internal_ref((tbm_surface_h)&surf);
@@ -307,7 +294,7 @@ TEST_F(SurfaceInternalTest, RefSuccess)
 }
 
 /* tbm_surface_internal_get_num_planes() */
-TEST_F(UtInit, GetNumPlanes)
+TEST_F(SurfaceInternalTest, GetNumPlanes)
 {
        int num = 0;
        num = tbm_surface_internal_get_num_planes(0);
@@ -372,7 +359,7 @@ TEST_F(SurfaceInternalTest, GetPlaneDataSuccess)
 }
 
 /* tbm_surface_internal_get_bpp(tbm_format format) */
-TEST_F(UtInit, GetBpp)
+TEST_F(SurfaceInternalTest, GetBpp)
 {
        int bpp = 0;
        bpp = tbm_surface_internal_get_bpp(0);