summaryrefslogtreecommitdiff
path: root/src/tests/eo/function_overrides
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-12-30 22:16:55 +0100
committerTom Hacohen <tom@stosb.com>2014-04-10 04:20:20 +0100
commit914dde776ff22fc1c5ba3d2ed1859bb2b1e993e9 (patch)
tree873de465f369be71cee17fe79b8c162204b57d35 /src/tests/eo/function_overrides
parent63c271dc5e81b9f7d81fcfb4ef06e7cbd2791330 (diff)
eo2: fix uninitialized vars in tests
because of conditional execution of eo2_do() fct calls these vars could end up not initialized.
Diffstat (limited to 'src/tests/eo/function_overrides')
-rw-r--r--src/tests/eo/function_overrides/function_overrides_inherit2.c6
-rw-r--r--src/tests/eo/function_overrides/function_overrides_main.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tests/eo/function_overrides/function_overrides_inherit2.c b/src/tests/eo/function_overrides/function_overrides_inherit2.c
index cf8b1cb0db..6a2369a6fc 100644
--- a/src/tests/eo/function_overrides/function_overrides_inherit2.c
+++ b/src/tests/eo/function_overrides/function_overrides_inherit2.c
@@ -18,7 +18,7 @@ _a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
18 eo2_do(obj, simple_a_print()); 18 eo2_do(obj, simple_a_print());
19 eo2_do_super(obj, MY_CLASS, simple_a_set(a + 1)); 19 eo2_do_super(obj, MY_CLASS, simple_a_set(a + 1));
20 20
21 Eina_Bool called; 21 Eina_Bool called = EINA_FALSE;
22 eo2_do_super(obj, MY_CLASS, called = simple_a_print()); 22 eo2_do_super(obj, MY_CLASS, called = simple_a_print());
23 fail_if(!called); 23 fail_if(!called);
24} 24}
@@ -26,7 +26,7 @@ _a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
26static Eina_Bool 26static Eina_Bool
27_print(Eo *obj, void *class_data EINA_UNUSED) 27_print(Eo *obj, void *class_data EINA_UNUSED)
28{ 28{
29 Eina_Bool called; 29 Eina_Bool called = EINA_FALSE;
30 printf("Hey\n"); 30 printf("Hey\n");
31 eo2_do_super(obj, MY_CLASS, called = inherit2_print()); 31 eo2_do_super(obj, MY_CLASS, called = inherit2_print());
32 fail_if(called); 32 fail_if(called);
@@ -45,7 +45,7 @@ _print2(Eo *obj EINA_UNUSED, void *class_data EINA_UNUSED)
45static Eina_Bool 45static Eina_Bool
46_class_print(Eo_Class *klass, void *data EINA_UNUSED) 46_class_print(Eo_Class *klass, void *data EINA_UNUSED)
47{ 47{
48 Eina_Bool called; 48 Eina_Bool called = EINA_FALSE;
49 printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS)); 49 printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
50 eo2_do_super(klass, MY_CLASS, called = simple_class_print()); 50 eo2_do_super(klass, MY_CLASS, called = simple_class_print());
51 fail_if(!called); 51 fail_if(!called);
diff --git a/src/tests/eo/function_overrides/function_overrides_main.c b/src/tests/eo/function_overrides/function_overrides_main.c
index 11f4c8f999..17aab2910d 100644
--- a/src/tests/eo/function_overrides/function_overrides_main.c
+++ b/src/tests/eo/function_overrides/function_overrides_main.c
@@ -17,7 +17,7 @@ main(int argc, char *argv[])
17 (void) argv; 17 (void) argv;
18 eo_init(); 18 eo_init();
19 19
20 Eina_Bool called; 20 Eina_Bool called = EINA_FALSE;
21 Eo *obj = eo2_add(INHERIT2_CLASS, NULL); 21 Eo *obj = eo2_add(INHERIT2_CLASS, NULL);
22 22
23 eo2_do(obj, simple_a_set(1)); 23 eo2_do(obj, simple_a_set(1));