summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite/eo_test_general.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo/suite/eo_test_general.c')
-rw-r--r--src/tests/eo/suite/eo_test_general.c182
1 files changed, 97 insertions, 85 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 5add8d3..4dd7f75 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -22,8 +22,8 @@ START_TEST(eo_simple)
22 22
23 obj = eo_add(SIMPLE_CLASS, NULL); 23 obj = eo_add(SIMPLE_CLASS, NULL);
24 fail_if(!obj); 24 fail_if(!obj);
25 eo_do(obj, eo_constructor()); 25 eo_constructor(obj);
26 eo_do(obj, eo_destructor()); 26 eo_destructor(obj);
27 eo_unref(obj); 27 eo_unref(obj);
28 28
29 eo_shutdown(); 29 eo_shutdown();
@@ -36,7 +36,7 @@ START_TEST(eo_stack)
36 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 36 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
37 fail_if(!obj); 37 fail_if(!obj);
38 38
39 eo_do(obj, simple_recursive(123)); 39 simple_recursive(obj, 123);
40 40
41 eo_unref(obj); 41 eo_unref(obj);
42 42
@@ -103,25 +103,25 @@ START_TEST(eo_signals)
103 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 103 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
104 Eina_Bool r; 104 Eina_Bool r;
105 105
106 eo_do(obj, eo_event_callback_add(EO_BASE_EVENT_CALLBACK_ADD, _eo_signals_cb_added_deled, callbacks)); 106 eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_ADD, _eo_signals_cb_added_deled, callbacks);
107 eo_do(obj, r = eo_event_callback_add(EO_BASE_EVENT_CALLBACK_DEL, _eo_signals_cb_added_deled, callbacks)); 107 r = eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_DEL, _eo_signals_cb_added_deled, callbacks);
108 fail_if(!r); 108 fail_if(!r);
109 eo_do(obj, eo_event_callback_array_priority_add(callbacks, -100, (void *) 1)); 109 eo_event_callback_array_priority_add(obj, callbacks, -100, (void *) 1);
110 eo_do(obj, eo_event_callback_array_add(callbacks, (void *) 3)); 110 eo_event_callback_array_add(obj, callbacks, (void *) 3);
111 eo_do(obj, r = eo_event_callback_array_priority_add(callbacks, -50, (void *) 2)); 111 r = eo_event_callback_array_priority_add(obj, callbacks, -50, (void *) 2);
112 fail_if(!r); 112 fail_if(!r);
113 eo_do(obj, simple_a_set(1)); 113 simple_a_set(obj, 1);
114 ck_assert_int_eq(_eo_signals_cb_flag, 0x3); 114 ck_assert_int_eq(_eo_signals_cb_flag, 0x3);
115 115
116 eo_do(obj, eo_event_callback_array_del(callbacks, (void *) 1)); 116 eo_event_callback_array_del(obj, callbacks, (void *) 1);
117 eo_do(obj, eo_event_callback_array_del(callbacks, (void *) 2)); 117 eo_event_callback_array_del(obj, callbacks, (void *) 2);
118 eo_do(obj, r = eo_event_callback_array_del(callbacks, (void *) 3)); 118 r = eo_event_callback_array_del(obj, callbacks, (void *) 3);
119 fail_if(!r); 119 fail_if(!r);
120 /* Try to delete something that doesn't exist. */ 120 /* Try to delete something that doesn't exist. */
121 eo_do(obj, r = eo_event_callback_array_del(callbacks, (void *) 4)); 121 r = eo_event_callback_array_del(obj, callbacks, (void *) 4);
122 fail_if(r); 122 fail_if(r);
123 _eo_signals_cb_flag = 0; 123 _eo_signals_cb_flag = 0;
124 eo_do(obj, simple_a_set(1)); 124 simple_a_set(obj, 1);
125 ck_assert_int_eq(_eo_signals_cb_flag, 0x0); 125 ck_assert_int_eq(_eo_signals_cb_flag, 0x0);
126 126
127 eo_unref(obj); 127 eo_unref(obj);
@@ -140,21 +140,21 @@ START_TEST(eo_signals)
140 140
141 /* Call Eo event with legacy and non-legacy callbacks. */ 141 /* Call Eo event with legacy and non-legacy callbacks. */
142 _eo_signals_cb_current = 0; 142 _eo_signals_cb_current = 0;
143 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED2, -1000, _eo_signals_a_changed_never, (void *) 1)); 143 eo_event_callback_priority_add(obj, EV_A_CHANGED2, -1000, _eo_signals_a_changed_never, (void *) 1);
144 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, -100, _eo_signals_a_changed_cb, (void *) 1)); 144 eo_event_callback_priority_add(obj, EV_A_CHANGED, -100, _eo_signals_a_changed_cb, (void *) 1);
145 eo_do(obj, eo_event_callback_add(a_desc, _eo_signals_a_changed_cb2, NULL)); 145 eo_event_callback_add(obj, a_desc, _eo_signals_a_changed_cb2, NULL);
146 eo_do(obj, simple_a_set(1)); 146 simple_a_set(obj, 1);
147 ck_assert_int_eq(_eo_signals_cb_flag, 0x3); 147 ck_assert_int_eq(_eo_signals_cb_flag, 0x3);
148 148
149 /* We don't need this one anymore. */ 149 /* We don't need this one anymore. */
150 eo_do(obj, r = eo_event_callback_del(EV_A_CHANGED2, _eo_signals_a_changed_never, (void *) 1)); 150 r = eo_event_callback_del(obj, EV_A_CHANGED2, _eo_signals_a_changed_never, (void *) 1);
151 fail_if(!r); 151 fail_if(!r);
152 152
153 /* Call legacy event with legacy and non-legacy callbacks. */ 153 /* Call legacy event with legacy and non-legacy callbacks. */
154 int a = 3; 154 int a = 3;
155 _eo_signals_cb_current = 0; 155 _eo_signals_cb_current = 0;
156 _eo_signals_cb_flag = 0; 156 _eo_signals_cb_flag = 0;
157 eo_do(obj, eo_event_callback_call(a_desc, &a)); 157 eo_event_callback_call(obj, a_desc, &a);
158 ck_assert_int_eq(_eo_signals_cb_flag, 0x3); 158 ck_assert_int_eq(_eo_signals_cb_flag, 0x3);
159 } 159 }
160 eo_unref(obj); 160 eo_unref(obj);
@@ -292,9 +292,9 @@ START_TEST(eo_composite_tests)
292 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 292 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
293 fail_if(!obj2); 293 fail_if(!obj2);
294 294
295 eo_do(obj, eo_composite_attach(obj2)); 295 eo_composite_attach(obj, obj2);
296 eo_do(obj2, eo_parent_set(NULL)); 296 eo_parent_set(obj2, NULL);
297 fail_if(eo_do_ret(obj2, tmp, eo_composite_part_is())); 297 fail_if(eo_composite_part_is(obj2));
298 298
299 eo_unref(obj2); 299 eo_unref(obj2);
300 eo_unref(obj); 300 eo_unref(obj);
@@ -312,13 +312,13 @@ _man_con(Eo *obj, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
312{ 312{
313 if (_man_should_con) 313 if (_man_should_con)
314 eo_manual_free_set(obj, EINA_TRUE); 314 eo_manual_free_set(obj, EINA_TRUE);
315 return eo_do_super_ret(obj, cur_klass, obj, eo_constructor()); 315 return eo_constructor(eo_super(obj, cur_klass));
316} 316}
317 317
318static void 318static void
319_man_des(Eo *obj, void *data EINA_UNUSED, va_list *list EINA_UNUSED) 319_man_des(Eo *obj, void *data EINA_UNUSED, va_list *list EINA_UNUSED)
320{ 320{
321 eo_do_super(obj, cur_klass, eo_destructor()); 321 eo_destructor(eo_super(obj, cur_klass));
322 if (_man_should_des) 322 if (_man_should_des)
323 eo_manual_free_set(obj, EINA_FALSE); 323 eo_manual_free_set(obj, EINA_FALSE);
324} 324}
@@ -454,7 +454,7 @@ START_TEST(eo_refs)
454 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj)); 454 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj));
455 455
456 Eo *wref = NULL; 456 Eo *wref = NULL;
457 eo_do(obj2, eo_wref_add(&wref)); 457 eo_wref_add(obj2, &wref);
458 fail_if(!wref); 458 fail_if(!wref);
459 459
460 eo_unref(obj2); 460 eo_unref(obj2);
@@ -479,18 +479,18 @@ START_TEST(eo_refs)
479 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj)); 479 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj));
480 obj3 = eo_ref(eo_add(SIMPLE_CLASS, NULL)); 480 obj3 = eo_ref(eo_add(SIMPLE_CLASS, NULL));
481 481
482 eo_do(obj2, eo_parent_set(obj3)); 482 eo_parent_set(obj2, obj3);
483 eo_do(obj3, eo_parent_set(obj)); 483 eo_parent_set(obj3, obj);
484 ck_assert_int_eq(eo_ref_get(obj2), 2); 484 ck_assert_int_eq(eo_ref_get(obj2), 2);
485 ck_assert_int_eq(eo_ref_get(obj3), 2); 485 ck_assert_int_eq(eo_ref_get(obj3), 2);
486 486
487 eo_do(obj2, eo_parent_set(NULL)); 487 eo_parent_set(obj2, NULL);
488 eo_do(obj3, eo_parent_set(NULL)); 488 eo_parent_set(obj3, NULL);
489 ck_assert_int_eq(eo_ref_get(obj2), 1); 489 ck_assert_int_eq(eo_ref_get(obj2), 1);
490 ck_assert_int_eq(eo_ref_get(obj3), 1); 490 ck_assert_int_eq(eo_ref_get(obj3), 1);
491 491
492 eo_do(obj2, eo_parent_set(obj)); 492 eo_parent_set(obj2, obj);
493 eo_do(obj3, eo_parent_set(obj)); 493 eo_parent_set(obj3, obj);
494 ck_assert_int_eq(eo_ref_get(obj2), 1); 494 ck_assert_int_eq(eo_ref_get(obj2), 1);
495 ck_assert_int_eq(eo_ref_get(obj3), 1); 495 ck_assert_int_eq(eo_ref_get(obj3), 1);
496 496
@@ -522,14 +522,14 @@ START_TEST(eo_weak_reference)
522 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 522 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
523 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 523 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
524 Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL; 524 Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL;
525 eo_do(obj, eo_wref_add(&wref)); 525 eo_wref_add(obj, &wref);
526 fail_if(!wref); 526 fail_if(!wref);
527 527
528 eo_unref(obj); 528 eo_unref(obj);
529 fail_if(wref); 529 fail_if(wref);
530 530
531 obj = eo_add(SIMPLE_CLASS, NULL); 531 obj = eo_add(SIMPLE_CLASS, NULL);
532 eo_do(obj, eo_wref_add(&wref)); 532 eo_wref_add(obj, &wref);
533 533
534 eo_ref(obj); 534 eo_ref(obj);
535 fail_if(!wref); 535 fail_if(!wref);
@@ -542,35 +542,41 @@ START_TEST(eo_weak_reference)
542 542
543 obj = eo_add(SIMPLE_CLASS, NULL); 543 obj = eo_add(SIMPLE_CLASS, NULL);
544 544
545 eo_do(obj, eo_wref_add(&wref)); 545 eo_wref_add(obj, &wref);
546 eo_do(obj, eo_wref_del(&wref)); 546 eo_wref_del(obj, &wref);
547 fail_if(wref); 547 fail_if(wref);
548 548
549 eo_do(obj, eo_wref_add(&wref)); 549 eo_wref_add(obj, &wref);
550 eo_do(obj2, eo_wref_del(&wref)); 550 eo_wref_del(obj2, &wref);
551 fail_if(!wref); 551 fail_if(!wref);
552 eo_wref_del_safe(&wref); 552 eo_wref_del_safe(&wref);
553 fail_if(wref); 553 fail_if(wref);
554 554
555 wref = obj; 555 wref = obj;
556 eo_do(obj, eo_wref_del(&wref)); 556 eo_wref_del(obj, &wref);
557 fail_if(wref); 557 fail_if(wref);
558 558
559 wref = wref2 = wref3 = NULL; 559 wref = wref2 = wref3 = NULL;
560 eo_do(obj, eo_wref_add(&wref), eo_wref_add(&wref2), eo_wref_add(&wref3)); 560 eo_wref_add(obj, &wref);
561 eo_wref_add(obj, &wref2);
562 eo_wref_add(obj, &wref3);
561 fail_if(!wref); 563 fail_if(!wref);
562 fail_if(!wref2); 564 fail_if(!wref2);
563 fail_if(!wref3); 565 fail_if(!wref3);
564 eo_do(obj, eo_wref_del(&wref), eo_wref_del(&wref2), eo_wref_del(&wref3)); 566 eo_wref_del(obj, &wref);
567 eo_wref_del(obj, &wref2);
568 eo_wref_del(obj, &wref3);
565 fail_if(wref); 569 fail_if(wref);
566 fail_if(wref2); 570 fail_if(wref2);
567 fail_if(wref3); 571 fail_if(wref3);
568 572
569 eo_do(obj, eo_wref_add(&wref2), eo_wref_add(&wref3)); 573 eo_wref_add(obj, &wref2);
574 eo_wref_add(obj, &wref3);
570 wref = obj; 575 wref = obj;
571 eo_do(obj, eo_wref_del(&wref)); 576 eo_wref_del(obj, &wref);
572 fail_if(wref); 577 fail_if(wref);
573 eo_do(obj, eo_wref_del(&wref2), eo_wref_del(&wref3)); 578 eo_wref_del(obj, &wref2);
579 eo_wref_del(obj, &wref3);
574 580
575 eo_unref(obj); 581 eo_unref(obj);
576 eo_unref(obj2); 582 eo_unref(obj2);
@@ -586,30 +592,30 @@ START_TEST(eo_generic_data)
586 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 592 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
587 void *data = NULL; 593 void *data = NULL;
588 594
589 eo_do(obj, eo_key_data_set("test1", (void *) 1)); 595 eo_key_data_set(obj, "test1", (void *) 1);
590 eo_do(obj, data = eo_key_data_get("test1")); 596 data = eo_key_data_get(obj, "test1");
591 fail_if(1 != (intptr_t) data); 597 fail_if(1 != (intptr_t) data);
592 eo_do(obj, eo_key_data_del("test1")); 598 eo_key_data_del(obj, "test1");
593 eo_do(obj, data = eo_key_data_get("test1")); 599 data = eo_key_data_get(obj, "test1");
594 fail_if(data); 600 fail_if(data);
595 601
596 eo_do(obj, eo_key_data_set("test1", (void *) 1)); 602 eo_key_data_set(obj, "test1", (void *) 1);
597 eo_do(obj, eo_key_data_set("test2", (void *) 2)); 603 eo_key_data_set(obj, "test2", (void *) 2);
598 eo_do(obj, data = eo_key_data_get("test1")); 604 data = eo_key_data_get(obj, "test1");
599 fail_if(1 != (intptr_t) data); 605 fail_if(1 != (intptr_t) data);
600 eo_do(obj, data = eo_key_data_get("test2")); 606 data = eo_key_data_get(obj, "test2");
601 fail_if(2 != (intptr_t) data); 607 fail_if(2 != (intptr_t) data);
602 608
603 eo_do(obj, data = eo_key_data_get("test2")); 609 data = eo_key_data_get(obj, "test2");
604 fail_if(2 != (intptr_t) data); 610 fail_if(2 != (intptr_t) data);
605 eo_do(obj, eo_key_data_del("test2")); 611 eo_key_data_del(obj, "test2");
606 eo_do(obj, data = eo_key_data_get("test2")); 612 data = eo_key_data_get(obj, "test2");
607 fail_if(data); 613 fail_if(data);
608 614
609 eo_do(obj, data = eo_key_data_get("test1")); 615 data = eo_key_data_get(obj, "test1");
610 fail_if(1 != (intptr_t) data); 616 fail_if(1 != (intptr_t) data);
611 eo_do(obj, eo_key_data_del("test1")); 617 eo_key_data_del(obj, "test1");
612 eo_do(obj, data = eo_key_data_get("test1")); 618 data = eo_key_data_get(obj, "test1");
613 fail_if(data); 619 fail_if(data);
614 620
615 eo_unref(obj); 621 eo_unref(obj);
@@ -643,21 +649,22 @@ START_TEST(eo_magic_checks)
643 obj = eo_add(SIMPLE_CLASS, NULL); 649 obj = eo_add(SIMPLE_CLASS, NULL);
644 fail_if(!obj); 650 fail_if(!obj);
645 651
646 eo_do((Eo *) buf, simple_a_set(++i), a = simple_a_get()); 652 simple_a_set((Eo *) buf, ++i);
653 a = simple_a_get((Eo *) buf);
647 ck_assert_int_ne(i, a); 654 ck_assert_int_ne(i, a);
648 eo_do_super((Eo *) buf, SIMPLE_CLASS, simple_a_set(++i)); 655 simple_a_set(eo_super((Eo *) buf, SIMPLE_CLASS), ++i);
649 eo_do_super((Eo *) buf, SIMPLE_CLASS, a = simple_a_get()); 656 a = simple_a_get(eo_super((Eo *) buf, SIMPLE_CLASS));
650 ck_assert_int_ne(i, a); 657 ck_assert_int_ne(i, a);
651 eo_do_super(obj, (const Eo_Class *) buf, simple_a_set(++i)); 658 simple_a_set(eo_super(obj, (const Eo_Class *) buf), ++i);
652 eo_do_super(obj, (const Eo_Class *) buf, a = simple_a_get()); 659 a = simple_a_get(eo_super(obj, (const Eo_Class *) buf));
653 ck_assert_int_ne(i, a); 660 ck_assert_int_ne(i, a);
654 fail_if(eo_class_get((Eo *) buf)); 661 fail_if(eo_class_get((Eo *) buf));
655 fail_if(eo_class_name_get((Eo_Class*) buf)); 662 fail_if(eo_class_name_get((Eo_Class*) buf));
656 fail_if(eo_class_get(obj) != SIMPLE_CLASS); 663 fail_if(eo_class_get(obj) != SIMPLE_CLASS);
657 fail_if(eo_class_get(SIMPLE_CLASS) != EO_ABSTRACT_CLASS_CLASS); 664 fail_if(eo_class_get(SIMPLE_CLASS) != EO_ABSTRACT_CLASS_CLASS);
658 eo_do((Eo_Class *) buf, simple_a_set(1)); 665 simple_a_set((Eo_Class *) buf, 1);
659 eo_do_super((Eo_Class *) buf, SIMPLE_CLASS, simple_a_set(++i)); 666 simple_a_set(eo_super((Eo_Class *) buf, SIMPLE_CLASS), ++i);
660 eo_do_super(SIMPLE_CLASS, (Eo_Class *) buf, simple_a_set(++i)); 667 simple_a_set(eo_super(SIMPLE_CLASS, (Eo_Class *) buf), ++i);
661 fail_if(eo_class_new(NULL, (Eo_Class *) buf), NULL); 668 fail_if(eo_class_new(NULL, (Eo_Class *) buf), NULL);
662 669
663 eo_xref(obj, (Eo *) buf); 670 eo_xref(obj, (Eo *) buf);
@@ -674,28 +681,27 @@ START_TEST(eo_magic_checks)
674 681
675 fail_if(0 != eo_ref_get((Eo *) buf)); 682 fail_if(0 != eo_ref_get((Eo *) buf));
676 683
677 eo_do((Eo *) buf, 684 eo_wref_add((Eo *) buf, &wref);
678 eo_wref_add(&wref), 685 parent = eo_parent_get((Eo *) buf);
679 parent = eo_parent_get());
680 fail_if(wref); 686 fail_if(wref);
681 fail_if(parent); 687 fail_if(parent);
682 688
683 fail_if(eo_data_scope_get((Eo *) buf, SIMPLE_CLASS)); 689 fail_if(eo_data_scope_get((Eo *) buf, SIMPLE_CLASS));
684 690
685 eo_do(obj, eo_composite_attach((Eo *) buf)); 691 eo_composite_attach(obj, (Eo *) buf);
686 eo_do(obj, eo_composite_detach((Eo *) buf)); 692 eo_composite_detach(obj, (Eo *) buf);
687 eo_do((Eo *) buf, eo_composite_part_is()); 693 eo_composite_part_is((Eo *) buf);
688 694
689 eo_do(obj, eo_event_callback_forwarder_add(NULL, (Eo *) buf)); 695 eo_event_callback_forwarder_add(obj, NULL, (Eo *) buf);
690 eo_do(obj, eo_event_callback_forwarder_del(NULL, (Eo *) buf)); 696 eo_event_callback_forwarder_del(obj, NULL, (Eo *) buf);
691 697
692 eo_manual_free_set((Eo *) buf, EINA_TRUE); 698 eo_manual_free_set((Eo *) buf, EINA_TRUE);
693 eo_manual_free((Eo *) buf); 699 eo_manual_free((Eo *) buf);
694 eo_destructed_is((Eo *) buf); 700 eo_destructed_is((Eo *) buf);
695 701
696 obj2 = NULL; 702 obj2 = NULL;
697 eo_do(obj, eo_parent_set((Eo *) buf)); 703 eo_parent_set(obj, (Eo *) buf);
698 eo_do(obj, obj2 = eo_parent_get()); 704 obj2 = eo_parent_get(obj);
699 fail_if(obj2 && (obj2 == (Eo *) buf)); 705 fail_if(obj2 && (obj2 == (Eo *) buf));
700 706
701 eo_unref(obj); 707 eo_unref(obj);
@@ -761,11 +767,15 @@ START_TEST(eo_multiple_do)
761 Eina_Bool ca, cb, cc; 767 Eina_Bool ca, cb, cc;
762 768
763 ca = cb = cc = EINA_FALSE; 769 ca = cb = cc = EINA_FALSE;
764 eo_do(obj, ca = simple_a_print(), cb = multi_a_print(), cc = multi_a_print()); 770 ca = simple_a_print(obj);
771 cb = multi_a_print(obj);
772 cc = multi_a_print(obj);
765 fail_if(!(ca && cb && cc)); 773 fail_if(!(ca && cb && cc));
766 774
767 ca = cb = cc = EINA_FALSE; 775 ca = cb = cc = EINA_FALSE;
768 eo_do(klass, ca = simple_class_hi_print(), cb = multi_class_hi_print(), cc = multi_class_hi_print()); 776 ca = simple_class_hi_print(klass);
777 cb = multi_class_hi_print(klass);
778 cc = multi_class_hi_print(klass);
769 fail_if(!(ca && cb && cc)); 779 fail_if(!(ca && cb && cc));
770 780
771 eo_unref(obj); 781 eo_unref(obj);
@@ -780,27 +790,27 @@ START_TEST(eo_add_do_and_custom)
780 Eo *obj = NULL; 790 Eo *obj = NULL;
781 eo_init(); 791 eo_init();
782 792
783 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor()); 793 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor(eoid));
784 fail_if(!obj); 794 fail_if(!obj);
785 eo_unref(obj); 795 eo_unref(obj);
786 796
787 obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(7)); 797 obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(eoid, 7));
788 fail_if(!obj); 798 fail_if(!obj);
789 pd = eo_data_scope_get(obj, SIMPLE_CLASS); 799 pd = eo_data_scope_get(obj, SIMPLE_CLASS);
790 fail_if(pd->a != 7); 800 fail_if(pd->a != 7);
791 eo_unref(obj); 801 eo_unref(obj);
792 802
793 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor(), simple_a_set(7)); 803 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor(eoid), simple_a_set(eoid, 7));
794 fail_if(!obj); 804 fail_if(!obj);
795 pd = eo_data_scope_get(obj, SIMPLE_CLASS); 805 pd = eo_data_scope_get(obj, SIMPLE_CLASS);
796 fail_if(pd->a != 7); 806 fail_if(pd->a != 7);
797 eo_unref(obj); 807 eo_unref(obj);
798 808
799 Eina_Bool finalized; 809 Eina_Bool finalized;
800 obj = eo_add(SIMPLE_CLASS, NULL, finalized = eo_finalized_get()); 810 obj = eo_add(SIMPLE_CLASS, NULL, finalized = eo_finalized_get(eoid));
801 fail_if(finalized); 811 fail_if(finalized);
802 812
803 eo_do(obj, finalized = eo_finalized_get()); 813 finalized = eo_finalized_get(obj);
804 fail_if(!finalized); 814 fail_if(!finalized);
805 eo_unref(obj); 815 eo_unref(obj);
806 816
@@ -940,7 +950,8 @@ START_TEST(eo_parts)
940 950
941 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 951 Eo *obj = eo_add(SIMPLE_CLASS, NULL);
942 952
943 eo_do(obj, simple_a_set(3), a = simple_a_get()); 953 simple_a_set(obj, 3);
954 a = simple_a_get(obj);
944 ck_assert_int_eq(a, 3); 955 ck_assert_int_eq(a, 3);
945 956
946 eo_do_part(obj, simple_part_get("test"), 957 eo_do_part(obj, simple_part_get("test"),
@@ -949,7 +960,8 @@ START_TEST(eo_parts)
949 ); 960 );
950 ck_assert_int_eq(a, 7); 961 ck_assert_int_eq(a, 7);
951 962
952 eo_do(obj, simple_a_set(3), a = simple_a_get()); 963 simple_a_set(obj, 3);
964 a = simple_a_get(obj);
953 ck_assert_int_eq(a, 3); 965 ck_assert_int_eq(a, 3);
954 966
955 /* Faking a call, just asserting NULL as the part to check default values. */ 967 /* Faking a call, just asserting NULL as the part to check default values. */