From: SooChan Lim Date: Fri, 27 Apr 2018 06:32:41 +0000 (+0900) Subject: utest: check the valid return values of get_width/height on surface tests X-Git-Tag: submit/tizen/20180427.043352^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34697b76b4c91b9c1c9866c885a4976128341e2f;p=platform%2Fcore%2Fuifw%2Flibtbm.git utest: check the valid return values of get_width/height on surface tests Change-Id: Idf8645ffc643ea7cf1fb25c08cdcdd63888b97c8 --- diff --git a/utests/ut_tbm_surface.cpp b/utests/ut_tbm_surface.cpp index 4e4f64c..9ea2a31 100644 --- a/utests/ut_tbm_surface.cpp +++ b/utests/ut_tbm_surface.cpp @@ -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)); }