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 };
14 test_create_object (ETestServerFixture *fixture,
15 gconstpointer user_data)
18 icalcomponent *component;
19 icalcomponent *component_final;
22 cal = E_TEST_SERVER_UTILS_SERVICE (fixture, ECal);
24 component = icalcomponent_new (ICAL_VEVENT_COMPONENT);
25 uid = ecal_test_utils_cal_create_object (cal, component);
27 /* Assert that we can fetch the newly created component
30 component_final = ecal_test_utils_cal_get_object (cal, uid);
31 g_assert (component_final);
32 g_assert (icalcomponent_is_valid (component_final));
35 icalcomponent_free (component);
36 icalcomponent_free (component_final);
43 #if !GLIB_CHECK_VERSION (2, 35, 1)
46 g_test_init (&argc, &argv, NULL);
49 "/ECal/CreateObject", ETestServerFixture, &cal_closure,
50 e_test_server_utils_setup, test_create_object, e_test_server_utils_teardown);
52 return e_test_server_utils_run ();