1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 #include <libecal/e-cal.h>
5 #include <libical/ical.h>
7 #include "ecal-test-utils.h"
15 icalcomponent *component;
16 icalcomponent *component_final;
17 ECalComponent *e_component_final;
23 cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
24 ecal_test_utils_cal_open (cal, FALSE);
26 component = icalcomponent_new (ICAL_VEVENT_COMPONENT);
27 uid = ecal_test_utils_cal_create_object (cal, component);
29 component_final = ecal_test_utils_cal_get_object (cal, uid);
30 ecal_test_utils_cal_assert_objects_equal_shallow (component, component_final);
31 icalcomponent_free (component_final);
33 /* The list of component and all subcomponents should just contain the
34 * component itself (wrapped in an ECalComponent) */
35 components = ecal_test_utils_cal_get_objects_for_uid (cal, uid);
36 g_assert (g_list_length (components) == 1);
37 e_component_final = components->data;
38 component_final = e_cal_component_get_icalcomponent (e_component_final);
39 ecal_test_utils_cal_assert_objects_equal_shallow (component, component_final);
41 g_list_foreach (components, (GFunc) g_object_unref, NULL);
42 g_list_free (components);
44 icalcomponent_free (component);