Branch: Tag:

2002-10-13

2002-10-13 23:11:34 by Martin Nilsson <mani@lysator.liu.se>

Don't leak constants.

Rev: src/testsuite.in:1.549

1: - test_true([["$Id: testsuite.in,v 1.548 2002/10/12 13:14:44 nilsson Exp $"]]); + test_true([["$Id: testsuite.in,v 1.549 2002/10/13 23:11:34 nilsson Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
534:   };   return res;    ]],1); + test_do(add_constant("test_a")) + test_do(add_constant("test_b")) + test_do(add_constant("test_c"))      test_any( [[   // bug [1858] ------------------------------------------------------------
887:    }    }   ]]); + test_do(add_constant("f")) + test_do(add_constant("monitor"))      test_false([[object_variablep(class X { int y; int z() { return 1; }}(),"foo")]])   test_false([[object_variablep(class X { int y; int z() { return 1; }}(),"z")]])
1596:   test_compile_any([[int log() { return 17; } class Greta { int hanna() { return log(); } }]])   test_compile_any([[int kajsa(int a,int b) { return 17; } class Jenny { int kajsa() { return 17; } class Greta { int hanna() { return kajsa(); } } }]])   test_any([[add_constant("kajsa",lambda(int a,int b) { return 17; }); return compile_string("int kajsa() { return 17; } class Greta { int hanna() { return kajsa(); } }")()->kajsa()]],17) + test_do(add_constant("kajsa"))      test_compile([[Stdio.File foo=Stdio.File();]])   test_compile([[ string|multiset(string) foo;
7870:   test_any([[mapping o=(["foo":clone(PROG)]); destruct(o["foo"]); return o["foo"]; ]],0);   dnl test_any([[object t; mapping o=([t=clone(PROG):"foo"]); destruct(t); return sizeof(o)]],0);   test_do([[object t; array(object) o=({}); o+=({t=clone(PROG)}); destruct(t); o=({});]]); + test_do(add_constant("PROG"))      // - Array.diff   test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),
8255:   test_eq(replace("test\ntest\n\ntest\ntest",({"\n","\n\n"}),({" ","<p>"})),"test test<p>test test")   test_eq(replace("test\ntest\n\ntest\ntest",({"\n\n","\n"}),({"<p>"," "})),"test test<p>test test")   test_eq(replace("\xfffffff0", ({ "\xfffffff0" }), ({ "" })), "") + test_eq([[ replace("abcdefg", ([ "a":"x", "d":"y", "h":"z" ])) ]], "xbcyefg")      test_eq("123\000456""890"-"\0", "123\456""890")   test_eq("123\456000""890"-"\0", "123\456000""890")
8507:   test_search4("-------------------+")   test_search4("\345-------------------")   test_search4(sprintf("%'argel-bargel glop-glyf?'2000n")) -  - dnl these can be uncommented when sprintf handles wide strings +    test_search4("\34567-------------------")   test_search4("\345677777-------------------")   test_search4("kapit\3333l>")
8533:   test_eq(sizeof(({"fulbar","gazonk",7})),3)   test_eq(sizeof(([8:3,6:6,7:0])),3)   test_eq(sizeof((<8,7,6,5,4,7>)),6) + test_eq([[ sizeof( class { int _sizeof() { return 17; } }() ) ]], 17)      // - sleep   test_do(sleep(1))