pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:1: - test_true([["$Id: testsuite.in,v 1.597 2003/02/11 15:22:29 mirar Exp $"]]); + test_true([["$Id: testsuite.in,v 1.598 2003/02/12 22:57:54 mast Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])      cond([[all_constants()->_verify_internals]],   [[    test_do(_verify_internals())   ]]);   test_eq(1e1,10.0);   test_eq(1E1,10.0);
pike.git/src/testsuite.in:3942:    return sizeof (indices (m)) || sizeof (m);   }]], 0)   test_any([[{    object o = class{}();    mapping m = ([o: 1]);    destruct (o);    return sizeof (values (m)) || sizeof (m);   }]], 0)      // gc - ifefun(gc, - [[ +     test_true(intp(gc()));    test_any([[ array a=({0}); a[0]=a; gc(); a=0; return gc() > 0; ]],1);    test_any([[object o=class c {object o;}(); o->o=o; gc(); o=0; return gc() > 0; ]],1);    test_any([[object o=class c {object o;}(); o->o=o; gc(); o=0; return gc() > 0; ]],1);    test_any([[mapping m=([]); m[m]=m; gc(); m=0; return gc() > 0; ]],1);    test_any([[multiset m=(<>); m[m]=1; gc(); m=0; return gc() > 0; ]],1);    test_any([[{   #if !constant (_debug)    int _debug (int d) {return 0;};   #endif
pike.git/src/testsuite.in:4035:    m->self=m;       mapping q=(["foo":"bar","gazonk":1]);    m->q=q;       q+=([]);    m=0;    gc();    return sizeof(q);    ]],2) - ]]) +     - ifefun(gc, - [[ +     test_eq([[    int dummy;    gc();    function f = lambda() {    object o = class{}();    int i;    return lambda() {return i;};    }();    lambda() {dummy++;}(); // Ensure refcount garbing is done.    int n = gc();
pike.git/src/testsuite.in:4107:    object o = Dead(); o->o = Live(); o->o->o = o;    gc(); o = 0; return gc() > 0;    }]], 1)    test_any([[{    class Dead {object o;};    class Live {object o; void destroy() {}};    object o = Live(); o->o = Dead(); o->o->o = o;    gc(); o = 0; return gc() > 0;    }]], 1)    -  - ]]) -  - ifefun(gc, - [[ -  +     test_any_equal([[{    class Live {object o; void destroy() {}};    array a = set_weak_flag(({Live()}), 1);    gc(); return a;    }]], ({0}))    test_any_equal([[{    class Live {object o; void destroy() {}};    multiset l = set_weak_flag((<Live()>), 1);    gc(); return l;    }]], (<>))
pike.git/src/testsuite.in:4178:    }();    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_do(add_constant("kablutt");)   test_do(add_constant("blatinka");)    - ifefun(gc, - [[ -  +     test_any([[{    class Dead {object o;};    object o = Dead(); o->o = Dead();    array a = set_weak_flag(({o}), 1);    gc(); o = 0; return gc() > 0;    }]], 1)    test_any([[{    class Dead {object o;};    class Live {object o; void destroy() {}};    object o = Live(); o->o = Dead();
pike.git/src/testsuite.in:4238:    }]], 1);    test_any([[{    multiset a = (<>), b = (<a, set_weak_flag ((<a>), 1)>);    multiset x = set_weak_flag ((<a>), 1);    a[b] = 1;    a = b = 0;    gc();    return !sizeof (x);    }]], 1);    - ]]) -  - ifefun(gc, - [[ -  +     test_any([[{    class Foo {    Foo f = this_object();    multiset(Foo) g = set_weak_flag((<this_object()>), 1);    };    multiset(Foo) x = set_weak_flag ((<Foo()>), 1);    gc();    return !sizeof (x);    }]], 1);    test_any([[{
pike.git/src/testsuite.in:4364:    int i;    class Bar    {    int j = i++; // Ensure parent pointer.    }    inherit Bar;    }")();    o = 0;    gc();    }]]); - ]]) +     - ifefun(gc, - [[ -  +     test_do([[{    mapping a = ([1:({17}),2:3,4:5,6:7,8:9]), b = a + ([]);    set_weak_flag (b, 1);    gc();    }]]);    test_do([[{    mapping a = ([1:({17})]), b = a + ([]);    set_weak_flag (b, 1);    gc();    }]]);
pike.git/src/testsuite.in:4421:    mapping b = a + ([]);    foreach (indices (a), mixed o) if (objectp (o)) destruct (o);    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);    - ]]) -  - ifefun(gc, - [[ -  +     test_any([[{    object o = class{}();    mapping a = set_weak_flag ((["foo": o]), 1);    gc();    return sizeof (a);    }]], 1);    test_any([[{    object o = class{}();    mapping a = set_weak_flag (([o: o]), 1);    gc();
pike.git/src/testsuite.in:4465:    test_any([[{    object o = class{}();    mapping a = set_weak_flag (([o: class{}()]), 1);    return gc() >= 1 && !sizeof (a);    }]], 1);    test_any([[{    mapping a = set_weak_flag (([class{}(): class{}()]), 1);    return gc() >= 2 && !sizeof (a);    }]], 1);    - ]]) -  - ifefun(gc, - [[ -  +     test_any([[{    object o = class{}();    mapping a = set_weak_flag ((["foo": o]), 1);    destruct (o);    gc();    return !sizeof (a);    }]], 1);    test_any([[{    object o = class{}();    mapping a = set_weak_flag (([o: o]), 1);
pike.git/src/testsuite.in:4578:    object f = class    {    object o = class {}();    multiset m = set_weak_flag ((<o>), 1);    object this = this_object();    void create() {destruct (o);}    }();    f = 0;    gc();    }]]); - ]]) +     - ifefun(gc, - [[ -  +     test_tests([[inherit "]]SRCDIR[[/test_gc.pike";]])    - ]]) -  - ifefun(gc, - [[ -  +     test_any([[mapping q=([ "t":class {} ()]); gc(); if(!objectp(q->t)) return -1; set_weak_flag(q,1); gc(); if(objectp(q->t)) return -2; return 0;]],0);       test_do([[class bar { object foo; void create(void|object tmp) { foo=tmp; } };    object o=bar(),o2=o;    for(int e=0;e<10000;e++) o=bar(o);    o2->foo=o;    o=o2=0;    gc();    ]])   
pike.git/src/testsuite.in:4708:    return sizeof (m);    ]], 0)    test_any([[    object o = class{}();    mapping m = (["x": o]);    destruct (o);    gc();    return sizeof (m);    ]], 1)    - ]]) -  - ifefun(gc, - [[ -  +     test_do([[    mapping m = set_weak_flag (([]), Pike.WEAK_INDICES);    object o = class {object o;}();    m[o] = ({1});    o->o = o;    o = 0;    gc();    ]])       test_do([[
pike.git/src/testsuite.in:4808:    object o = class {    Obj a = Obj (this_object());    void destroy() {x = a;}    }();    o = 0;    gc();    return x && !x->o;    }    }()->test();    ]], 1) - ]]) +       cond([[ sizeof( cpp("__AUTO_BIGNUM__")/"__AUTO_BIGNUM__" ) == 1 ]],   [[    // Test the lexer.    test_eq("2147483648", [[ (string)0x80000000 ]])    test_eq("2147483649", [[ (string)0x80000001 ]])    test_eq("-2147483648", [[ (string)-0x80000000 ]])    test_eq("-2147483649", [[ (string)-0x80000001 ]])    test_eq("2147483648", [[ (string)-(-0x80000000) ]])    test_eq("2147483649", [[ (string)-(-0x80000001) ]])
pike.git/src/testsuite.in:7556:      // - function_object   test_eq(function_object(a),this_object())   test_eq(function_name(function_object),0)      // - function_program      // - functionp   // Tested in foop    - // - gc -  +    // - get_all_groups   // - get_all_users   // - get_dir   // - get_groups_for_user   // - get_weak_flag   // - getcwd   // - getegid   // - getenv   // - geteuid   // - getgid