From 9479ce5eeefdd478119217a7eb1fe0618a6b251a Mon Sep 17 00:00:00 2001 From: "Junkyeong, Kim" Date: Wed, 26 May 2021 19:29:51 +0900 Subject: [PATCH] e_test_event: Do not execute verifyTC if resolution is not match The reference image size is 720x1280. So execute verifyTC only 720x1280 resolution. Change-Id: I99a73b9d098f2a03ad9073765cd2aa57b38db9cf Signed-off-by: Junkyeong, Kim --- src/e_test_event.cpp | 17 +++++++++++++---- src/e_test_event.h | 2 ++ src/e_test_util.h | 5 ++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 2d03416..6496971 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -163,6 +163,7 @@ Eina_Bool etRunner::init() { Eina_Bool res = EINA_FALSE; + int screenshot_w = 0, screenshot_h = 0; worker.waitTime = E_TEST_WORK_TIME; @@ -216,9 +217,16 @@ etRunner::init() res = addSignalHandlers(); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - screenshot = efl_util_screenshot_initialize(CAPTURE_WIDTH, CAPTURE_HEIGHT); - if (screenshot == NULL) - ERR("efl_util_screenshot_initialize fail\n"); + execute_verifyTC = EINA_FALSE; + if ((output.w == CAPTURE_WIDTH_MOBILE) && (output.h == CAPTURE_HEIGHT_MOBILE)) + { + execute_verifyTC = EINA_TRUE; + screenshot_w = CAPTURE_WIDTH_MOBILE; + screenshot_h = CAPTURE_HEIGHT_MOBILE; + screenshot = efl_util_screenshot_initialize(screenshot_w, screenshot_h); + if (screenshot == NULL) + ERR("efl_util_screenshot_initialize fail\n"); + } return EINA_TRUE; } @@ -3128,6 +3136,7 @@ etRunner::verifyTC(std::string basetype, std::string tcname) tbm_surface_h surface = NULL; Eina_Bool ret = EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(execute_verifyTC, EINA_TRUE); EINA_SAFETY_ON_NULL_RETURN_VAL(screenshot, EINA_FALSE); surface = efl_util_screenshot_take_tbm_surface(screenshot); @@ -3148,4 +3157,4 @@ etRunner::verifyTC(std::string basetype, std::string tcname) // UT_WAIT("test"); return ret; -} \ No newline at end of file +} diff --git a/src/e_test_event.h b/src/e_test_event.h index a7773cb..4000103 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -244,6 +244,8 @@ public: /* TODO: make it hidden */ int x, y, w, h; } output; + Eina_Bool execute_verifyTC; + public: Eina_Bool init(); void shutdown(); diff --git a/src/e_test_util.h b/src/e_test_util.h index d8335fd..fb8f97e 100644 --- a/src/e_test_util.h +++ b/src/e_test_util.h @@ -287,9 +287,8 @@ typedef struct _Window_Info_List ASSERT_TRUE(ev_result_iconic->isUniconified()) << "Window is iconified"; \ } while (0) - -#define CAPTURE_WIDTH 720 -#define CAPTURE_HEIGHT 1280 +#define CAPTURE_WIDTH_MOBILE 720 +#define CAPTURE_HEIGHT_MOBILE 1280 #define PNG_DEPTH 8 #define C(b, m) (((b) >> (m)) & 0xFF) #define FOURCC_STR(id) C(id, 0), C(id, 8), C(id, 16), C(id, 24) -- 2.7.4