~dobey/indicator-sound/drop-greeeter

« back to all changes in this revision

Viewing changes to tests/greeter-list.cc

  • Committer: Rodney Dawes
  • Date: 2017-03-23 19:23:42 UTC
  • Revision ID: rodney.dawes@canonical.com-20170323192342-v3didhhuoec0nv5p
Strip out the complicated non-working greeter support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2014 Canonical Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authors:
17
 
 *      Ted Gould <ted@canonical.com>
18
 
 */
19
 
 
20
 
#include <gtest/gtest.h>
21
 
#include <gio/gio.h>
22
 
 
23
 
extern "C" {
24
 
#include "indicator-sound-service.h"
25
 
#include "vala-mocks.h"
26
 
}
27
 
 
28
 
class GreeterListTest : public ::testing::Test
29
 
{
30
 
        protected:
31
 
                GTestDBus * bus = nullptr;
32
 
 
33
 
                virtual void SetUp() {
34
 
                        bus = g_test_dbus_new(G_TEST_DBUS_NONE);
35
 
                        g_test_dbus_up(bus);
36
 
                }
37
 
 
38
 
                virtual void TearDown() {
39
 
                        g_test_dbus_down(bus);
40
 
                        g_clear_object(&bus);
41
 
                }
42
 
 
43
 
};
44
 
 
45
 
TEST_F(GreeterListTest, BasicObject) {
46
 
        MediaPlayerListGreeter * list = media_player_list_greeter_new();
47
 
 
48
 
        ASSERT_NE(nullptr, list);
49
 
 
50
 
        g_clear_object(&list);
51
 
        return;
52
 
}
53
 
 
54
 
TEST_F(GreeterListTest, BasicIterator) {
55
 
        MediaPlayerListGreeter * list = media_player_list_greeter_new();
56
 
        ASSERT_NE(nullptr, list);
57
 
 
58
 
        MediaPlayerListGreeterIterator * iter = media_player_list_greeter_iterator_new(list);
59
 
        ASSERT_NE(nullptr, iter);
60
 
 
61
 
        MediaPlayer * player = media_player_list_iterator_next_value (MEDIA_PLAYER_LIST_ITERATOR(iter));
62
 
        ASSERT_EQ(nullptr, player);
63
 
 
64
 
        g_clear_object(&iter);
65
 
        g_clear_object(&list);
66
 
        return;
67
 
}
68