File: test-ecal-send-objects.c

package info (click to toggle)
evolution-data-server 3.4.4-3%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 47,788 kB
  • sloc: ansic: 248,622; sh: 12,008; makefile: 2,874; xml: 428; perl: 204; python: 30
file content (42 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

#include <stdlib.h>
#include <libecal/e-cal.h>
#include <libical/ical.h>

#include "ecal-test-utils.h"

gint
main (gint argc,
      gchar **argv)
{
	ECal *cal;
	gchar *uri = NULL;
	GList *users = NULL;
	ECalComponent *e_component = NULL;
	icalcomponent *component = NULL;
	icalcomponent *modified_component = NULL;
	gchar *uid = NULL;

	g_type_init ();

	cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
	ecal_test_utils_cal_open (cal, FALSE);

        ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
                        "20040109T103000", "UTC", "new event", &e_component,
			&uid);

	component = e_cal_component_get_icalcomponent (e_component);
	ecal_test_utils_cal_send_objects (cal, component, &users, &modified_component);

	ecal_test_utils_cal_remove (cal);

	g_list_foreach (users, (GFunc) g_free, NULL);
	g_list_free (users);

	g_object_unref (e_component);
	g_free (uid);

	return 0;
}