Esempio n. 1
0
/* $CORTO_GENERATED
 *
 * RelativeName.c
 *
 * Only code written between the begin and end tags will be preserved
 * when the file is regenerated.
 */

#include <test.h>

corto_void _test_RelativeName_setup(
    test_RelativeName this)
{
/* $begin(test/RelativeName/setup) */

    corto_setref(&this->tier1, corto_voidCreateChild(NULL, "tier1"));
    corto_setref(&this->tier2, corto_voidCreateChild(this->tier1, "tier2"));
    corto_setref(&this->tier3, corto_voidCreateChild(this->tier2, "tier3"));
    corto_setref(&this->obj, corto_voidCreateChild(this->tier3, "obj"));
    corto_setref(&this->disjunct, corto_voidCreateChild(this->tier1, "disjunct"));
    corto_setref(&this->child, corto_voidCreateChild(this->obj, "child"));

    test_assert(this->tier1 != NULL);
    test_assert(this->tier2 != NULL);
    test_assert(this->tier3 != NULL);
    test_assert(this->obj != NULL);
    test_assert(this->disjunct != NULL);
    test_assert(this->child != NULL);

/* $end */
}
Esempio n. 2
0
    corto_observerEvent *e)
{
    test_Ownership this = e->instance;
    this->observable = (corto_word)e->data;
}

void test_Ownership_setup(
    test_Ownership this)
{

}

void test_Ownership_tc_checkOwnerNull(
    test_Ownership this)
{
    corto_object o = corto_voidCreateChild(NULL, "o");
    test_assert(o != NULL);
    test_assert(corto_ownerof(o) == NULL);

    corto_int16 result = corto_delete(o);
    test_assert(result == 0);

}

void test_Ownership_tc_checkOwnerReplicator(
    test_Ownership this)
{
    test_FooReplicator r = test_FooReplicatorCreate(root_o);

    corto_object old = corto_setOwner(r);
    test_assert(old == NULL);