diff options
-rw-r--r-- | tests/tst_utils.cpp | 8 | ||||
-rw-r--r-- | tests/tst_utils.vala | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/tst_utils.cpp b/tests/tst_utils.cpp index 9216b1f..c6b82fb 100644 --- a/tests/tst_utils.cpp +++ b/tests/tst_utils.cpp @@ -29,6 +29,7 @@ public: void SetUp() { unsetenv("XDG_CURRENT_DESKTOP"); + unsetenv("DESKTOP_SESSION"); } void TearDown() { @@ -38,6 +39,7 @@ public: TEST_F(XdgCurrentDesktopUtilsTest, isLomiri) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_lomiri()); setenv("XDG_CURRENT_DESKTOP", "Lomiri", 1); EXPECT_TRUE(ayatana_common_utils_is_lomiri()); @@ -45,36 +47,42 @@ TEST_F(XdgCurrentDesktopUtilsTest, isLomiri) TEST_F(XdgCurrentDesktopUtilsTest, isGnome) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_gnome()); setenv("XDG_CURRENT_DESKTOP", "GNOME", 1); EXPECT_TRUE(ayatana_common_utils_is_gnome()); } TEST_F(XdgCurrentDesktopUtilsTest, isUnity) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_unity()); setenv("XDG_CURRENT_DESKTOP", "Unity", 1); EXPECT_TRUE(ayatana_common_utils_is_unity()); } TEST_F(XdgCurrentDesktopUtilsTest, isMate) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_mate()); setenv("XDG_CURRENT_DESKTOP", "MATE", 1); EXPECT_TRUE(ayatana_common_utils_is_mate()); } TEST_F(XdgCurrentDesktopUtilsTest, isXfce) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_xfce()); setenv("XDG_CURRENT_DESKTOP", "XFCE", 1); EXPECT_TRUE(ayatana_common_utils_is_xfce()); } TEST_F(XdgCurrentDesktopUtilsTest, isPantheon) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_pantheon()); setenv("XDG_CURRENT_DESKTOP", "PANTHEON", 1); EXPECT_TRUE(ayatana_common_utils_is_pantheon()); } TEST_F(XdgCurrentDesktopUtilsTest, isBudgie) { + unsetenv("XDG_CURRENT_DESKTOP"); EXPECT_FALSE(ayatana_common_utils_is_budgie()); setenv("XDG_CURRENT_DESKTOP", "Budgie:GNOME", 1); EXPECT_TRUE(ayatana_common_utils_is_budgie()); diff --git a/tests/tst_utils.vala b/tests/tst_utils.vala index 78b2c2e..a7a624b 100644 --- a/tests/tst_utils.vala +++ b/tests/tst_utils.vala @@ -5,33 +5,39 @@ using GLib; static int main(string[] args) { assert(args.length == 2); + unset_variable("DESKTOP_SESSION"); unset_variable("XDG_CURRENT_DESKTOP"); - assert(! utils_is_lomiri()); set_variable("XDG_CURRENT_DESKTOP", "Lomiri", true); assert(utils_is_lomiri()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_gnome()); set_variable("XDG_CURRENT_DESKTOP", "GNOME", true); assert(utils_is_gnome()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_unity()); set_variable("XDG_CURRENT_DESKTOP", "Unity", true); assert(utils_is_unity()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_mate()); set_variable("XDG_CURRENT_DESKTOP", "MATE", true); assert(utils_is_mate()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_xfce()); set_variable("XDG_CURRENT_DESKTOP", "XFCE", true); assert(utils_is_xfce()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_pantheon()); set_variable("XDG_CURRENT_DESKTOP", "PANTHEON", true); assert(utils_is_pantheon()); + unset_variable("XDG_CURRENT_DESKTOP"); assert(! utils_is_budgie()); set_variable("XDG_CURRENT_DESKTOP", "Budgie:GNOME", true); assert(utils_is_budgie()); |