From cc8600927594dcdfcba74813788d90c999156468 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 3 Mar 2014 11:11:32 -0600 Subject: Test the number of entries in the menu --- tests/sound-menu-test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/sound-menu-test.cc b/tests/sound-menu-test.cc index 4d28c4a..5d18d08 100644 --- a/tests/sound-menu-test.cc +++ b/tests/sound-menu-test.cc @@ -44,6 +44,8 @@ class SoundMenuTest : public ::testing::Test TEST_F(SoundMenuTest, BasicObject) { SoundMenu * menu = sound_menu_new (nullptr, SOUND_MENU_DISPLAY_FLAGS_NONE); + ASSERT_NE(nullptr, menu); + g_clear_object(&menu); return; } @@ -67,11 +69,12 @@ TEST_F(SoundMenuTest, AddRemovePlayer) { sound_menu_add_player(menu, MEDIA_PLAYER(media)); - /* TODO: Verify */ + ASSERT_NE(nullptr, menu->menu); + EXPECT_EQ(2, g_menu_model_get_n_items(G_MENU_MODEL(menu->menu))); sound_menu_remove_player(menu, MEDIA_PLAYER(media)); - /* TODO: Verify */ + EXPECT_EQ(1, g_menu_model_get_n_items(G_MENU_MODEL(menu->menu))); g_clear_object(&media); g_clear_object(&menu); -- cgit v1.2.3