2
* Copyright (C) 2010 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 version 3 as
6
* published by the Free Software Foundation.
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
* Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
23
#include <glib-object.h>
28
/* Expects a clone with 3 rows in it */
30
main (gint argc, gchar *argv[])
37
dbus_g_thread_init ();
39
model = dee_shared_model_new_with_name (argv[1]);
40
dee_shared_model_connect (DEE_SHARED_MODEL (model));
42
if (gtx_wait_for_signal (G_OBJECT (model), 100000, "ready"))
43
g_error ("Helper model timed out waiting for 'ready' signal");
45
g_assert_cmpint (dee_model_get_n_rows (model), ==, 3);
47
iter = dee_model_get_iter_at_row (model, 0);
48
g_assert_cmpint (dee_model_get_int (model, iter, 0), == , 0);
49
g_assert_cmpstr (dee_model_get_string (model, iter, 1), == , "zero");
51
iter = dee_model_get_iter_at_row (model, 1);
52
g_assert_cmpint (dee_model_get_int (model, iter, 0), == , 1);
53
g_assert_cmpstr (dee_model_get_string (model, iter, 1), == , "one");
55
iter = dee_model_get_iter_at_row (model, 2);
56
g_assert_cmpint (dee_model_get_int (model, iter, 0), == , 2);
57
g_assert_cmpstr (dee_model_get_string (model, iter, 1), == , "two");
b'\\ No newline at end of file'