test-runner.sh \
cleanup.sh
+# ordered by relative complexity
TESTS = \
test-ecal-remove \
test-ecal-open \
+ test-ecal-get-cal-address \
$(NULL)
# The test program
$(libecal_test_utils_la_CPPFLAGS) \
$(NULL)
+# ordered alphanumerically
+test_ecal_get_cal_address_LDADD=$(TEST_ECAL_LIBS)
+test_ecal_get_cal_address_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
test_ecal_open_LDADD=$(TEST_ECAL_LIBS)
test_ecal_open_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
test_ecal_remove_LDADD=$(TEST_ECAL_LIBS)
g_object_unref (cal);
}
+
+char*
+ecal_test_utils_cal_get_cal_address (ECal *cal)
+{
+ GError *error = NULL;
+ char *address = NULL;
+
+ if (!e_cal_get_cal_address (cal, &address, &error)) {
+ g_warning ("failed to get calendar address; %s\n", error->message);
+ exit(1);
+ }
+ g_print ("successfully got the calendar address\n");
+
+ return address;
+}
void
ecal_test_utils_cal_remove (ECal *cal);
+char*
+ecal_test_utils_cal_get_cal_address (ECal *cal);
+
#endif /* _ECAL_TEST_UTILS_H */
--- /dev/null
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+#include <stdlib.h>
+#include <libecal/e-cal.h>
+
+#include "ecal-test-utils.h"
+
+gint
+main (gint argc, gchar **argv)
+{
+ ECal *cal;
+ char *uri = NULL;
+ char *address;
+
+ g_type_init ();
+
+ cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
+ ecal_test_utils_cal_open (cal, FALSE);
+
+ address = ecal_test_utils_cal_get_cal_address (cal);
+ g_print ("calendar address: '%s'\n", address);
+
+ ecal_test_utils_cal_remove (cal);
+
+ g_free (address);
+
+ return 0;
+}