aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/eo/constructors/constructors_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo/constructors/constructors_main.c')
-rw-r--r--src/tests/eo/constructors/constructors_main.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/tests/eo/constructors/constructors_main.c b/src/tests/eo/constructors/constructors_main.c
index cab5e7ffba..28ea16f12b 100644
--- a/src/tests/eo/constructors/constructors_main.c
+++ b/src/tests/eo/constructors/constructors_main.c
@@ -24,14 +24,16 @@ main(int argc, char *argv[])
(void) argv;
eo_init();
- Eo *obj = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj;
+ eo_add(obj, SIMPLE_CLASS, NULL);
+ printf("my_init_count: %d\n", my_init_count);
fail_if(my_init_count != 2);
- eo_do(obj, simple_a_set(1), simple_b_set(2));
+ eo_do(obj, simple_a_set(obj, 1), simple_b_set(obj, 2));
int a = 0, b = 0;
- eo_do(obj, a = simple_a_get(), b = simple_b_get(), mixin_add_and_print(5));
+ eo_do(obj, a = simple_a_get(obj), b = simple_b_get(obj), mixin_add_and_print(obj, 5));
fail_if(a != 1);
fail_if(b != 2);
@@ -39,14 +41,14 @@ main(int argc, char *argv[])
fail_if(my_init_count != 0);
- obj = eo_add(SIMPLE2_CLASS, NULL);
+ eo_add(obj, SIMPLE2_CLASS, NULL);
fail_if(obj);
- obj = eo_add(SIMPLE3_CLASS, NULL);
+ eo_add(obj, SIMPLE3_CLASS, NULL);
fail_if(obj);
my_init_count = 0;
- obj = eo_add(SIMPLE4_CLASS, NULL);
+ eo_add(obj, SIMPLE4_CLASS, NULL);
fail_if(my_init_count != 2);
@@ -54,34 +56,34 @@ main(int argc, char *argv[])
fail_if(my_init_count != 0);
- obj = eo_add(SIMPLE5_CLASS, NULL);
+ eo_add(obj, SIMPLE5_CLASS, NULL);
fail_if(!obj);
eo_unref(obj);
- obj = eo_add(SIMPLE6_CLASS, NULL);
+ eo_add(obj, SIMPLE6_CLASS, NULL);
fail_if(!obj);
eo_unref(obj);
- obj = eo_add(SIMPLE7_CLASS, NULL);
+ eo_add(obj, SIMPLE7_CLASS, NULL);
fail_if(obj);
my_init_count = 0;
- obj = eo_add(SIMPLE_CLASS, NULL);
+ eo_add(obj, SIMPLE_CLASS, NULL);
fail_if(!obj);
fail_if(my_init_count != 2);
- eo_do(obj, a = simple_a_get());
+ eo_do(obj, a = simple_a_get(obj));
fail_if(a != 0);
my_init_count = 0;
- obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(7));
+ eo_add(obj, SIMPLE_CLASS, NULL, simple_a_set(obj, 7));
fail_if(!obj);
fail_if(my_init_count != 2);
- eo_do(obj, a = simple_a_get(););
+ eo_do(obj, a = simple_a_get(obj););
fail_if(a != 7);
my_init_count = 0;
- obj = eo_add(SIMPLE_CLASS, NULL, simple_b_set(6), simple_a_set(-1),
- b = simple_b_get());
+ eo_add(obj, SIMPLE_CLASS, NULL, simple_b_set(obj, 6), simple_a_set(obj, -1),
+ b = simple_b_get(obj));
fail_if(obj);
fail_if(b != 6);
fail_if(my_init_count != 0);