1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* test-fixture.c - Test to ensure the server test fixture works.
5 * Copyright (C) 2012 Intel Corporation
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, see <http://www.gnu.org/licenses/>.
19 * Authors: Tristan Van Berkom <tristanvb@openismus.com>
22 #include "e-test-server-utils.h"
26 static ETestServerClosure registry_closure = { E_TEST_SERVER_NONE, NULL, 0 };
27 static ETestServerClosure book_closure = { E_TEST_SERVER_ADDRESS_BOOK, NULL, 0 };
28 static ETestServerClosure calendar_closure = { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
29 static ETestServerClosure deprecated_book_closure = { E_TEST_SERVER_DEPRECATED_ADDRESS_BOOK, NULL, 0 };
30 static ETestServerClosure deprecated_calendar_closure = { E_TEST_SERVER_DEPRECATED_CALENDAR, NULL, E_CAL_SOURCE_TYPE_EVENT };
33 empty_test (ETestServerFixture *fixture,
34 gconstpointer user_data)
36 /* Basic Empty case just to run the fixture */
43 gchar **registry_keys;
45 gchar **calendar_keys;
46 gchar **deprecated_book_keys;
47 gchar **deprecated_calendar_keys;
51 g_test_init (&argc, &argv, NULL);
52 g_test_bug_base ("http://bugzilla.gnome.org/");
54 registry_keys = g_new0 (gchar *, N_CYCLES);
55 book_keys = g_new0 (gchar *, N_CYCLES);
56 calendar_keys = g_new0 (gchar *, N_CYCLES);
57 deprecated_book_keys = g_new0 (gchar *, N_CYCLES);
58 deprecated_calendar_keys = g_new0 (gchar *, N_CYCLES);
60 for (i = 0; i < N_CYCLES; i++) {
61 registry_keys[i] = g_strdup_printf ("/Fixture/Registry%d", i);
66 e_test_server_utils_setup,
68 e_test_server_utils_teardown);
71 for (i = 0; i < N_CYCLES; i++) {
72 book_keys[i] = g_strdup_printf ("/Fixture/Book%d", i);
77 e_test_server_utils_setup,
79 e_test_server_utils_teardown);
82 for (i = 0; i < N_CYCLES; i++) {
83 calendar_keys[i] = g_strdup_printf ("/Fixture/Calendar%d", i);
88 e_test_server_utils_setup,
90 e_test_server_utils_teardown);
93 for (i = 0; i < N_CYCLES; i++) {
94 deprecated_book_keys[i] = g_strdup_printf ("/Fixture/Deprecated/Book%d", i);
96 deprecated_book_keys[i],
98 &deprecated_book_closure,
99 e_test_server_utils_setup,
101 e_test_server_utils_teardown);
104 for (i = 0; i < N_CYCLES; i++) {
105 deprecated_calendar_keys[i] = g_strdup_printf ("/Fixture/Deprecated/Calendar%d", i);
107 deprecated_calendar_keys[i],
109 &deprecated_calendar_closure,
110 e_test_server_utils_setup,
112 e_test_server_utils_teardown);
115 ret = e_test_server_utils_run ();
117 for (i = 0; i < N_CYCLES; i++) {
118 g_free (registry_keys[i]);
119 g_free (book_keys[i]);
120 g_free (calendar_keys[i]);
121 g_free (deprecated_book_keys[i]);
122 g_free (deprecated_calendar_keys[i]);
125 g_free (registry_keys);
127 g_free (calendar_keys);
128 g_free (deprecated_book_keys);
129 g_free (deprecated_calendar_keys);