diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libedata-cal/components/event-0.ics | 12 | ||||
-rw-r--r-- | tests/libedata-cal/test-cal-cache-search.c | 10 | ||||
-rw-r--r-- | tests/libedata-cal/test-cal-cache-utils.c | 5 | ||||
-rw-r--r-- | tests/libedata-cal/test-cal-cache-utils.h | 1 |
4 files changed, 26 insertions, 2 deletions
diff --git a/tests/libedata-cal/components/event-0.ics b/tests/libedata-cal/components/event-0.ics new file mode 100644 index 000000000..0934961e3 --- /dev/null +++ b/tests/libedata-cal/components/event-0.ics @@ -0,0 +1,12 @@ +BEGIN:VEVENT +UID:event-0 +DTSTAMP:20170130T000000Z +CREATED:20170216T155507Z +LAST-MODIFIED:20170216T155543Z +SEQUENCE:1 +DTSTART:20170209T013000Z +SUMMARY:Zero length +DESCRIPTION:No DTEND/DUE properties +CLASS:PUBLIC +TRANSP:OPACHE +END:VEVENT diff --git a/tests/libedata-cal/test-cal-cache-search.c b/tests/libedata-cal/test-cal-cache-search.c index a008915bc..8c046bc45 100644 --- a/tests/libedata-cal/test-cal-cache-search.c +++ b/tests/libedata-cal/test-cal-cache-search.c @@ -275,6 +275,13 @@ test_search_occur_in_time_range (TCUFixture *fixture, test_search (fixture, "(occur-in-time-range? (make-time \"20170221T180000Z\") (make-time \"20170221T190000Z\") \"America/New_York\")", "event-6"); test_search (fixture, "(occur-in-time-range? (make-time \"20170221T200000Z\") (make-time \"20170221T210000Z\") \"Europe/Berlin\")", "!event-6"); test_search (fixture, "(occur-in-time-range? (make-time \"20170221T180000Z\") (make-time \"20170221T190000Z\") \"Europe/Berlin\")", "event-6"); + + /* event-0 */ + test_search (fixture, "(occur-in-time-range? (make-time \"20170209T000000Z\") (make-time \"20170209T012900Z\"))", "!event-0"); + test_search (fixture, "(occur-in-time-range? (make-time \"20170209T000000Z\") (make-time \"20170209T013000Z\"))", "!event-0"); + test_search (fixture, "(occur-in-time-range? (make-time \"20170209T010000Z\") (make-time \"20170209T020000Z\"))", "event-0"); + test_search (fixture, "(occur-in-time-range? (make-time \"20170209T013000Z\") (make-time \"20170209T020000Z\"))", "event-0"); + test_search (fixture, "(occur-in-time-range? (make-time \"20170209T013100Z\") (make-time \"20170209T020000Z\"))", "!event-0"); } static void @@ -474,6 +481,7 @@ main (gint argc, gchar **argv) { TCUClosure closure_events = { TCU_LOAD_COMPONENT_SET_EVENTS }; + TCUClosure closure_events0 = { TCU_LOAD_COMPONENT_SET_EVENTS_WITH_0 }; TCUClosure closure_tasks = { TCU_LOAD_COMPONENT_SET_TASKS }; #if !GLIB_CHECK_VERSION (2, 35, 1) @@ -490,7 +498,7 @@ main (gint argc, g_test_add ("/ECalCache/Search/Uid", TCUFixture, &closure_events, tcu_fixture_setup, test_search_uid, tcu_fixture_teardown); - g_test_add ("/ECalCache/Search/OccurInTimeRange", TCUFixture, &closure_events, + g_test_add ("/ECalCache/Search/OccurInTimeRange", TCUFixture, &closure_events0, tcu_fixture_setup, test_search_occur_in_time_range, tcu_fixture_teardown); g_test_add ("/ECalCache/Search/DueInTimeRange", TCUFixture, &closure_tasks, tcu_fixture_setup, test_search_due_in_time_range, tcu_fixture_teardown); diff --git a/tests/libedata-cal/test-cal-cache-utils.c b/tests/libedata-cal/test-cal-cache-utils.c index 767e8894c..33fd12949 100644 --- a/tests/libedata-cal/test-cal-cache-utils.c +++ b/tests/libedata-cal/test-cal-cache-utils.c @@ -93,7 +93,7 @@ tcu_fixture_setup (TCUFixture *fixture, g_free (filename); if (closure) { - if (closure->load_set == TCU_LOAD_COMPONENT_SET_EVENTS) { + if (closure->load_set == TCU_LOAD_COMPONENT_SET_EVENTS || closure->load_set == TCU_LOAD_COMPONENT_SET_EVENTS_WITH_0) { tcu_add_component_from_test_case (fixture, "event-1", NULL); tcu_add_component_from_test_case (fixture, "event-2", NULL); tcu_add_component_from_test_case (fixture, "event-3", NULL); @@ -104,6 +104,9 @@ tcu_fixture_setup (TCUFixture *fixture, tcu_add_component_from_test_case (fixture, "event-7", NULL); tcu_add_component_from_test_case (fixture, "event-8", NULL); tcu_add_component_from_test_case (fixture, "event-9", NULL); + + if (closure->load_set == TCU_LOAD_COMPONENT_SET_EVENTS_WITH_0) + tcu_add_component_from_test_case (fixture, "event-0", NULL); } else if (closure->load_set == TCU_LOAD_COMPONENT_SET_TASKS) { tcu_add_component_from_test_case (fixture, "task-1", NULL); tcu_add_component_from_test_case (fixture, "task-2", NULL); diff --git a/tests/libedata-cal/test-cal-cache-utils.h b/tests/libedata-cal/test-cal-cache-utils.h index 7d62148e2..42dfa1866 100644 --- a/tests/libedata-cal/test-cal-cache-utils.h +++ b/tests/libedata-cal/test-cal-cache-utils.h @@ -28,6 +28,7 @@ void tcu_read_args (gint argc, typedef enum { TCU_LOAD_COMPONENT_SET_NONE, TCU_LOAD_COMPONENT_SET_EVENTS, + TCU_LOAD_COMPONENT_SET_EVENTS_WITH_0, TCU_LOAD_COMPONENT_SET_TASKS } TCULoadComponentSet; |