From d77ad890a0bb3b8e366c6dea23ca93f71e35d5d5 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Thu, 1 Feb 2024 18:44:01 +0100 Subject: Fix tests relying on the default EDS appointment colour --- tests/test-eds-ics-tzids-utc.cpp | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'tests/test-eds-ics-tzids-utc.cpp') diff --git a/tests/test-eds-ics-tzids-utc.cpp b/tests/test-eds-ics-tzids-utc.cpp index 3a79485..d88e95d 100644 --- a/tests/test-eds-ics-tzids-utc.cpp +++ b/tests/test-eds-ics-tzids-utc.cpp @@ -1,6 +1,6 @@ /* * Copyright 2015 Canonical Ltd. - * Copyright 2021-2022 Robert Tari + * Copyright 2021-2024 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -80,19 +80,33 @@ TEST_F(VAlarmFixture, UTCAppointments) } // what we expect to get... - std::array expected_appts; - auto appt = &expected_appts[0]; - appt->uid = "20160322T132738Z"; - appt->color = "#becedd"; - appt->summary = "UTC event"; - appt->begin = DateTime{gtz,2016,3,22,15,0,0}; - appt->end = DateTime{gtz,2016,3,22,16,0,0}; + std::array expected_appts1; + auto appt1 = &expected_appts1[0]; + appt1->uid = "20160322T132738Z"; + appt1->color = "#becedd"; + appt1->summary = "UTC event"; + appt1->begin = DateTime{gtz,2016,3,22,15,0,0}; + appt1->end = DateTime{gtz,2016,3,22,16,0,0}; + + std::array expected_appts2; + auto appt2 = &expected_appts2[0]; + appt2->uid = "20160322T132738Z"; + appt2->color = "#62a0ea"; + appt2->summary = "UTC event"; + appt2->begin = DateTime{gtz,2016,3,22,15,0,0}; + appt2->end = DateTime{gtz,2016,3,22,16,0,0}; // compare it to what we actually loaded... const auto appts = planner->appointments().get(); - EXPECT_EQ(expected_appts.size(), appts.size()); - for (size_t i=0, n=std::min(appts.size(),expected_appts.size()); i