utest: check the valid return values of get_width/height on surface tests 29/177329/1 accepted/tizen/unified/20180430.072100 submit/tizen/20180427.043352
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 27 Apr 2018 06:32:41 +0000 (15:32 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 27 Apr 2018 06:32:41 +0000 (15:32 +0900)
Change-Id: Idf8645ffc643ea7cf1fb25c08cdcdd63888b97c8

utests/ut_tbm_surface.cpp

index 4e4f64c..9ea2a31 100644 (file)
@@ -152,7 +152,7 @@ TEST_F(TBMSurface, SurfaceGetWidthFailInvalidInput)
 {
        tbm_surface_h invalid_surface = (tbm_surface_h)1;
        int width = tbm_surface_get_width(invalid_surface);
-       EXPECT_EQ(0, width);
+       EXPECT_EQ(width, TBM_SURFACE_ERROR_INVALID_PARAMETER);
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_SURFACE_ERROR_INVALID_PARAMETER));
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_ERROR_INVALID_PARAMETER));
 }
@@ -160,7 +160,7 @@ TEST_F(TBMSurface, SurfaceGetWidthFailInvalidInput)
 TEST_F(TBMSurface, SurfaceGetWidthFailNull)
 {
        int width = tbm_surface_get_width(NULL);
-       EXPECT_EQ(width, 0);
+       EXPECT_EQ(width, TBM_SURFACE_ERROR_INVALID_PARAMETER);
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_SURFACE_ERROR_INVALID_PARAMETER));
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_ERROR_INVALID_PARAMETER));
 }
@@ -177,7 +177,7 @@ TEST_F(TBMSurface, SurfaceGetHeightFailInvalidInput)
 {
        tbm_surface_h invalid_surface = (tbm_surface_h)1;
        int height = tbm_surface_get_height(invalid_surface);
-       EXPECT_EQ(0, height);
+       EXPECT_EQ(height, TBM_SURFACE_ERROR_INVALID_PARAMETER);
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_SURFACE_ERROR_INVALID_PARAMETER));
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_ERROR_INVALID_PARAMETER));
 }
@@ -185,7 +185,7 @@ TEST_F(TBMSurface, SurfaceGetHeightFailInvalidInput)
 TEST_F(TBMSurface, SurfaceGetHeightFailNull)
 {
        int height = tbm_surface_get_height(NULL);
-       EXPECT_EQ(height, 0);
+       EXPECT_EQ(height, TBM_SURFACE_ERROR_INVALID_PARAMETER);
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_SURFACE_ERROR_INVALID_PARAMETER));
        EXPECT_STREQ(tbm_error_str(tbm_get_last_error()), tbm_error_str(TBM_ERROR_INVALID_PARAMETER));
 }