From 34697b76b4c91b9c1c9866c885a4976128341e2f Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Fri, 27 Apr 2018 15:32:41 +0900 Subject: [PATCH] utest: check the valid return values of get_width/height on surface tests Change-Id: Idf8645ffc643ea7cf1fb25c08cdcdd63888b97c8 --- utests/ut_tbm_surface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)); } -- 2.7.4