call_other.c

ds2.10/fluffos-2.16-ds05/testsuite/single/tests/efuns/call_other.c · 667 B

From the archive ds2.10.zip

Download the archive   « Back to the archive contents

int foo() { return 1; }

int same(mixed *x, mixed *y) {
    for (int i = 0; i < sizeof(x); i++) {
        return x[i] == y[i];
    }
}

int bar(int x) {
    return x;
}

void do_tests() {
    ASSERT(file_name()->foo());
    ASSERT(this_object()->foo());
    ASSERT(same((mixed *)({ file_name(), this_object() })->foo(), ({ 1, 1 })));

    ASSERT(catch(call_other(this_object(), 0)));
    ASSERT(call_other(this_object(), "foo"));
    ASSERT(call_other(this_object(), ({ "foo", 1 })));
    ASSERT(catch(call_other("foadf", "foo")));

    ASSERT(undefinedp(this_object()->bazz()));
    destruct(this_object());
    ASSERT(undefinedp("/single/master"->valid_bind()));
}

Site Stats

Snippets: 1791
Codebases: 571