2
* Copyright © 2014 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Ted Gould <ted@canonical.com>
20
#include <gtest/gtest.h>
24
#include "indicator-sound-service.h"
25
#include "vala-mocks.h"
28
class GreeterListTest : public ::testing::Test
31
GTestDBus * bus = nullptr;
33
virtual void SetUp() {
34
bus = g_test_dbus_new(G_TEST_DBUS_NONE);
38
virtual void TearDown() {
39
g_test_dbus_down(bus);
45
TEST_F(GreeterListTest, BasicObject) {
46
MediaPlayerListGreeter * list = media_player_list_greeter_new();
48
ASSERT_NE(nullptr, list);
50
g_clear_object(&list);
54
TEST_F(GreeterListTest, BasicIterator) {
55
MediaPlayerListGreeter * list = media_player_list_greeter_new();
56
ASSERT_NE(nullptr, list);
58
MediaPlayerListGreeterIterator * iter = media_player_list_greeter_iterator_new(list);
59
ASSERT_NE(nullptr, iter);
61
MediaPlayer * player = media_player_list_iterator_next_value (MEDIA_PLAYER_LIST_ITERATOR(iter));
62
ASSERT_EQ(nullptr, player);
64
g_clear_object(&iter);
65
g_clear_object(&list);