Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, April 19, 2024

File: [Platon] / libco / test / co_module_testing.c (download)

Revision 1.4, Sun Mar 9 10:32:41 2003 UTC (21 years, 1 month ago) by yenar


Changes since 1.3: +2 -1 lines

fix few bugs and make some use of CO_M (super, destroy, 0); (test/*.{h,c})

#include "../libco/co_object.h"
#include "../libco/co_super.h"
#include "../libco/co_util.h"

/* {{{ */
CO_OBJECT (person)
{
    CO_HEAD_FULL;
    CO_ATTR (int, id);
};
/* }}} */

#include "co_module_testing.cometa"

/* {{{ */ static co person_new (void)
{
    co_o_head_full o;
    o = (co_o_head_full) new (person_s);
    person_meth_ar_init (o);
    CO_BLESS (o, person, 0);
    return o;
} /* }}} */

/* {{{ */
CO_METH (person, getid)
{
    int i;
    CO_METH_INI (person, getid);
    i = CO_A (int, self, id);
    CO_DEBUG (1, "returning %d", i);
    CO_RETURN (int, i);
}
/* }}} */
/* {{{ */
CO_METH (person, default)
{
    CO_METH_INI (person, default);
    CO_RETURN (int, 0);
}
/* }}} */

co __co_mod_init (co_super super);
/* {{{ */
co __co_mod_init (co_super super)
{
    person ret;
    __co_file_init_co_module_testing_c (super);
    CO_DEBUG (2, "will create person...");
    CO_DEBUG (2, "id of clone is %d", COM (clone));
    ret = person_new ();
    ret -> id = 0xF0A42; // test value
    cox_pop (ret);
    return ret;
}
/* }}} */

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top