[evolution-data-server/treitter-test-suites] Add test for EDataCal method 'getSchedulingInformation'.



commit 3550bed5a4b1b5b48bd0177682fb40d660c028a8
Author: Travis Reitter <treitter gmail com>
Date:   Thu Dec 17 10:51:18 2009 -0800

    Add test for EDataCal method 'getSchedulingInformation'.

 calendar/tests/ecal/Makefile.am                  |    3 +
 calendar/tests/ecal/ecal-test-utils.c            |   84 ++++++++++++++++++++++
 calendar/tests/ecal/ecal-test-utils.h            |    3 +
 calendar/tests/ecal/test-ecal-get-capabilities.c |   22 ++++++
 4 files changed, 112 insertions(+), 0 deletions(-)
---
diff --git a/calendar/tests/ecal/Makefile.am b/calendar/tests/ecal/Makefile.am
index 6c5910e..876b354 100644
--- a/calendar/tests/ecal/Makefile.am
+++ b/calendar/tests/ecal/Makefile.am
@@ -37,6 +37,7 @@ TESTS = \
         test-ecal-get-alarm-email-address	\
         test-ecal-get-cal-address		\
         test-ecal-get-ldap-attribute		\
+        test-ecal-get-capabilities		\
         $(NULL)
 
 # The test program
@@ -53,6 +54,8 @@ test_ecal_get_cal_address_LDADD=$(TEST_ECAL_LIBS)
 test_ecal_get_cal_address_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
 test_ecal_get_ldap_attribute_LDADD=$(TEST_ECAL_LIBS)
 test_ecal_get_ldap_attribute_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
+test_ecal_get_capabilities_LDADD=$(TEST_ECAL_LIBS)
+test_ecal_get_capabilities_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)
diff --git a/calendar/tests/ecal/ecal-test-utils.c b/calendar/tests/ecal/ecal-test-utils.c
index 1eea7d8..052243e 100644
--- a/calendar/tests/ecal/ecal-test-utils.c
+++ b/calendar/tests/ecal/ecal-test-utils.c
@@ -178,3 +178,87 @@ ecal_test_utils_cal_get_ldap_attribute (ECal *cal)
 
 	return attr;
 }
+
+static const char*
+b2s (gboolean value)
+{
+        return value ? "true" : "false";
+}
+
+void
+ecal_test_utils_cal_get_capabilities (ECal *cal)
+{
+        g_print ("calendar capabilities:\n");
+        g_print ("        One alarm only:                  %s\n"
+                 "        Organizers must attend meetings: %s\n"
+                 "        Organizers must accept meetings: %s\n"
+                 "        Master object for recurrences:   %s\n"
+                 "        Can save schedules:              %s\n"
+                 "        No alarm repeat:                 %s\n"
+                 "        No audio alarms:                 %s\n"
+                 "        No display alarms:               %s\n"
+                 "        No email alarms:                 %s\n"
+                 "        No procedure alarms:             %s\n"
+                 "        No task assignment:              %s\n"
+                 "        No 'this and future':            %s\n"
+                 "        No 'this and prior':             %s\n"
+                 "        No transparency:                 %s\n"
+                 "        Organizer not email address:     %s\n"
+                 "        Remove alarms:                   %s\n"
+                 "        Create messages:                 %s\n"
+                 "        No conv. to assigned task:       %s\n"
+                 "        No conv. to recurring:           %s\n"
+                 "        No general options:              %s\n"
+                 "        Requires send options:           %s\n"
+                 "        Delegate supported:              %s\n"
+                 "        No organizer required:           %s\n"
+                 "        Delegate to many:                %s\n"
+                 "        Has unaccepted meeting:          %s\n"
+                 ,
+		 b2s (e_cal_get_one_alarm_only (cal)),
+		 b2s (e_cal_get_organizer_must_attend (cal)),
+		 b2s (e_cal_get_organizer_must_accept (cal)),
+		 b2s (e_cal_get_recurrences_no_master (cal)),
+		 b2s (e_cal_get_save_schedules (cal)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_THISANDFUTURE)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_THISANDPRIOR)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_TRANSPARENCY)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_REMOVE_ALARMS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_CREATE_MESSAGES)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_NO_ORGANIZER)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)),
+		 b2s (e_cal_get_static_capability (cal,
+				 CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING))
+		 );
+}
diff --git a/calendar/tests/ecal/ecal-test-utils.h b/calendar/tests/ecal/ecal-test-utils.h
index ebcb767..0fb522b 100644
--- a/calendar/tests/ecal/ecal-test-utils.h
+++ b/calendar/tests/ecal/ecal-test-utils.h
@@ -56,4 +56,7 @@ ecal_test_utils_cal_get_cal_address (ECal *cal);
 char*
 ecal_test_utils_cal_get_ldap_attribute (ECal *cal);
 
+void
+ecal_test_utils_cal_get_capabilities (ECal *cal);
+
 #endif /* _ECAL_TEST_UTILS_H */
diff --git a/calendar/tests/ecal/test-ecal-get-capabilities.c b/calendar/tests/ecal/test-ecal-get-capabilities.c
new file mode 100644
index 0000000..fa68a9f
--- /dev/null
+++ b/calendar/tests/ecal/test-ecal-get-capabilities.c
@@ -0,0 +1,22 @@
+/* -*- 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;
+
+	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_cal_get_capabilities (cal);
+	ecal_test_utils_cal_remove (cal);
+
+	return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]