]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
try to fix a test failure for sizeof(time_t)==4.
authorNick Mathewson <nickm@torproject.org>
Thu, 24 Mar 2016 16:26:46 +0000 (12:26 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 24 Mar 2016 16:26:46 +0000 (12:26 -0400)
src/test/test_util.c

index 62c676540ffd4d1814334ff5869272d0e44332a8..bcbffe1b49bc3c88cbe5f7aac5a988c15daae367 100644 (file)
@@ -581,10 +581,10 @@ test_util_time(void *arg)
    * time_t */
   format_rfc1123_time(timestr, (time_t)2150000000UL);
 #if SIZEOF_TIME_T == 4
-  /* format_rfc1123_time should indicate failure on overflow, but it doesn't
-   * yet. Hopefully #18480 will improve the failure semantics in this case.
-  tt_str_op("Wed, 17 Feb 2038 06:13:20 GMT",OP_EQ, timestr);
-   */
+  /* Wrapping around will have made it this. */
+  tt_str_op("Sat, 11 Jan 1902 23:45:04 GMT",OP_EQ, timestr);
+  /* Make sure that the right date doesn't parse. */
+  strlcpy(timestr, "Wed, 17 Feb 2038 06:13:20 GMT", sizeof(timestr));
 
   t_res = 0;
   i = parse_rfc1123_time(timestr, &t_res);