Branch: Tag:

2008-05-21

2008-05-21 21:15:59 by Martin Stjernholm <mast@lysator.liu.se>

Added some test cases for buffer overrun in `+.

Rev: src/testsuite.in:1.819

1:   START_MARKER - test_true([["$Id: testsuite.in,v 1.818 2008/05/21 19:32:27 mast Exp $"]]); + test_true([["$Id: testsuite.in,v 1.819 2008/05/21 21:15:59 mast Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
46:    class Foo { inherit Bar; array(int) foo = ({1}); };    return sizeof(Foo()->foo);]],1);    + test_eq([["(" + 0x7fffffff + ")"]], "(2147483647)") + test_eq([["(" + -0x80000000 + ")"]], "(-2147483648)") + cond(0x8000000000000000, [[ +  test_eq([["(" + 0x7fffffffffffffff + ")"]], "(9223372036854775807)") +  test_eq([["(" + -0x8000000000000000 + ")"]], "(-9223372036854775808)") + ]]) + test_eq([["(" + Int.NATIVE_MAX + ")"]], [[sprintf ("(%d)", Int.NATIVE_MAX)]]) + test_eq([["(" + Int.NATIVE_MIN + ")"]], [[sprintf ("(%d)", Int.NATIVE_MIN)]]) +    # __func__   test_eq(__func__, "a")   test_eq("b", __func__)