[evolution-data-server] Cleanup/Remove obsolete tests in tests/libecal
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Cleanup/Remove obsolete tests in tests/libecal
- Date: Sat, 16 Mar 2013 08:25:44 +0000 (UTC)
commit a37b8ba096085cd56680c14c400f454b474ac516
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Sat Mar 16 17:18:55 2013 +0900
Cleanup/Remove obsolete tests in tests/libecal
Removed old test scripts, obsolete tests, and some functions
from ecal-test-utils.[ch]
tests/libecal/Makefile.am | 64 +--
tests/libecal/cleanup.sh | 10 -
tests/libecal/ecal-test-utils.c | 100 +---
tests/libecal/ecal-test-utils.h | 21 -
tests/libecal/test-ecal-set-default-timezone.c | 1 -
tests/libecal/test-ecal-set-mode.c | 65 --
tests/libecal/test-ecal-stress-factory--fifo.c | 31 -
.../libecal/test-ecal-stress-factory--open-async.c | 66 --
tests/libecal/test-ecal-stress-factory--serial.c | 31 -
.../libecal/test-ecal-stress-factory--single-cal.c | 42 --
tests/libecal/test-ecal.c | 754 --------------------
tests/libecal/test-recur.c | 31 -
tests/libecal/test-runner.sh | 28 -
tests/libecal/test-search.c | 51 --
tests/libecal/testdata.ics | 63 --
15 files changed, 13 insertions(+), 1345 deletions(-)
---
diff --git a/tests/libecal/Makefile.am b/tests/libecal/Makefile.am
index 81b886a..7212c6d 100644
--- a/tests/libecal/Makefile.am
+++ b/tests/libecal/Makefile.am
@@ -34,7 +34,6 @@ TEST_ECAL_LIBS = \
# ordered by relative complexity
TESTS = \
- test-ecal-get-free-busy \
test-ecal-get-timezone \
test-ecal-add-timezone \
test-ecal-set-default-timezone \
@@ -54,17 +53,15 @@ TESTS = \
test-ecal-get-query \
$(NULL)
+# test-ecal-get-free-busy:
+# broken by design, the API needs to be fixed.
+BROKEN_TESTS = \
+ test-ecal-get-free-busy
+
# The test program
noinst_PROGRAMS = \
$(TESTS) \
- test-ecal \
- test-recur \
- test-search \
- test-ecal-set-mode \
- test-ecal-stress-factory--serial \
- test-ecal-stress-factory--fifo \
- test-ecal-stress-factory--single-cal \
- test-ecal-stress-factory--open-async \
+ $(BROKEN_TESTS) \
$(NULL)
@@ -109,54 +106,5 @@ test_ecal_send_objects_LDADD=$(TEST_ECAL_LIBS)
test_ecal_send_objects_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
test_ecal_set_default_timezone_LDADD=$(TEST_ECAL_LIBS)
test_ecal_set_default_timezone_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-test_ecal_set_mode_LDADD=$(TEST_ECAL_LIBS)
-test_ecal_set_mode_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-test_ecal_stress_factory__fifo_LDADD=$(TEST_ECAL_LIBS)
-test_ecal_stress_factory__fifo_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-test_ecal_stress_factory__open_async_LDADD=$(TEST_ECAL_LIBS)
-test_ecal_stress_factory__open_async_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-test_ecal_stress_factory__serial_LDADD=$(TEST_ECAL_LIBS)
-test_ecal_stress_factory__serial_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-test_ecal_stress_factory__single_cal_LDADD=$(TEST_ECAL_LIBS)
-test_ecal_stress_factory__single_cal_CPPFLAGS=$(TEST_ECAL_CPPFLAGS)
-
-# monolithic tests
-test_ecal_SOURCES = test-ecal.c
-test_ecal_CPPFLAGS = $(TEST_ECAL_CPPFLAGS)
-test_ecal_INCLUDES = \
- $(INCLUDES) \
- -DG_LOG_DOMAIN=\"test-ecal\"
-test_ecal_LDADD = \
- $(top_builddir)/calendar/libecal/libecal-1.2.la \
- $(top_builddir)/libedataserver/libedataserver-1.2.la \
- $(EVOLUTION_CALENDAR_LIBS)
-
-test_recur_SOURCES = test-recur.c
-test_recur_CPPFLAGS = $(TEST_ECAL_CPPFLAGS)
-test_recur_INCLUDES = \
- $(INCLUDES) \
- -DG_LOG_DOMAIN=\"test-ecal\"
-test_recur_LDADD = \
- $(top_builddir)/calendar/libecal/libecal-1.2.la \
- $(top_builddir)/libedataserver/libedataserver-1.2.la \
- $(EVOLUTION_CALENDAR_LIBS)
-
-test_search_SOURCES = test-search.c
-test_search_CPPFLAGS = $(TEST_ECAL_CPPFLAGS)
-test_search_INCLUDES = \
- $(INCLUDES) \
- -DG_LOG_DOMAIN=\"test-ecal\"
-test_search_LDADD = \
- $(top_builddir)/calendar/libecal/libecal-1.2.la \
- $(top_builddir)/libedataserver/libedataserver-1.2.la \
- $(EVOLUTION_CALENDAR_LIBS)
-
-EXTRA_DIST = \
- $(test_scripts) \
- testdata.ics
-
-test_scripts = \
- test-runner.sh \
- cleanup.sh
-include $(top_srcdir)/git.mk
diff --git a/tests/libecal/ecal-test-utils.c b/tests/libecal/ecal-test-utils.c
index 07a495e..cf61c99 100644
--- a/tests/libecal/ecal-test-utils.c
+++ b/tests/libecal/ecal-test-utils.c
@@ -25,6 +25,13 @@
#include "ecal-test-utils.h"
+typedef struct {
+ GSourceFunc cb;
+ gpointer user_data;
+ CalMode mode;
+ ECal *cal;
+} ECalTestClosure;
+
void
test_print (const gchar *format,
...)
@@ -49,99 +56,6 @@ test_print (const gchar *format,
}
}
-ECal *
-ecal_test_utils_cal_new_temp (gchar **uri,
- ECalSourceType type)
-{
- ECal *cal;
- gchar *file_template;
- gchar *uri_result;
-
- file_template = g_build_filename (
- g_get_tmp_dir (),
- "ecal-test-XXXXXX/", NULL);
- g_mkstemp (file_template);
-
- uri_result = g_strconcat ("local:", file_template, NULL);
- if (!uri_result) {
- g_error ("failed to convert %s to a 'local:' URI", file_template);
- }
- g_free (file_template);
-
- /* FIXME We don't build ECals from URIs anymore. */
- /* cal = ecal_test_utils_cal_new_from_uri (uri_result, type); */
- cal = NULL;
-
- if (uri)
- *uri = g_strdup (uri_result);
-
- g_free (uri_result);
-
- return cal;
-}
-
-void
-ecal_test_utils_cal_open (ECal *cal,
- gboolean only_if_exists)
-{
- GError *error = NULL;
-
- if (!e_cal_open (cal, only_if_exists, &error)) {
- ESource *source;
- const gchar *uid;
-
- source = e_cal_get_source (cal);
- uid = e_source_get_uid (source);
-
- g_warning (
- "failed to open calendar: `%s': %s",
- uid, error->message);
- exit (1);
- }
-}
-
-static void
-open_ex_cb (ECal *cal,
- const GError *error,
- ECalTestClosure *closure)
-{
- if (FALSE) {
- } else if (error && error->code == E_CALENDAR_STATUS_BUSY) {
- test_print ("calendar server is busy; waiting...");
- return;
- } else if (error) {
- g_warning ("failed to asynchronously remove the calendar: "
- "status %d (%s)", error->code, error->message);
- exit (1);
- }
-
- closure->cal = cal;
-
- test_print ("successfully asynchronously removed the temporary "
- "calendar\n");
- if (closure->cb)
- (*closure->cb) (closure);
-
- g_signal_handlers_disconnect_by_func (cal, open_ex_cb, closure);
- g_free (closure);
-}
-
-void
-ecal_test_utils_cal_async_open (ECal *cal,
- gboolean only_if_exists,
- GSourceFunc callback,
- gpointer user_data)
-{
- ECalTestClosure *closure;
-
- closure = g_new0 (ECalTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
-
- g_signal_connect (G_OBJECT (cal), "cal_opened_ex", G_CALLBACK (open_ex_cb), closure);
- e_cal_open_async (cal, only_if_exists);
-}
-
gchar *
ecal_test_utils_cal_get_alarm_email_address (ECal *cal)
{
diff --git a/tests/libecal/ecal-test-utils.h b/tests/libecal/ecal-test-utils.h
index a4a0cc1..dade534 100644
--- a/tests/libecal/ecal-test-utils.h
+++ b/tests/libecal/ecal-test-utils.h
@@ -24,31 +24,10 @@
#include <libecal/libecal.h>
-typedef struct {
- GSourceFunc cb;
- gpointer user_data;
- CalMode mode;
- ECal *cal;
-} ECalTestClosure;
-
void
test_print (const gchar *format,
...);
-ECal *
-ecal_test_utils_cal_new_temp (gchar **uri,
- ECalSourceType type);
-
-void
-ecal_test_utils_cal_open (ECal *cal,
- gboolean only_if_exists);
-
-void
-ecal_test_utils_cal_async_open (ECal *cal,
- gboolean only_if_exists,
- GSourceFunc callback,
- gpointer user_data);
-
gchar *
ecal_test_utils_cal_get_alarm_email_address (ECal *cal);
diff --git a/tests/libecal/test-ecal-set-default-timezone.c b/tests/libecal/test-ecal-set-default-timezone.c
index 7297e87..267f5ae 100644
--- a/tests/libecal/test-ecal-set-default-timezone.c
+++ b/tests/libecal/test-ecal-set-default-timezone.c
@@ -36,7 +36,6 @@ test_set_default_timezone (ETestServerFixture *fixture,
icaltimezone_set_component (zone, component);
/* set default; must be done before opening the calendar */
- ecal_test_utils_cal_open (cal, FALSE);
ecal_test_utils_cal_add_timezone (cal, zone);
ecal_test_utils_cal_set_default_timezone (cal, zone);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]