summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-05-28 17:47:33 +0100
committerTom Hacohen <tom@stosb.com>2015-05-28 17:47:59 +0100
commit52d998f475afd1a8cb18e5990aafd7f1c2b5c41e (patch)
treea392364afb9663810e94776ebde6dc99a52cf2f2 /src/tests
parentd0b58aab54131eb71be6d3289fd11a78b8c9adf5 (diff)
Eo base: Remove the free_func parameter from key_data_set.
This was not really useful and against the Eolian guidelines. While I promised I won't break things until the 27th, I was ill (still am), so I'm giving myself a 1 day pass. :P
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c6
-rw-r--r--src/tests/eo/composite_objects/composite_objects_comp.c2
-rw-r--r--src/tests/eo/signals/signals_simple.c2
-rw-r--r--src/tests/eo/suite/eo_test_general.c42
4 files changed, 8 insertions, 44 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index aeea55f..4be231c 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -116,7 +116,7 @@ START_TEST(ecore_test_ecore_audio_cleanup)
116 116
117 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); 117 in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL);
118 fail_if(!in); 118 fail_if(!in);
119 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq, NULL)); 119 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq));
120 eo_do(in, ecore_audio_obj_in_length_set(2)); 120 eo_do(in, ecore_audio_obj_in_length_set(2));
121 121
122 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); 122 out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
@@ -170,12 +170,12 @@ START_TEST(ecore_test_ecore_audio_obj_tone)
170 fail_if(freq != 1000); 170 fail_if(freq != 1000);
171 171
172 freq = 2000; 172 freq = 2000;
173 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq, NULL)); 173 eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq));
174 174
175 eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ)); 175 eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ));
176 fail_if(freq != 2000); 176 fail_if(freq != 2000);
177 177
178 eo_do(in, eo_key_data_set("foo", "bar", NULL)); 178 eo_do(in, eo_key_data_set("foo", "bar"));
179 eo_do(in, tmp = eo_key_data_get("foo")); 179 eo_do(in, tmp = eo_key_data_get("foo"));
180 ck_assert_str_eq(tmp, "bar"); 180 ck_assert_str_eq(tmp, "bar");
181 181
diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c
index b933e19..1e59b4d 100644
--- a/src/tests/eo/composite_objects/composite_objects_comp.c
+++ b/src/tests/eo/composite_objects/composite_objects_comp.c
@@ -34,7 +34,7 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED)
34 fail_if(eo_do_ret(obj, tmp, eo_composite_part_is())); 34 fail_if(eo_do_ret(obj, tmp, eo_composite_part_is()));
35 fail_if(!eo_do_ret(simple, tmp, eo_composite_part_is())); 35 fail_if(!eo_do_ret(simple, tmp, eo_composite_part_is()));
36 36
37 eo_do(obj, eo_key_data_set("simple-obj", simple, NULL)); 37 eo_do(obj, eo_key_data_set("simple-obj", simple));
38 38
39 return obj; 39 return obj;
40} 40}
diff --git a/src/tests/eo/signals/signals_simple.c b/src/tests/eo/signals/signals_simple.c
index f113e51..67e5f68 100644
--- a/src/tests/eo/signals/signals_simple.c
+++ b/src/tests/eo/signals/signals_simple.c
@@ -68,7 +68,7 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED)
68 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, NULL)); 68 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, NULL));
69 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, NULL)); 69 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, NULL));
70 70
71 eo_do(obj, eo_key_data_set("cb_count", (intptr_t) 0, NULL)); 71 eo_do(obj, eo_key_data_set("cb_count", (intptr_t) 0));
72 72
73 return obj; 73 return obj;
74} 74}
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 59cb4db..47064cf 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -547,31 +547,21 @@ START_TEST(eo_weak_reference)
547} 547}
548END_TEST 548END_TEST
549 549
550static void
551_fake_free_func(void *data)
552{
553 if (!data)
554 return;
555
556 int *a = data;
557 ++*a;
558}
559
560START_TEST(eo_generic_data) 550START_TEST(eo_generic_data)
561{ 551{
562 eo_init(); 552 eo_init();
563 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 553 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
564 void *data = NULL; 554 void *data = NULL;
565 555
566 eo_do(obj, eo_key_data_set("test1", (void *) 1, NULL)); 556 eo_do(obj, eo_key_data_set("test1", (void *) 1));
567 eo_do(obj, data = eo_key_data_get("test1")); 557 eo_do(obj, data = eo_key_data_get("test1"));
568 fail_if(1 != (intptr_t) data); 558 fail_if(1 != (intptr_t) data);
569 eo_do(obj, eo_key_data_del("test1")); 559 eo_do(obj, eo_key_data_del("test1"));
570 eo_do(obj, data = eo_key_data_get("test1")); 560 eo_do(obj, data = eo_key_data_get("test1"));
571 fail_if(data); 561 fail_if(data);
572 562
573 eo_do(obj, eo_key_data_set("test1", (void *) 1, NULL)); 563 eo_do(obj, eo_key_data_set("test1", (void *) 1));
574 eo_do(obj, eo_key_data_set("test2", (void *) 2, NULL)); 564 eo_do(obj, eo_key_data_set("test2", (void *) 2));
575 eo_do(obj, data = eo_key_data_get("test1")); 565 eo_do(obj, data = eo_key_data_get("test1"));
576 fail_if(1 != (intptr_t) data); 566 fail_if(1 != (intptr_t) data);
577 eo_do(obj, data = eo_key_data_get("test2")); 567 eo_do(obj, data = eo_key_data_get("test2"));
@@ -589,33 +579,7 @@ START_TEST(eo_generic_data)
589 eo_do(obj, data = eo_key_data_get("test1")); 579 eo_do(obj, data = eo_key_data_get("test1"));
590 fail_if(data); 580 fail_if(data);
591 581
592 int a = 0;
593 eo_do(obj, eo_key_data_set("test3", &a, _fake_free_func));
594 eo_do(obj, data = eo_key_data_get("test3"));
595 fail_if(&a != data);
596 eo_do(obj, eo_key_data_get("test3"));
597 eo_do(obj, eo_key_data_del("test3"));
598 fail_if(a != 1);
599
600 a = 0;
601 eo_do(obj, eo_key_data_set("test3", &a, _fake_free_func));
602 eo_do(obj, eo_key_data_set("test3", NULL, _fake_free_func));
603 fail_if(a != 1);
604 a = 0;
605 data = (void *) 123;
606 eo_do(obj, eo_key_data_set(NULL, &a, _fake_free_func));
607 eo_do(obj, data = eo_key_data_get(NULL));
608 fail_if(data);
609 eo_do(obj, eo_key_data_del(NULL));
610
611 a = 0;
612 eo_do(obj, eo_key_data_set("test3", &a, _fake_free_func));
613 eo_do(obj, eo_key_data_set("test3", NULL, NULL));
614 fail_if(a != 1);
615 eo_do(obj, eo_key_data_set("test3", &a, _fake_free_func));
616
617 eo_unref(obj); 582 eo_unref(obj);
618 fail_if(a != 2);
619 583
620 eo_shutdown(); 584 eo_shutdown();
621} 585}