diff options
author | Robert Tari <robert@tari.in> | 2024-02-12 17:33:09 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2024-02-12 17:33:09 +0100 |
commit | e06f6b10c00ead20c59b6c41c673a4456bc20370 (patch) | |
tree | cc4dafea9c1ffad385216c8dee982bb8066a027f /tests/test-sound.cpp | |
parent | a26eeb15641af0aa18e0a0535644b01e0e69bc9e (diff) | |
parent | ee1824a09d5c650800c14c6c271a74fd504245be (diff) | |
download | ayatana-indicator-datetime-e06f6b10c00ead20c59b6c41c673a4456bc20370.tar.gz ayatana-indicator-datetime-e06f6b10c00ead20c59b6c41c673a4456bc20370.tar.bz2 ayatana-indicator-datetime-e06f6b10c00ead20c59b6c41c673a4456bc20370.zip |
Merge branch 'sunweaver-pr/fix-soundtest'
Attributes GH PR #126: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/126
Diffstat (limited to 'tests/test-sound.cpp')
-rw-r--r-- | tests/test-sound.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/tests/test-sound.cpp b/tests/test-sound.cpp index eaf76ac..90c18eb 100644 --- a/tests/test-sound.cpp +++ b/tests/test-sound.cpp @@ -47,13 +47,8 @@ namespace return G_SOURCE_REMOVE; }; - class SoundNotificationFixture : public NotificationFixture, - public testing::WithParamInterface<bool> + class SoundNotificationFixture : public NotificationFixture { - public: - bool IsLomiri() { - return GetParam(); - } }; } @@ -61,7 +56,7 @@ namespace **** ***/ -TEST_P(SoundNotificationFixture, InteractiveDuration) +TEST_F(SoundNotificationFixture, InteractiveDuration) { static constexpr int duration_minutes = 120; auto settings = std::make_shared<Settings>(); @@ -76,7 +71,12 @@ TEST_P(SoundNotificationFixture, InteractiveDuration) settings->cal_notification_bubbles.set(true); settings->cal_notification_list.set(true); - mock_capabilities(IsLomiri()); +#ifdef LOMIRI_FEATURES_ENABLED + /* Here both values true|false should succeed. */ + mock_capabilities(true); +#else + mock_capabilities(false); +#endif // call the Snap Decision auto func = [this](const Appointment&, const Alarm&, const Snap::Response&){g_idle_add(quit_idle, loop);}; @@ -111,7 +111,8 @@ TEST_P(SoundNotificationFixture, InteractiveDuration) EXPECT_EQ(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(), i32); #ifdef LOMIRI_FEATURES_ENABLED - if (IsLomiri()) { + /* If setting mock_capabilities to false, set the below to false, as well. */ + if (true) { // Due to custom logic in Lomiri, also make sure custom timeout hint is set. bool b; auto hints = g_variant_get_child_value (params, 6); @@ -126,15 +127,6 @@ TEST_P(SoundNotificationFixture, InteractiveDuration) ne.reset(); } -INSTANTIATE_TEST_SUITE_P(SoundNotificationTest, - SoundNotificationFixture, - testing::Values( -#ifdef LOMIRI_FEATURES_ENABLED - true, -#endif - false - )); - /*** **** ***/ |