From 33772bef326fffdb119e9ab6af52554391c4bd61 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 20 Feb 2018 17:34:07 +0900 Subject: [PATCH] utest: rename UtSurface to SurfaceTest Change-Id: If8e63e21dabd15f28685a823ae003b9590351a51 --- utests/ut.cpp | 18 +++++++++--------- utests/ut.h | 4 ++-- utests/ut_tbm_surface.cpp | 34 +++++++++++++++++----------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/utests/ut.cpp b/utests/ut.cpp index bbd8e5a..bc207de 100644 --- a/utests/ut.cpp +++ b/utests/ut.cpp @@ -62,13 +62,13 @@ void ut_set_default_tbm_env() setenv("TBM_DISPLAY_SERVER", "1", 1); } -int UtSurface::width = 720; -int UtSurface::height = 1024; -tbm_format UtSurface::format; -uint32_t UtSurface::num_formats; -tbm_format *UtSurface::formats; +int SurfaceTest::width = 720; +int SurfaceTest::height = 1024; +tbm_format SurfaceTest::format; +uint32_t SurfaceTest::num_formats; +tbm_format *SurfaceTest::formats; -void UtSurface::SetUpTestCase() +void SurfaceTest::SetUpTestCase() { tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -86,20 +86,20 @@ void UtSurface::SetUpTestCase() format = formats[0]; } -void UtSurface::TearDownTestCase() +void SurfaceTest::TearDownTestCase() { if (formats) free(formats); } -void UtSurface::SetUp() +void SurfaceTest::SetUp() { surface = tbm_surface_create(width, height, format); ASSERT_TRUE(surface != NULL); } -void UtSurface::TearDown() +void SurfaceTest::TearDown() { if (surface) tbm_surface_destroy(surface); diff --git a/utests/ut.h b/utests/ut.h index fdf15b6..09f6f32 100644 --- a/utests/ut.h +++ b/utests/ut.h @@ -51,7 +51,7 @@ void ut_set_default_tbm_env(); /* test fixture class, which initializes bufmgr and allocate the tbm surface before the tests and * deinitializes bufmgr after tests which use the test fixture with this class */ -class UtSurface : public ::testing::Test +class SurfaceTest : public ::testing::Test { protected: static void SetUpTestCase(); @@ -69,7 +69,7 @@ public: tbm_surface_h surface; }; -typedef UtSurface UtSurfaceInternal; +typedef SurfaceTest UtSurfaceInternal; #define QUEUE_SIZE 3 diff --git a/utests/ut_tbm_surface.cpp b/utests/ut_tbm_surface.cpp index bbb5f2f..51141aa 100644 --- a/utests/ut_tbm_surface.cpp +++ b/utests/ut_tbm_surface.cpp @@ -73,64 +73,64 @@ TEST_F(UtInit, SurfaceCeateSuccess) } } -TEST_F(UtSurface, SurfaceGetFormatFailInvalidInput) +TEST_F(SurfaceTest, SurfaceGetFormatFailInvalidInput) { tbm_surface_h invalid_surface = (tbm_surface_h)1; tbm_format fmt = tbm_surface_get_format(invalid_surface); ASSERT_EQ(0, fmt); } -TEST_F(UtSurface, SurfaceGetFormatFailNull) +TEST_F(SurfaceTest, SurfaceGetFormatFailNull) { tbm_format fmt = tbm_surface_get_format(NULL); ASSERT_EQ(0, fmt); } -TEST_F(UtSurface, SurfaceGetFormatSuccess) +TEST_F(SurfaceTest, SurfaceGetFormatSuccess) { tbm_format fmt = tbm_surface_get_format(surface); ASSERT_EQ(this->format, fmt); } -TEST_F(UtSurface, SurfaceGetWidthFailInvalidInput) +TEST_F(SurfaceTest, SurfaceGetWidthFailInvalidInput) { tbm_surface_h invalid_surface = (tbm_surface_h)1; int width = tbm_surface_get_width(invalid_surface); ASSERT_EQ(0, width); } -TEST_F(UtSurface, SurfaceGetWidthFailNull) +TEST_F(SurfaceTest, SurfaceGetWidthFailNull) { int width = tbm_surface_get_width(NULL); ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, width); } -TEST_F(UtSurface, SurfaceGetWidthSuccess) +TEST_F(SurfaceTest, SurfaceGetWidthSuccess) { int width = tbm_surface_get_width(surface); ASSERT_EQ(this->width, width); } -TEST_F(UtSurface, SurfaceGetHeightFailInvalidInput) +TEST_F(SurfaceTest, SurfaceGetHeightFailInvalidInput) { tbm_surface_h invalid_surface = (tbm_surface_h)1; int height = tbm_surface_get_height(invalid_surface); ASSERT_EQ(0, height); } -TEST_F(UtSurface, SurfaceGetHeightFailNull) +TEST_F(SurfaceTest, SurfaceGetHeightFailNull) { int height = tbm_surface_get_height(NULL); ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, height); } -TEST_F(UtSurface, SurfaceGetHeightSuccess) +TEST_F(SurfaceTest, SurfaceGetHeightSuccess) { int height = tbm_surface_get_height(surface); ASSERT_EQ(this->height, height); } -TEST_F(UtSurface, SurfaceGetInfoInvalidInput) +TEST_F(SurfaceTest, SurfaceGetInfoInvalidInput) { tbm_surface_h invalid_surface = (tbm_surface_h)1; tbm_surface_info_s info; @@ -140,7 +140,7 @@ TEST_F(UtSurface, SurfaceGetInfoInvalidInput) ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_OPERATION, result); } -TEST_F(UtSurface, SurfaceGetInfoFailNull) +TEST_F(SurfaceTest, SurfaceGetInfoFailNull) { tbm_surface_info_s info; tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -155,7 +155,7 @@ TEST_F(UtSurface, SurfaceGetInfoFailNull) ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result); } -TEST_F(UtSurface, SurfaceGetInfoSuccess) +TEST_F(SurfaceTest, SurfaceGetInfoSuccess) { tbm_surface_info_s info; tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -170,7 +170,7 @@ TEST_F(UtSurface, SurfaceGetInfoSuccess) ASSERT_GT(info.size, 0); } -TEST_F(UtSurface, SurfaceMapFailInvalidInput) +TEST_F(SurfaceTest, SurfaceMapFailInvalidInput) { tbm_surface_info_s info; tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -180,7 +180,7 @@ TEST_F(UtSurface, SurfaceMapFailInvalidInput) ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_OPERATION, result); } -TEST_F(UtSurface, SurfaceMapFailNull) +TEST_F(SurfaceTest, SurfaceMapFailNull) { tbm_surface_info_s info; tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -192,7 +192,7 @@ TEST_F(UtSurface, SurfaceMapFailNull) ASSERT_EQ(TBM_SURFACE_ERROR_INVALID_PARAMETER, result); } -TEST_F(UtSurface, SurfaceMapSuccess) +TEST_F(SurfaceTest, SurfaceMapSuccess) { tbm_surface_info_s info; tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; @@ -210,7 +210,7 @@ TEST_F(UtSurface, SurfaceMapSuccess) ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result); } -TEST_F(UtSurface, SurfaceUnmapFailInvalidInput) +TEST_F(SurfaceTest, SurfaceUnmapFailInvalidInput) { tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; tbm_surface_h invalid_surface = (tbm_surface_h)1; @@ -218,7 +218,7 @@ TEST_F(UtSurface, SurfaceUnmapFailInvalidInput) ASSERT_EQ(TBM_SURFACE_ERROR_NONE, result); } -TEST_F(UtSurface, SurfaceUnmapFailNull) +TEST_F(SurfaceTest, SurfaceUnmapFailNull) { tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; -- 2.7.4