summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKent Sutherland <git@ksuther.com>2018-02-28 14:39:40 -0600
committerKent Sutherland <git@ksuther.com>2018-02-28 14:39:40 -0600
commit7956fb26885180eabcd48005cbc3365ad0bb5de0 (patch)
tree8821db0040fd1c6467a109144c2a4722fc2c24f5 /src/test
parente6994ba3c64fe60a55b3fe8637ed0de2e5d41784 (diff)
downloadlibical-git-7956fb26885180eabcd48005cbc3365ad0bb5de0.tar.gz
Regression to demonstrate icalrecur_iterator_next is returning icaltimetype structs of the wrong type (is_date is 0 instead of 1)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regression.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/regression.c b/src/test/regression.c
index 3b3a55db..8d069a2c 100644
--- a/src/test/regression.c
+++ b/src/test/regression.c
@@ -674,6 +674,17 @@ void test_component_foreach()
}
}
+void test_recur_iterator_set_start()
+{
+ icaltimetype start = icaltime_from_string("20150526");
+ struct icalrecurrencetype recurrence = icalrecurrencetype_from_string("FREQ=WEEKLY");
+ icalrecur_iterator *iterator = icalrecur_iterator_new(recurrence, start);
+
+ icaltimetype next = icalrecur_iterator_next(iterator);
+
+ ok("Next recurrence iterator result should be of type date", next.is_date == 1);
+}
+
void test_memory()
{
size_t bufsize = 256;
@@ -4130,6 +4141,7 @@ int main(int argc, char *argv[])
test_run("Test Properties", test_properties, do_test, do_header);
test_run("Test Components", test_components, do_test, do_header);
test_run("Test icalcomponent_foreach_recurrence", test_component_foreach, do_test, do_header);
+ test_run("Test icalrecur_iterator_set_start with date", test_recur_iterator_set_start, do_test, do_header);
test_run("Test Convenience", test_convenience, do_test, do_header);
test_run("Test classify ", test_classify, do_test, do_header);
test_run("Test Iterators", test_iterators, do_test, do_header);