File: test-date.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 (33 lines) | stat: -rw-r--r-- 598 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
#include <stdlib.h>
#include <libebook/e-contact.h>

gint
main (gint argc,
      gchar **argv)
{
	EContact *contact;
	EContactDate date, *dp;

	g_type_init ();

	contact = e_contact_new ();

	date.year = 1999;
	date.month = 3;
	date.day = 3;

	e_contact_set (contact, E_CONTACT_BIRTH_DATE, &date);

	printf ("vcard = \n%s\n", e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30));

	dp = e_contact_get (contact, E_CONTACT_BIRTH_DATE);

	if (dp->year != date.year
	    || dp->month != date.month
	    || dp->day != date.day)
	  printf ("failed\n");
	else
	  printf ("passed\n");

	return 0;
}