From: Roman Marchenko Date: Mon, 11 Dec 2017 12:14:14 +0000 (+0200) Subject: utest: fix wrong tests for tdm_hwc_window.c X-Git-Tag: accepted/tizen/unified/20171215.060624~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F10%2F163610%2F2;p=platform%2Fcore%2Fuifw%2Flibtdm.git utest: fix wrong tests for tdm_hwc_window.c - check incorrect composition types Change-Id: I22f93ab4c609afe805abdbaca9b3cf62c484828b Signed-off-by: Roman Marchenko --- diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 24b6207..f9b735c 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -138,6 +138,9 @@ tdm_hwc_window_set_composition_type(tdm_hwc_window *hwc_window, tdm_func_hwc_window *func_hwc_window = NULL; HWC_WINDOW_FUNC_ENTRY(); + TDM_RETURN_VAL_IF_FAIL(composition_type >= TDM_COMPOSITION_NONE, TDM_ERROR_INVALID_PARAMETER); + TDM_RETURN_VAL_IF_FAIL(composition_type <= TDM_COMPOSITION_CURSOR, TDM_ERROR_INVALID_PARAMETER); + TDM_RETURN_VAL_IF_FAIL(composition_type != TDM_COMPOSITION_DEVICE_CANDIDATE, TDM_ERROR_INVALID_PARAMETER); _pthread_mutex_lock(&private_display->lock); diff --git a/utests/src/ut_tdm_hwc_window.cpp b/utests/src/ut_tdm_hwc_window.cpp index ed12a59..043d4c8 100644 --- a/utests/src/ut_tdm_hwc_window.cpp +++ b/utests/src/ut_tdm_hwc_window.cpp @@ -469,9 +469,7 @@ TEST_F(TDMHwcWindow, SetCompositionTypeFailInvalieCompositionType) for (int i = 0; i < hwc_count; i++) { error = tdm_hwc_window_set_composition_type(hwc_wins[i], TDM_COMPOSITION_DEVICE_CANDIDATE); ASSERT_NE(TDM_ERROR_NONE, error); - error = tdm_hwc_window_set_composition_type(hwc_wins[i], TDM_COMPOSITION_CLIENT_CANDIDATE); - ASSERT_NE(TDM_ERROR_NONE, error); - error = tdm_hwc_window_set_composition_type(hwc_wins[i], tdm_hwc_window_composition(TDM_COMPOSITION_CLIENT+1)); + error = tdm_hwc_window_set_composition_type(hwc_wins[i], tdm_hwc_window_composition(TDM_COMPOSITION_NONE-1)); ASSERT_NE(TDM_ERROR_NONE, error); } }