From: dyamy-lee Date: Mon, 26 Apr 2021 05:05:42 +0000 (+0900) Subject: Add Initialization of variable X-Git-Tag: accepted/tizen/unified/20240105.013022~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96f8e3443a7f2bf7f69e291e1db409964eeb8055;p=platform%2Fupstream%2Flibinput.git Add Initialization of variable Add initialization for uninitialized pointer field. Add initialization for uninitialized value of struct field. Change-Id: I2faf84800bf54abdff4f18a1d920b1a162a07ad0 --- diff --git a/haltests/test_hal_libinput.h b/haltests/test_hal_libinput.h index 8e365c31..cb19a330 100644 --- a/haltests/test_hal_libinput.h +++ b/haltests/test_hal_libinput.h @@ -22,8 +22,8 @@ class LibInputHalTest : public ::testing::Test void SetUp(void); void TearDown(void); - struct libinput *li; - struct udev *udev_context; + struct libinput *li = NULL; + struct udev *udev_context = NULL; }; #endif // __LIBINPUT_TESTS_H__ diff --git a/haltests/test_hal_libinput_info.cpp b/haltests/test_hal_libinput_info.cpp index ce0fa1c5..b39f3dc6 100644 --- a/haltests/test_hal_libinput_info.cpp +++ b/haltests/test_hal_libinput_info.cpp @@ -438,6 +438,8 @@ int create_mouse_event(struct libinput *li, int idx) {LIBINPUT_EVENT_POINTER_MOTION, 0, 120, 120, 2}, {LIBINPUT_EVENT_POINTER_BUTTON, (int) BTN_LEFT, 200, 200, 0} }; + struct record_libinput_event_keyboard k = {LIBINPUT_EVENT_NONE, 0, 0}; + struct record_libinput_event_touch t = {LIBINPUT_EVENT_NONE, 0, 0, 0, 0}; if(devices[idx].cap == LIBINPUT_DEVICE_CAP_POINTER){ LOG("create_mouse_event\n"); @@ -452,6 +454,8 @@ int create_mouse_event(struct libinput *li, int idx) for(int i=0; i