[svn-commits] dlee: branch dlee/ari-event-remodel2 r392438 - /team/dlee/ari-event-remodel2/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 21 13:13:13 CDT 2013


Author: dlee
Date: Fri Jun 21 13:13:12 2013
New Revision: 392438

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392438
Log:
Commenting the date test

Modified:
    team/dlee/ari-event-remodel2/tests/test_ari_model.c

Modified: team/dlee/ari-event-remodel2/tests/test_ari_model.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/tests/test_ari_model.c?view=diff&rev=392438&r1=392437&r2=392438
==============================================================================
--- team/dlee/ari-event-remodel2/tests/test_ari_model.c (original)
+++ team/dlee/ari-event-remodel2/tests/test_ari_model.c Fri Jun 21 13:13:12 2013
@@ -256,40 +256,57 @@
 	int res;
 	int i;
 	const char *valid_dates[] = {
+		/* Time is optional */
 		"2013-06-17",
+		/* Seconds are optional */
 		"2013-06-17T23:59Z",
+		/* Subseconds are optional */
 		"2013-06-17T23:59:59Z",
+		/* Leap seconds are valid */
 		"2013-06-30T23:59:61Z",
+		/* Subseconds are allowed */
 		"2013-06-17T23:59:59.999999Z",
+		/* Now with -06:00 for the timezone */
 		"2013-06-17T23:59-06:00",
 		"2013-06-17T23:59:59-06:00",
 		"2013-06-30T23:59:61-06:00",
 		"2013-06-17T23:59:59.999999-06:00",
+		/* Again, with +06:30 for the timezone */
 		"2013-06-17T23:59+06:30",
 		"2013-06-17T23:59:59+06:30",
 		"2013-06-30T23:59:61+06:30",
 		"2013-06-17T23:59:59.999999+06:30",
+		/* So the colon in the timezone is optional */
 		"2013-06-17T23:59-0600",
 		"2013-06-17T23:59:59-0600",
 		"2013-06-30T23:59:61-0600",
 		"2013-06-17T23:59:59.999999-0600",
+		/* Sure, why not */
 		"2013-06-17T23:59+0630",
 		"2013-06-17T23:59:59+0630",
 		"2013-06-30T23:59:61+0630",
 		"2013-06-17T23:59:59.999999+0630",
 		"9999-12-31T23:59:61.999999Z",
+		/* In fact, you don't even have to specify minutes */
 		"2013-06-17T23:59-06",
 		"2013-06-17T23:59:59-06",
 		"2013-06-30T23:59:61-06",
 		"2013-06-17T23:59:59.999999-06",
 	};
 
+	/* There are lots of invalid dates that the validator lets through.
+	 * Those would be strings properly formatted as a ridiculous date. Such
+	 * as 0000-00-00, or 9999-19-39. Those are harder to catch with a regex,
+	 * and actually aren't as important. So long as the valid dates pass the
+	 * validator, and poorly formatted dates are rejected, it's fine.
+	 * Catching the occasional ridiculous date is just bonus.
+	 */
 	const char *invalid_dates[] = {
 		"",
 		"Not a date",
-		"2013-06-17T", /* Missing time */
-		"2013-06-17T23:59:59.Z", /* Missing subsecond */
-		"2013-06-17T23:59", /* Missing timezone */
+		"2013-06-17T", /* Missing time, but has T */
+		"2013-06-17T23:59:59.Z", /* Missing subsecond, but has dot */
+		"2013-06-17T23:59", /* Missing timezone, but has time */
 		"2013-06-17T23:59:59.999999", /* Missing timezone */
 		"9999-99-31T23:59:61.999999Z", /* Invalid month */
 		"9999-12-99T23:59:61.999999Z", /* Invalid day */
@@ -298,6 +315,7 @@
 		"9999-12-31T23:59:99.999999Z", /* Invalid second */
 		"2013-06-17T23:59:59.999999-99:00", /* Invalid timezone */
 		"2013-06-17T23:59:59.999999-06:99", /* Invalid timezone */
+		"2013-06-17T23:59:59.999999-06:", /* Invalid timezone */
 		"2013-06-17T23:59:59.999999-06:0", /* Invalid timezone */
 		"2013-06-17T23:59:59.999999-060", /* Invalid timezone */
 	};




More information about the svn-commits mailing list