From 2ab7fd2951fdec42c3ef6350c7c862ccdf32c2a1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 6 Aug 2018 13:59:45 +0100 Subject: [PATCH] tests: Add more ISO 8601 parser tests These come from looking at the code coverage data. We should now have full branch coverage of the ISO 8601 parser. Signed-off-by: Philip Withnall --- glib/tests/timer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glib/tests/timer.c b/glib/tests/timer.c index dc08d4c7c..f40a278b4 100644 --- a/glib/tests/timer.c +++ b/glib/tests/timer.c @@ -168,6 +168,15 @@ test_timeval_from_iso8601 (void) { FALSE, "20180803T140863.446178377+0100", { 0, 0 } }, { FALSE, "20180803T140805.446178377+10000", { 0, 0 } }, { FALSE, "20180803T140805.446178377+0160", { 0, 0 } }, + { TRUE, "+1980-02-22T12:36:00+02:00", { 320063760, 0 } }, + { FALSE, "-0005-01-01T00:00:00Z", { 0, 0 } }, + { FALSE, "2018-08-06", { 0, 0 } }, + { FALSE, "2018-08-06 13:51:00Z", { 0, 0 } }, + { TRUE, "20180803T140805,446178377+0100", { 1533301685, 446178 } }, + { TRUE, "2018-08-03T14:08:05.446178377-01:00", { 1533308885, 446178 } }, + { FALSE, "2018-08-03T14:08:05.446178377 01:00", { 0, 0 } }, + { TRUE, "1990-11-01T10:21:17", { 657454877, 0 } }, + { TRUE, "1990-11-01T10:21:17 ", { 657454877, 0 } }, }; GTimeVal out; gboolean success; -- 2.11.4.GIT