2012-05-01 00:40:14 -07:00
|
|
|
#include "Eo.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "simple.h"
|
|
|
|
#include "mixin.h"
|
2012-04-19 01:52:25 -07:00
|
|
|
#include "mixin2.h"
|
|
|
|
#include "mixin3.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-19 01:52:11 -07:00
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-05 08:31:15 -07:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_init();
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
Eo *obj = eo_add(SIMPLE_CLASS, NULL);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_do(obj, simple_a_set(1), simple_b_set(2));
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-19 01:52:11 -07:00
|
|
|
int a, b, sum = 0;
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_do(obj, simple_a_get(&a), simple_b_get(&b), mixin_ab_sum_get(&sum));
|
2012-04-19 01:52:11 -07:00
|
|
|
fail_if(sum != a + b + 2); /* 2 for the two mixins... */
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_do(obj, mixin_ab_sum_get(&sum), mixin_ab_sum_get(&sum));
|
2012-04-19 01:52:25 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
Mixin2_Public_Data *pd2 = eo_data_get(obj, MIXIN2_CLASS);
|
2012-04-19 01:52:25 -07:00
|
|
|
fail_if(pd2->count != 6);
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
Mixin3_Public_Data *pd3 = eo_data_get(obj, MIXIN3_CLASS);
|
2012-04-19 01:52:25 -07:00
|
|
|
fail_if(pd3->count != 9);
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_unref(obj);
|
|
|
|
eo_shutdown();
|
2012-04-05 08:31:15 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|