Branch: Tag:

2007-03-29

2007-03-29 15:36:54 by Martin Stjernholm <mast@lysator.liu.se>

Fixed my_time_inverse (used by mktime e.g. when the timezone argument is
used) to work better for time fields outside the valid bounds. Also improved
overflow checks in it. Fixes [bug 4326 (#4326)].

Rev: src/builtin_functions.c:1.630
Rev: src/testsuite.in:1.773

1:   START_MARKER - test_true([["$Id: testsuite.in,v 1.772 2007/03/20 16:55:07 grubba Exp $"]]); + test_true([["$Id: testsuite.in,v 1.773 2007/03/29 15:36:54 mast Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
779:    return lambda(object (([mixed]a)->syntax_error) { return 0; }(0);   ]])    - test_any( [[ - // bug [2861] ------------------------------------------------------------ - // http://community/crunch/show_bug.cgi?id=2861 - return mktime(0,0,0,1,0,70,0,0); - ]], 0) -  - test_any( [[ - // bug [3270] ------------------------------------------------------------ - // http://community/crunch/show_bug.cgi?id=3270 - // Tue, 15 Oct 2002 09:38:32 GMT - return mktime(32, 38, 9, 15, 9, 102, 0, 0); - ]], 1034674712) -  +    cond( [[ master()->resolv("Pike")->Security ]],[[    test_any( [[    // bug [2830] ------------------------------------------------------------
9790:    }    return 0;]], 0)    +  test_eq(mktime (0, 0, 0, -200, -6, 101, 0, 0), 945043200); +  test_eq(mktime (0, 0, 0, -1, 2, 107, 0, 0), 1172534400); +  test_eq(mktime (0, 0, 0, 200, 1, 107, 0, 0), 1187481600); +  test_eq(mktime (200, 200, 200, 200, 1, 107, 0, 0), 1188213800); +  test_eq(mktime (-200, -200, -200, 200, 1, 107, 0, 0), 1186749400); +  +  test_any( [[ +  // bug [2861] ------------------------------------------------------------ +  // http://community/crunch/show_bug.cgi?id=2861 +  return mktime(0,0,0,1,0,70,0,0); +  ]], 0) +  +  test_any( [[ +  // bug [3270] ------------------------------------------------------------ +  // http://community/crunch/show_bug.cgi?id=3270 +  // Tue, 15 Oct 2002 09:38:32 GMT +  return mktime(32, 38, 9, 15, 9, 102, 0, 0); +  ]], 1034674712)   ]])      // - multisetp