pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2000-09-15
2000-09-15 00:31:43 by Martin Stjernholm <mast@lysator.liu.se>
a44f1aaf7b2bae1e98a2ded761ab535c941061bf (
50
lines) (+
49
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Some more gc checks. Test that copy_value copies the weak flags too.
Rev: src/testsuite.in:1.329
1:
-
test_true([["$Id: testsuite.in,v 1.
328
2000/09/
10
09
:
17
:
05
mirar
Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
329
2000/09/
15
00
:
31
:
43
mast
Exp $"]]);
cond([[all_constants()->_verify_internals]], [[
2003:
gc(); return a; }]], ({4711, 0x54325827a124*0x12348795482485425}))
+
test_any_equal([[{
+
object o = class Live {
+
object o;
+
array a = ({17});
+
void create() {o = this_object();}
+
void destroy() {all_constants()->kablutt = a;}
+
}();
+
o = 0;
+
gc();
+
return all_constants()->kablutt;
+
}]], ({17}));
test_any([[{
-
+
object o = class Live {
+
object o;
+
array a = set_weak_flag (({({17})}), 1);
+
void create() {o = this_object();}
+
void destroy() {
+
if (!equal (a, ({({17})})))
+
error ("Contents in weak array zapped: %O.\n", a);
+
}
+
}();
+
o = 0;
+
return gc() >= 3;
+
}]], 1);
+
test_any_equal([[{
+
object o = class Live {
+
object o;
+
array a = set_weak_flag (({({17})}), 1);
+
void create() {o = this_object();}
+
void destroy() {all_constants()->blatinka = a;}
+
}();
+
o = 0;
+
gc();
+
if (!equal (all_constants()->blatinka, ({({17})})))
+
error ("Contents in saved weak array zapped: %O.\n",
+
all_constants()->blatinka);
+
gc();
+
return all_constants()->blatinka;
+
}]], ({0}));
+
+
test_any([[{
class Dead {object o;}; object o = Dead(); o->o = Dead(); array a = set_weak_flag(({o}), 1);
2169:
gc(); return sizeof (a) == 1 && sizeof (b) == 1; }]], 1);
+
test_any([[{
+
mapping a = set_weak_flag (([17: set_weak_flag (({({17})}), 1)]), 1);
+
return gc() >= 2 && !sizeof (a);
+
}]], 1);
test_do([[{ int got_error = 0;
4672:
do_test_copy_value( ([]) ) do_test_copy_value( (<>) ) do_test_copy_value( (< ([]), ({1}) ,"" , 1.0 >) )
+
test_true(get_weak_flag(copy_value(set_weak_flag(({17}), 1))))
+
test_true(get_weak_flag(copy_value(set_weak_flag(([17:17]), 1))))
+
test_true(get_weak_flag(copy_value(set_weak_flag((<17>), 1))))
// - crypt test_true(stringp(crypt("hej")))