diff options
author | TaeminYeom <taemin.yeom@samsung.com> | 2023-01-19 16:23:20 +0900 |
---|---|---|
committer | Taemin Yeom <taemin.yeom@samsung.com> | 2023-01-20 01:32:49 +0000 |
commit | 250dc889e133288a907e18a14de48a54fd4251ef (patch) | |
tree | ef29ad93381905f006756e2f548b43c152648b25 | |
parent | c74bc0b05fb4f0be11104106ae0ff414ed50027a (diff) | |
download | device-250dc889e133288a907e18a14de48a54fd4251ef.tar.gz device-250dc889e133288a907e18a14de48a54fd4251ef.tar.bz2 device-250dc889e133288a907e18a14de48a54fd4251ef.zip |
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 <taemin.yeom@samsung.com>
(cherry picked from commit 07c580d769debb88afa55dc83a3a9f36fde2684f)
-rw-r--r-- | haltest/board.cpp | 2 | ||||
-rw-r--r-- | haltest/display.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
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"); |