108
108
test_print ("calendar server is busy; waiting...");
110
110
} else if (error) {
111
g_warning ("failed to asynchronously remove the calendar: "
112
"status %d (%s)", error->code, error->message);
111
g_warning ("failed to asynchronously remove the calendar: "
112
"status %d (%s)", error->code, error->message);
116
116
closure->cal = cal;
118
test_print ("successfully asynchronously removed the temporary "
118
test_print ("successfully asynchronously removed the temporary "
121
121
(*closure->cb) (closure);
147
147
gchar *address = NULL;
149
149
if (!e_cal_get_alarm_email_address (cal, &address, &error)) {
150
g_warning ("failed to get alarm email address; %s\n", error->message);
150
g_warning ("failed to get alarm email address; %s\n", error->message);
153
test_print ("successfully got the alarm email address\n");
153
test_print ("successfully got the alarm email address\n");
162
162
gchar *address = NULL;
164
164
if (!e_cal_get_cal_address (cal, &address, &error)) {
165
g_warning ("failed to get calendar address; %s\n", error->message);
165
g_warning ("failed to get calendar address; %s\n", error->message);
168
test_print ("successfully got the calendar address\n");
168
test_print ("successfully got the calendar address\n");
177
177
gchar *attr = NULL;
179
179
if (!e_cal_get_ldap_attribute (cal, &attr, &error)) {
180
g_warning ("failed to get ldap attribute; %s\n", error->message);
180
g_warning ("failed to get ldap attribute; %s\n", error->message);
183
test_print ("successfully got the ldap attribute\n");
183
test_print ("successfully got the ldap attribute\n");
188
188
static const gchar *
189
189
b2s (gboolean value)
191
return value ? "true" : "false";
191
return value ? "true" : "false";
195
195
ecal_test_utils_cal_get_capabilities (ECal *cal)
197
test_print ("calendar capabilities:\n");
198
test_print (" One alarm only: %s\n"
199
" Organizers must attend meetings: %s\n"
200
" Organizers must accept meetings: %s\n"
201
" Master object for recurrences: %s\n"
202
" Can save schedules: %s\n"
203
" No alarm repeat: %s\n"
204
" No audio alarms: %s\n"
205
" No display alarms: %s\n"
206
" No email alarms: %s\n"
207
" No procedure alarms: %s\n"
208
" No task assignment: %s\n"
209
" No 'this and future': %s\n"
210
" No 'this and prior': %s\n"
211
" No transparency: %s\n"
212
" Organizer not email address: %s\n"
213
" Remove alarms: %s\n"
214
" Create messages: %s\n"
215
" No conv. to assigned task: %s\n"
216
" No conv. to recurring: %s\n"
217
" No general options: %s\n"
218
" Requires send options: %s\n"
219
" Delegate supported: %s\n"
220
" No organizer required: %s\n"
221
" Delegate to many: %s\n"
222
" Has unaccepted meeting: %s\n"
197
test_print ("calendar capabilities:\n");
198
test_print (" One alarm only: %s\n"
199
" Organizers must attend meetings: %s\n"
200
" Organizers must accept meetings: %s\n"
201
" Master object for recurrences: %s\n"
202
" Can save schedules: %s\n"
203
" No alarm repeat: %s\n"
204
" No audio alarms: %s\n"
205
" No display alarms: %s\n"
206
" No email alarms: %s\n"
207
" No procedure alarms: %s\n"
208
" No task assignment: %s\n"
209
" No 'this and future': %s\n"
210
" No 'this and prior': %s\n"
211
" No transparency: %s\n"
212
" Organizer not email address: %s\n"
213
" Remove alarms: %s\n"
214
" Create messages: %s\n"
215
" No conv. to assigned task: %s\n"
216
" No conv. to recurring: %s\n"
217
" No general options: %s\n"
218
" Requires send options: %s\n"
219
" Delegate supported: %s\n"
220
" No organizer required: %s\n"
221
" Delegate to many: %s\n"
222
" Has unaccepted meeting: %s\n"
224
224
b2s (e_cal_get_one_alarm_only (cal)),
225
225
b2s (e_cal_get_organizer_must_attend (cal)),
323
323
icalcomponent *component = NULL;
325
325
if (!e_cal_get_object (cal, uid, NULL, &component, &error)) {
326
g_warning ("failed to get icalcomponent object '%s'; %s\n", uid, error->message);
326
g_warning ("failed to get icalcomponent object '%s'; %s\n", uid, error->message);
329
329
if (!icalcomponent_is_valid (component)) {
330
g_warning ("retrieved icalcomponent is invalid\n");
330
g_warning ("retrieved icalcomponent is invalid\n");
333
test_print ("successfully got the icalcomponent object '%s'\n", uid);
333
test_print ("successfully got the icalcomponent object '%s'\n", uid);
335
335
return component;
343
343
GError *error = NULL;
345
345
if (!icalcomponent_is_valid (component)) {
346
g_warning (G_STRLOC ": icalcomponent argument is invalid\n");
346
g_warning (G_STRLOC ": icalcomponent argument is invalid\n");
349
349
if (!e_cal_modify_object (cal, component, mod_type, &error)) {
350
g_warning ("failed to modify icalcomponent object; %s\n", error->message);
350
g_warning ("failed to modify icalcomponent object; %s\n", error->message);
353
test_print ("successfully modified the icalcomponent object\n");
353
test_print ("successfully modified the icalcomponent object\n");
360
360
GError *error = NULL;
362
362
if (!e_cal_remove_object (cal, uid, &error)) {
363
g_warning ("failed to remove icalcomponent object '%s'; %s\n", uid, error->message);
363
g_warning ("failed to remove icalcomponent object '%s'; %s\n", uid, error->message);
366
test_print ("successfully remoed the icalcomponent object '%s'\n", uid);
366
test_print ("successfully remoed the icalcomponent object '%s'\n", uid);
373
373
icalcomponent *component = NULL;
375
375
if (!e_cal_get_default_object (cal, &component, &error)) {
376
g_warning ("failed to get default icalcomponent object; %s\n", error->message);
376
g_warning ("failed to get default icalcomponent object; %s\n", error->message);
379
379
if (!icalcomponent_is_valid (component)) {
380
g_warning ("default icalcomponent is invalid\n");
380
g_warning ("default icalcomponent is invalid\n");
383
test_print ("successfully got the default icalcomponent object\n");
383
test_print ("successfully got the default icalcomponent object\n");
385
385
return component;
393
393
GList *objects = NULL;
395
395
if (!e_cal_get_object_list (cal, query, &objects, &error)) {
396
g_warning ("failed to get list of icalcomponent objects for query '%s'; %s\n", query, error->message);
396
g_warning ("failed to get list of icalcomponent objects for query '%s'; %s\n", query, error->message);
399
test_print ("successfully got list of icalcomponent objects for the query '%s'\n", query);
399
test_print ("successfully got list of icalcomponent objects for the query '%s'\n", query);
409
409
GList *objects = NULL;
411
411
if (!e_cal_get_objects_for_uid (cal, uid, &objects, &error)) {
412
g_warning ("failed to get icalcomponent objects for UID '%s'; %s\n", uid, error->message);
412
g_warning ("failed to get icalcomponent objects for UID '%s'; %s\n", uid, error->message);
415
test_print ("successfully got objects for the icalcomponent with UID '%s'\n", uid);
415
test_print ("successfully got objects for the icalcomponent with UID '%s'\n", uid);
426
426
gchar *ical_string = NULL;
428
428
if (!icalcomponent_is_valid (component)) {
429
g_warning ("supplied icalcomponent is invalid\n");
429
g_warning ("supplied icalcomponent is invalid\n");
433
433
if (!e_cal_create_object (cal, component, &uid, &error)) {
434
g_warning ("failed to get create an icalcomponent object; %s\n", error->message);
434
g_warning ("failed to get create an icalcomponent object; %s\n", error->message);
438
438
ical_string = icalcomponent_as_ical_string (component);
439
test_print ("successfully created icalcomponent object '%s'\n%s\n", uid,
439
test_print ("successfully created icalcomponent object '%s'\n%s\n", uid,
441
441
g_free (ical_string);
454
454
test_print ("calendar server is busy; waiting...");
456
456
} else if (status != E_CALENDAR_STATUS_OK) {
457
g_warning ("failed to asynchronously remove the calendar: "
458
"status %d", status);
457
g_warning ("failed to asynchronously remove the calendar: "
458
"status %d", status);
462
462
closure->mode = mode;
464
test_print ("successfully set the calendar mode to %d\n", mode);
464
test_print ("successfully set the calendar mode to %d\n", mode);
466
466
(*closure->cb) (closure);
545
545
icaltimezone *zone = NULL;
547
547
if (!e_cal_get_timezone (cal, tzid, &zone, &error)) {
548
g_warning ("failed to get icaltimezone* for ID '%s'; %s\n", tzid, error->message);
548
g_warning ("failed to get icaltimezone* for ID '%s'; %s\n", tzid, error->message);
551
test_print ("successfully got icaltimezone* for ID '%s'\n", tzid);
551
test_print ("successfully got icaltimezone* for ID '%s'\n", tzid);
563
563
name = icaltimezone_get_display_name (zone);
565
565
if (!e_cal_add_timezone (cal, zone, &error)) {
566
g_warning ("failed to add icaltimezone '%s'; %s\n", name, error->message);
566
g_warning ("failed to add icaltimezone '%s'; %s\n", name, error->message);
569
test_print ("successfully added icaltimezone '%s'\n", name);
569
test_print ("successfully added icaltimezone '%s'\n", name);
579
579
name = icaltimezone_get_display_name (zone);
581
581
if (!e_cal_set_default_timezone (cal, zone, &error)) {
582
g_warning ("failed to set default icaltimezone '%s'; %s\n", name, error->message);
582
g_warning ("failed to set default icaltimezone '%s'; %s\n", name, error->message);
585
test_print ("successfully set default icaltimezone '%s'\n", name);
585
test_print ("successfully set default icaltimezone '%s'\n", name);