From: Yeongjong Lee Date: Tue, 26 Mar 2019 10:48:30 +0000 (+0900) Subject: elm_win: fix correct return value on elm_win_rotation_get X-Git-Tag: accepted/tizen/unified/20190327.160540~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ef9f3609ae60ad84306cbd0cb535dd9074b123c;p=platform%2Fupstream%2Fefl.git elm_win: fix correct return value on elm_win_rotation_get Summary: Before b3327c761e, -1 was returned on`elm_win_rotation_get`, if `obj` is NULL. This fixes backward compatibility. Test Plan: make check Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8474 --- diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 95e5a15..49f132e 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1988,6 +1988,7 @@ elm_win_rotation_set(Evas_Object *obj, int rotation) EAPI int elm_win_rotation_get(const Evas_Object *obj) { + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, -1); return efl_ui_win_rotation_get(obj); } diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index 92daf1c..9327327 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -459,6 +459,7 @@ EFL_START_TEST(elm_win_test_rotation) ck_assert_int_eq(elm_win_rotation_get(win), 90); elm_win_rotation_with_resize_set(win, 180); ck_assert_int_eq(elm_win_rotation_get(win), 180); + ck_assert_int_eq(elm_win_rotation_get(NULL), -1); } EFL_END_TEST