From: TaeminYeom Date: Thu, 19 Jan 2023 07:23:20 +0000 (+0900) Subject: haltest: Initialize local variables X-Git-Tag: accepted/tizen/unified/20230209.111257~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07c580d769debb88afa55dc83a3a9f36fde2684f;p=platform%2Fhal%2Fapi%2Fdevice.git haltest: Initialize local variables These local variables are used to get the values in the hal backend function with pointer. If there is an error in hal backend function, it is possible to use uninitialized local variables. Change-Id: I43eadbe13f19e8fb3bd9537b610db6bc773b7d6f Signed-off-by: TaeminYeom --- diff --git a/haltest/board.cpp b/haltest/board.cpp index 4028b8e..a096801 100644 --- a/haltest/board.cpp +++ b/haltest/board.cpp @@ -36,7 +36,7 @@ TEST_F(BOARD, GetDeviceSerialP) TEST_F(BOARD, GetDeviceRevisionP) { int ret_val; - int revision; + int revision = 0; ret_val = hal_device_board_get_device_revision(&revision); if (ret_val == -ENODEV) { diff --git a/haltest/display.cpp b/haltest/display.cpp index e37bdaf..9bb7e14 100644 --- a/haltest/display.cpp +++ b/haltest/display.cpp @@ -284,7 +284,7 @@ TEST_F(DISPLAY, SetImageEffectP) { int ret_val; int set_image_effect, get_image_effect; - enum display_image_effect get_image_effect_raw; + enum display_image_effect get_image_effect_raw = DISPLAY_IMAGE_EFFECT_STANDARD; if (!DISPLAY::supported) { SKIP_MESSAGE("Display not supported"); @@ -336,7 +336,7 @@ TEST_F(DISPLAY, SetPanelModeP) { int ret_val; int panel_mode; - enum display_panel_mode panel_mode_raw; + enum display_panel_mode panel_mode_raw = DISPLAY_PANEL_MODE_STANDARD; if (!DISPLAY::supported) { SKIP_MESSAGE("Display not supported"); @@ -460,7 +460,7 @@ TEST_F(DISPLAY, GetFrameRateP) TEST_F(DISPLAY, SetFrameRateP) { - int ret_val, fmax; + int ret_val, fmax = 0; if (!DISPLAY::supported) { SKIP_MESSAGE("Display not supported");