2012-04-10 02:12:46 -07:00
|
|
|
#include "Eobj.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "simple.h"
|
|
|
|
#include "simple2.h"
|
|
|
|
#include "simple3.h"
|
|
|
|
#include "simple4.h"
|
2012-04-12 07:59:01 -07:00
|
|
|
#include "simple5.h"
|
|
|
|
#include "simple6.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "mixin.h"
|
|
|
|
|
2012-04-12 04:20:26 -07:00
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-05 08:31:15 -07:00
|
|
|
int my_init_count = 0;
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
|
|
|
eobj_init();
|
|
|
|
|
|
|
|
Eobj *obj = eobj_add(SIMPLE_CLASS, NULL);
|
|
|
|
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(my_init_count != 2);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-24 01:56:49 -07:00
|
|
|
eobj_do(obj, simple_a_set(1), simple_b_set(2));
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
int a, b;
|
2012-04-24 01:56:49 -07:00
|
|
|
eobj_do(obj, simple_a_get(&a), simple_b_get(&b), mixin_add_and_print(5));
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
eobj_unref(obj);
|
|
|
|
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(my_init_count != 0);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
obj = eobj_add(SIMPLE2_CLASS, NULL);
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(obj);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
obj = eobj_add(SIMPLE3_CLASS, NULL);
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(obj);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
my_init_count = 0;
|
|
|
|
obj = eobj_add(SIMPLE4_CLASS, NULL);
|
|
|
|
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(my_init_count != 2);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
eobj_unref(obj);
|
|
|
|
|
2012-04-12 04:20:26 -07:00
|
|
|
fail_if(my_init_count != 0);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-12 07:59:01 -07:00
|
|
|
obj = eobj_add(SIMPLE5_CLASS, NULL);
|
|
|
|
eobj_unref(obj);
|
|
|
|
|
|
|
|
obj = eobj_add(SIMPLE6_CLASS, NULL);
|
|
|
|
eobj_unref(obj);
|
|
|
|
|
2012-04-05 08:31:15 -07:00
|
|
|
eobj_shutdown();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|