1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 #include <libecal/libecal.h>
5 #include <libical/ical.h>
7 #include "ecal-test-utils.h"
8 #include "e-test-server-utils.h"
10 static ETestServerClosure cal_closure =
11 { E_TEST_SERVER_DEPRECATED_CALENDAR, NULL, E_CAL_SOURCE_TYPE_EVENT };
13 #define TZID_NEW "XYZ"
14 #define TZNAME_NEW "Ex Wye Zee"
17 test_add_timezone (ETestServerFixture *fixture,
18 gconstpointer user_data)
21 icalproperty *property;
22 icalcomponent *component;
24 icaltimezone *zone_final;
26 cal = E_TEST_SERVER_UTILS_SERVICE (fixture, ECal);
28 /* Build up new timezone */
29 component = icalcomponent_new_vtimezone ();
30 property = icalproperty_new_tzid (TZID_NEW);
31 icalcomponent_add_property (component, property);
32 property = icalproperty_new_tzname (TZNAME_NEW);
33 icalcomponent_add_property (component, property);
34 zone = icaltimezone_new ();
35 icaltimezone_set_component (zone, component);
38 ecal_test_utils_cal_add_timezone (cal, zone);
41 zone_final = ecal_test_utils_cal_get_timezone (cal, TZID_NEW);
42 g_assert_cmpstr (icaltimezone_get_tzid (zone), ==, icaltimezone_get_tzid (zone_final));
43 g_assert_cmpstr (icaltimezone_get_tznames (zone), ==,icaltimezone_get_tznames (zone_final));
45 icaltimezone_free (zone, TRUE);
52 #if !GLIB_CHECK_VERSION (2, 35, 1)
55 g_test_init (&argc, &argv, NULL);
58 "/ECal/AddTimezone", ETestServerFixture, &cal_closure,
59 e_test_server_utils_setup, test_add_timezone, e_test_server_utils_teardown);
61 return e_test_server_utils_run ();