From dcfaedfd22d7c74ad75f71bd18c33da7e8e58c6f Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 31 Dec 2023 01:36:03 +0100 Subject: tests/test-menus: Fix build --- tests/test-menus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index e71c997..593e5b2 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -338,11 +338,11 @@ private: void InspectPhoneAppointments(GMenuModel* menu_model, bool can_open_planner) { auto submenu = g_menu_model_get_item_link(menu_model, 0, G_MENU_LINK_SUBMENU); - + // there shouldn't be any menuitems when "show events" is false m_state->settings->show_events.set(false); wait_msec(); - section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); + auto section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); EXPECT_EQ(0, g_menu_model_get_n_items(section)); g_clear_object(§ion); @@ -353,7 +353,7 @@ private: wait_msec(); // wait a moment for the menu to update // check that there's a "clock app" menuitem even when there are no appointments - auto section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); + section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); const char* expected_action = "phone.open-alarm-app"; EXPECT_EQ(1, g_menu_model_get_n_items(section)); gchar* action = nullptr; -- cgit v1.2.3 From 548021462b00165c317b168badb3d828c6834d12 Mon Sep 17 00:00:00 2001 From: Luigi311 Date: Fri, 19 Jan 2024 07:00:42 +0000 Subject: Tests: Fix show_alarms tests --- tests/test-menus.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index 593e5b2..ea8cb30 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -274,16 +274,25 @@ private: // there shouldn't be any alarms when "show alarms" is false bool has_alarms = false; - m_state->settings->show_alarms.set(false); + wait_msec(); - for (int i=0, n=appointments.size(); i display_appointments = Menu::get_display_appointments(appointments, m_state->clock->localtime(), 5, m_state->settings->show_alarms.get()); + for (int i=0, n=display_appointments.size(); isettings->show_alarms.set(true); + wait_msec(); + + display_appointments = Menu::get_display_appointments(appointments, m_state->clock->localtime(), 5, m_state->settings->show_alarms.get()); + for (int i=0, n=display_appointments.size(); isettings->show_alarms.set(true); const int n_add_event_buttons = can_open_planner ? 1 : 0; // get the Appointments section @@ -337,8 +347,9 @@ private: void InspectPhoneAppointments(GMenuModel* menu_model, bool can_open_planner) { + m_state->settings->show_alarms.set(true); auto submenu = g_menu_model_get_item_link(menu_model, 0, G_MENU_LINK_SUBMENU); - + // there shouldn't be any menuitems when "show events" is false m_state->settings->show_events.set(false); wait_msec(); -- cgit v1.2.3