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.cpp | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'tests/test-eds-ics-tzids.cpp') diff --git a/tests/test-eds-ics-tzids.cpp b/tests/test-eds-ics-tzids.cpp index c6b4dc4..4999e66 100644 --- a/tests/test-eds-ics-tzids.cpp +++ b/tests/test-eds-ics-tzids.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 @@ -79,19 +79,34 @@ TEST_F(VAlarmFixture, MultipleAppointments) } // what we expect to get... - std::array expected_appts; - auto appt = &expected_appts[0]; - appt->uid = "8ggc30kh89qql8vjumgtug7l14@google.com"; - appt->color = "#becedd"; - appt->summary = "Hello"; - appt->begin = DateTime{gtz,2015,7,1,20,0,0}; - appt->end = DateTime{gtz,2015,7,1,22,0,0}; + std::array expected_appts1; + auto appt1 = &expected_appts1[0]; + appt1->uid = "8ggc30kh89qql8vjumgtug7l14@google.com"; + appt1->color = "#becedd"; + appt1->summary = "Hello"; + appt1->begin = DateTime{gtz,2015,7,1,20,0,0}; + appt1->end = DateTime{gtz,2015,7,1,22,0,0}; + + std::array expected_appts2; + auto appt2 = &expected_appts2[0]; + appt2->uid = "8ggc30kh89qql8vjumgtug7l14@google.com"; + appt2->color = "#62a0ea"; + appt2->summary = "Hello"; + appt2->begin = DateTime{gtz,2015,7,1,20,0,0}; + appt2->end = DateTime{gtz,2015,7,1,22,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