diff options
Diffstat (limited to 'tests/test-eds-ics-tzids.cpp')
-rw-r--r-- | tests/test-eds-ics-tzids.cpp | 37 |
1 files changed, 26 insertions, 11 deletions
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<Appointment,1> 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<Appointment,1> 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<Appointment,1> 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<n; i++) - EXPECT_EQ(expected_appts[i], appts[i]); + EXPECT_EQ(expected_appts1.size(), appts.size()); + EXPECT_EQ(expected_appts2.size(), appts.size()); + + for (size_t i=0, n=std::min(appts.size(),expected_appts1.size()); i<n; i++) + { + EXPECT_PRED3([](auto pAppointmentIn, auto pAppointmentExpected1, auto pAppointmentExpected2) + { + return pAppointmentIn == pAppointmentExpected1 || pAppointmentIn == pAppointmentExpected2; + }, appts[i], expected_appts1[i], expected_appts2[i]); + } // cleanup g_time_zone_unref(gtz); |