summaryrefslogtreecommitdiff
path: root/src/test/test-calendarspec.c
diff options
context:
space:
mode:
authorDouglas Christman <DouglasChristman@gmail.com>2016-11-22 12:57:07 -0500
committerDouglas Christman <DouglasChristman@gmail.com>2016-11-23 12:28:00 -0500
commitf6e7d66b9f1db07ae80af3d75dabaf95f7f43a15 (patch)
treecd6fdc2233808565aaea9e75b5817d71c28f3a47 /src/test/test-calendarspec.c
parentfadc06bb8166b7ee494ed90b054f083ac4db4e11 (diff)
calendarspec: add upper bound on year
Stop looking for matches after MAX_YEAR so impossible dates like "*-02-30" and "*-04-31" don't cause an infinite loop.
Diffstat (limited to 'src/test/test-calendarspec.c')
-rw-r--r--src/test/test-calendarspec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index 59217b131c..18e46f2ac4 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -190,6 +190,7 @@ int main(int argc, char* argv[]) {
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683420000, 1447398685190000);
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683419999, 1447398683420000);
test_next("Sun 16:00:00", "CET", 1456041600123456, 1456066800000000);
+ test_next("*-04-31", "", 12345, -1);
assert_se(calendar_spec_from_string("test", &c) < 0);
assert_se(calendar_spec_from_string("", &c) < 0);