summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-09 15:39:51 +0000
committerTom Hacohen <tom@stosb.com>2016-03-09 16:09:14 +0000
commitdf83edaeb6b10324868f28e8f1910147ba22e5e5 (patch)
tree4fb7590b244c86cd66c41bff04571bd4d4694d35
parent6ac1fb78d855be27d28378a659887b693e5fb266 (diff)
Ector and eo suite: Semi automatically migrate to the new eo_add.
There were some issues with the migration that required manual intervention.
-rw-r--r--src/lib/ector/cairo/ector_cairo_surface.c7
-rw-r--r--src/lib/ector/gl/ector_gl_surface.c7
-rw-r--r--src/lib/ector/software/ector_software_surface.c9
-rw-r--r--src/tests/eo/suite/eo_test_general.c129
4 files changed, 88 insertions, 64 deletions
diff --git a/src/lib/ector/cairo/ector_cairo_surface.c b/src/lib/ector/cairo/ector_cairo_surface.c
index 3cc47e3460..93336db508 100644
--- a/src/lib/ector/cairo/ector_cairo_surface.c
+++ b/src/lib/ector/cairo/ector_cairo_surface.c
@@ -61,12 +61,13 @@ _ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
61 Ector_Cairo_Surface_Data *pd EINA_UNUSED, 61 Ector_Cairo_Surface_Data *pd EINA_UNUSED,
62 const Eo_Class *type) 62 const Eo_Class *type)
63{ 63{
64 Eo *ret = NULL;
64 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN) 65 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
65 return eo_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 66 return eo_add(&ret, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL, ector_renderer_surface_set(ret, obj));
66 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN) 67 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
67 return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 68 return eo_add(&ret, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(ret, obj));
68 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN) 69 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
69 return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 70 return eo_add(&ret, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(ret, obj));
70 71
71 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type)); 72 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type));
72 return NULL; 73 return NULL;
diff --git a/src/lib/ector/gl/ector_gl_surface.c b/src/lib/ector/gl/ector_gl_surface.c
index 2ad665306b..fe3658c468 100644
--- a/src/lib/ector/gl/ector_gl_surface.c
+++ b/src/lib/ector/gl/ector_gl_surface.c
@@ -44,12 +44,13 @@ _ector_gl_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
44 Ector_GL_Surface_Data *pd EINA_UNUSED, 44 Ector_GL_Surface_Data *pd EINA_UNUSED,
45 const Eo_Class *type) 45 const Eo_Class *type)
46{ 46{
47 Eo *ret = NULL;
47 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN) 48 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
48 return eo_add(ECTOR_RENDERER_GL_SHAPE_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 49 return eo_add(&ret, ECTOR_RENDERER_GL_SHAPE_CLASS, NULL, ector_renderer_surface_set(ret, obj));
49 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN) 50 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
50 return eo_add(ECTOR_RENDERER_GL_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 51 return eo_add(&ret, ECTOR_RENDERER_GL_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(ret, obj));
51 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN) 52 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
52 return eo_add(ECTOR_RENDERER_GL_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 53 return eo_add(&ret, ECTOR_RENDERER_GL_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(ret, obj));
53 54
54 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type)); 55 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type));
55 return NULL; 56 return NULL;
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index f67b1947d2..551211fe8c 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -15,14 +15,15 @@ _ector_software_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
15 Ector_Software_Surface_Data *pd EINA_UNUSED, 15 Ector_Software_Surface_Data *pd EINA_UNUSED,
16 const Eo_Class *type) 16 const Eo_Class *type)
17{ 17{
18 Eo *ret = NULL;
18 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN) 19 if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
19 return eo_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 20 return eo_add(&ret, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(ret, obj));
20 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN) 21 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
21 return eo_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 22 return eo_add(&ret, ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(ret, obj));
22 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN) 23 else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
23 return eo_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 24 return eo_add(&ret, ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(ret, obj));
24 else if (type == ECTOR_RENDERER_GENERIC_BUFFER_MIXIN) 25 else if (type == ECTOR_RENDERER_GENERIC_BUFFER_MIXIN)
25 return eo_add(ECTOR_RENDERER_SOFTWARE_BUFFER_CLASS, NULL, ector_renderer_surface_set(eoid, obj)); 26 return eo_add(&ret, ECTOR_RENDERER_SOFTWARE_BUFFER_CLASS, NULL, ector_renderer_surface_set(ret, obj));
26 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type)); 27 ERR("Couldn't find class for type: %s\n", eo_class_name_get(type));
27 return NULL; 28 return NULL;
28} 29}
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 2960902715..bebf5c7e67 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -17,10 +17,11 @@
17START_TEST(eo_simple) 17START_TEST(eo_simple)
18{ 18{
19 eo_init(); 19 eo_init();
20 Eo *obj = eo_add(EO_CLASS, NULL); 20 Eo *obj = NULL;
21 eo_add(&obj, EO_CLASS, NULL);
21 fail_if(obj); 22 fail_if(obj);
22 23
23 obj = eo_add(SIMPLE_CLASS, NULL); 24 eo_add(&obj, SIMPLE_CLASS, NULL);
24 fail_if(!obj); 25 fail_if(!obj);
25 eo_constructor(obj); 26 eo_constructor(obj);
26 eo_destructor(obj); 27 eo_destructor(obj);
@@ -33,7 +34,8 @@ END_TEST
33START_TEST(eo_stack) 34START_TEST(eo_stack)
34{ 35{
35 eo_init(); 36 eo_init();
36 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 37 Eo *obj = NULL;
38 eo_add(&obj, SIMPLE_CLASS, NULL);
37 fail_if(!obj); 39 fail_if(!obj);
38 40
39 simple_recursive(obj, 123); 41 simple_recursive(obj, 123);
@@ -100,7 +102,8 @@ START_TEST(eo_signals)
100 { EO_BASE_EVENT_DEL, _eo_signals_eo_del_cb }, 102 { EO_BASE_EVENT_DEL, _eo_signals_eo_del_cb },
101 { NULL, NULL } 103 { NULL, NULL }
102 }; 104 };
103 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 105 Eo *obj = NULL;
106 eo_add(&obj, SIMPLE_CLASS, NULL);
104 Eina_Bool r; 107 Eina_Bool r;
105 108
106 eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_ADD, _eo_signals_cb_added_deled, callbacks); 109 eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_ADD, _eo_signals_cb_added_deled, callbacks);
@@ -129,7 +132,7 @@ START_TEST(eo_signals)
129 132
130 eo_unref(obj); 133 eo_unref(obj);
131 134
132 obj = eo_add(SIMPLE_CLASS, NULL); 135 eo_add(&obj, SIMPLE_CLASS, NULL);
133 /* Legacy support signals. */ 136 /* Legacy support signals. */
134 { 137 {
135 const Eo_Event_Description *a_desc = eo_base_legacy_only_event_description_get("a,changed"); 138 const Eo_Event_Description *a_desc = eo_base_legacy_only_event_description_get("a,changed");
@@ -190,7 +193,8 @@ START_TEST(eo_data_fetch)
190 const Eo_Class *klass = eo_class_new(&class_desc, EO_CLASS, NULL); 193 const Eo_Class *klass = eo_class_new(&class_desc, EO_CLASS, NULL);
191 fail_if(!klass); 194 fail_if(!klass);
192 195
193 Eo *obj = eo_add(klass, NULL); 196 Eo *obj = NULL;
197 eo_add(&obj, klass, NULL);
194 fail_if(!obj); 198 fail_if(!obj);
195#ifdef EO_DEBUG 199#ifdef EO_DEBUG
196 fail_if(eo_data_scope_get(obj, SIMPLE_CLASS)); 200 fail_if(eo_data_scope_get(obj, SIMPLE_CLASS));
@@ -201,7 +205,7 @@ START_TEST(eo_data_fetch)
201 klass = eo_class_new(&class_desc, EO_CLASS, NULL); 205 klass = eo_class_new(&class_desc, EO_CLASS, NULL);
202 fail_if(!klass); 206 fail_if(!klass);
203 207
204 obj = eo_add(klass, NULL); 208 eo_add(&obj, klass, NULL);
205 fail_if(!obj); 209 fail_if(!obj);
206 fail_if(eo_data_scope_get(obj, klass)); 210 fail_if(eo_data_scope_get(obj, klass));
207 fail_if(!eo_data_scope_get(obj, EO_BASE_CLASS)); 211 fail_if(!eo_data_scope_get(obj, EO_BASE_CLASS));
@@ -268,7 +272,8 @@ START_TEST(eo_isa_tests)
268 fail_if(!klass); 272 fail_if(!klass);
269 } 273 }
270 274
271 Eo *obj = eo_add(klass, NULL); 275 Eo *obj = NULL;
276 eo_add(&obj, klass, NULL);
272 fail_if(!obj); 277 fail_if(!obj);
273 fail_if(eo_isa(obj, SIMPLE_CLASS)); 278 fail_if(eo_isa(obj, SIMPLE_CLASS));
274 fail_if(!eo_isa(obj, iface)); 279 fail_if(!eo_isa(obj, iface));
@@ -277,7 +282,7 @@ START_TEST(eo_isa_tests)
277 fail_if(!eo_isa(obj, EO_CLASS)); 282 fail_if(!eo_isa(obj, EO_CLASS));
278 eo_unref(obj); 283 eo_unref(obj);
279 284
280 obj = eo_add(SIMPLE_CLASS, NULL); 285 eo_add(&obj, SIMPLE_CLASS, NULL);
281 fail_if(!obj); 286 fail_if(!obj);
282 fail_if(eo_isa(obj, klass)); 287 fail_if(eo_isa(obj, klass));
283 fail_if(eo_isa(obj, iface)); 288 fail_if(eo_isa(obj, iface));
@@ -295,9 +300,11 @@ START_TEST(eo_composite_tests)
295{ 300{
296 eo_init(); 301 eo_init();
297 302
298 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 303 Eo *obj = NULL;
304 eo_add(&obj, SIMPLE_CLASS, NULL);
299 fail_if(!obj); 305 fail_if(!obj);
300 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 306 Eo *obj2 = NULL;
307 eo_add(&obj2, SIMPLE_CLASS, NULL);
301 fail_if(!obj2); 308 fail_if(!obj2);
302 309
303 eo_composite_attach(obj, obj2); 310 eo_composite_attach(obj, obj2);
@@ -356,11 +363,12 @@ START_TEST(eo_man_free)
356 fail_if(!klass); 363 fail_if(!klass);
357 cur_klass = klass; 364 cur_klass = klass;
358 365
359 Eo *obj = eo_add(klass, NULL); 366 Eo *obj = NULL;
367 eo_add(&obj, klass, NULL);
360 fail_if(!obj); 368 fail_if(!obj);
361 eo_unref(obj); 369 eo_unref(obj);
362 370
363 obj = eo_add(klass, NULL); 371 eo_add(&obj, klass, NULL);
364 fail_if(!obj); 372 fail_if(!obj);
365 fail_if(eo_manual_free(obj)); 373 fail_if(eo_manual_free(obj));
366 eo_unref(obj); 374 eo_unref(obj);
@@ -370,7 +378,7 @@ START_TEST(eo_man_free)
370 cur_klass = klass; 378 cur_klass = klass;
371 fail_if(!klass); 379 fail_if(!klass);
372 380
373 obj = eo_add(klass, NULL); 381 eo_add(&obj, klass, NULL);
374 fail_if(!obj); 382 fail_if(!obj);
375 fail_if(eo_manual_free(obj)); 383 fail_if(eo_manual_free(obj));
376 fail_if(eo_destructed_is(obj)); 384 fail_if(eo_destructed_is(obj));
@@ -378,7 +386,7 @@ START_TEST(eo_man_free)
378 fail_if(!eo_destructed_is(obj)); 386 fail_if(!eo_destructed_is(obj));
379 fail_if(!eo_manual_free(obj)); 387 fail_if(!eo_manual_free(obj));
380 388
381 obj = eo_add(klass, NULL); 389 eo_add(&obj, klass, NULL);
382 fail_if(!obj); 390 fail_if(!obj);
383 eo_unref(obj); 391 eo_unref(obj);
384 fail_if(!eo_destructed_is(obj)); 392 fail_if(!eo_destructed_is(obj));
@@ -389,12 +397,12 @@ START_TEST(eo_man_free)
389 cur_klass = klass; 397 cur_klass = klass;
390 fail_if(!klass); 398 fail_if(!klass);
391 399
392 obj = eo_add(klass, NULL); 400 eo_add(&obj, klass, NULL);
393 fail_if(!obj); 401 fail_if(!obj);
394 fail_if(eo_manual_free(obj)); 402 fail_if(eo_manual_free(obj));
395 eo_unref(obj); 403 eo_unref(obj);
396 404
397 obj = eo_add(klass, NULL); 405 eo_add(&obj, klass, NULL);
398 fail_if(!obj); 406 fail_if(!obj);
399 eo_manual_free_set(obj, EINA_TRUE); 407 eo_manual_free_set(obj, EINA_TRUE);
400 eo_unref(obj); 408 eo_unref(obj);
@@ -403,7 +411,7 @@ START_TEST(eo_man_free)
403 eo_unref(obj); 411 eo_unref(obj);
404 fail_if(!eo_manual_free(obj)); 412 fail_if(!eo_manual_free(obj));
405 413
406 obj = eo_add(klass, NULL); 414 eo_add(&obj, klass, NULL);
407 fail_if(!obj); 415 fail_if(!obj);
408 eo_manual_free_set(obj, EINA_TRUE); 416 eo_manual_free_set(obj, EINA_TRUE);
409 eo_unref(obj); 417 eo_unref(obj);
@@ -421,9 +429,12 @@ END_TEST
421START_TEST(eo_refs) 429START_TEST(eo_refs)
422{ 430{
423 eo_init(); 431 eo_init();
424 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 432 Eo *obj = NULL;
425 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 433 eo_add(&obj, SIMPLE_CLASS, NULL);
426 Eo *obj3 = eo_add(SIMPLE_CLASS, NULL); 434 Eo *obj2 = NULL;
435 eo_add(&obj2, SIMPLE_CLASS, NULL);
436 Eo *obj3 = NULL;
437 eo_add(&obj3, SIMPLE_CLASS, NULL);
427 438
428 eo_xref(obj, obj2); 439 eo_xref(obj, obj2);
429 fail_if(eo_ref_get(obj) != 2); 440 fail_if(eo_ref_get(obj) != 2);
@@ -458,8 +469,8 @@ START_TEST(eo_refs)
458 eo_unref(obj3); 469 eo_unref(obj3);
459 470
460 /* Check hierarchy */ 471 /* Check hierarchy */
461 obj = eo_add(SIMPLE_CLASS, NULL); 472 eo_add(&obj, SIMPLE_CLASS, NULL);
462 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj)); 473 eo_ref(eo_add(&obj2, SIMPLE_CLASS, obj));
463 474
464 Eo *wref = NULL; 475 Eo *wref = NULL;
465 eo_wref_add(obj2, &wref); 476 eo_wref_add(obj2, &wref);
@@ -474,18 +485,18 @@ START_TEST(eo_refs)
474 fail_if(wref); 485 fail_if(wref);
475 486
476 /* eo_add_ref and normal eo_add */ 487 /* eo_add_ref and normal eo_add */
477 obj = eo_add(SIMPLE_CLASS, NULL); 488 eo_add(&obj, SIMPLE_CLASS, NULL);
478 obj2 = eo_add(SIMPLE_CLASS, obj); 489 eo_add(&obj2, SIMPLE_CLASS, obj);
479 obj3 = eo_add_ref(SIMPLE_CLASS, obj); 490 eo_add_ref(&obj3, SIMPLE_CLASS, obj);
480 491
481 ck_assert_int_eq(eo_ref_get(obj), 1); 492 ck_assert_int_eq(eo_ref_get(obj), 1);
482 ck_assert_int_eq(eo_ref_get(obj2), 1); 493 ck_assert_int_eq(eo_ref_get(obj2), 1);
483 ck_assert_int_eq(eo_ref_get(obj3), 2); 494 ck_assert_int_eq(eo_ref_get(obj3), 2);
484 495
485 /* Setting and removing parents. */ 496 /* Setting and removing parents. */
486 obj = eo_add(SIMPLE_CLASS, NULL); 497 eo_add(&obj, SIMPLE_CLASS, NULL);
487 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj)); 498 eo_ref(eo_add(&obj2, SIMPLE_CLASS, obj));
488 obj3 = eo_ref(eo_add(SIMPLE_CLASS, NULL)); 499 eo_ref(eo_add(&obj3, SIMPLE_CLASS, NULL));
489 500
490 eo_parent_set(obj2, obj3); 501 eo_parent_set(obj2, obj3);
491 eo_parent_set(obj3, obj); 502 eo_parent_set(obj3, obj);
@@ -507,13 +518,13 @@ START_TEST(eo_refs)
507 eo_del(obj3); 518 eo_del(obj3);
508 519
509 /* Just check it doesn't seg atm. */ 520 /* Just check it doesn't seg atm. */
510 obj = eo_add(SIMPLE_CLASS, NULL); 521 eo_add(&obj, SIMPLE_CLASS, NULL);
511 eo_ref(obj); 522 eo_ref(obj);
512 eo_unref(obj); 523 eo_unref(obj);
513 eo_unref(obj); 524 eo_unref(obj);
514 525
515 obj = eo_add(SIMPLE_CLASS, NULL); 526 eo_add(&obj, SIMPLE_CLASS, NULL);
516 obj2 = eo_add(SIMPLE_CLASS, obj); 527 eo_add(&obj2, SIMPLE_CLASS, obj);
517 eo_unref(obj2); 528 eo_unref(obj2);
518 eo_ref(obj2); 529 eo_ref(obj2);
519 eo_del(obj2); 530 eo_del(obj2);
@@ -527,8 +538,10 @@ START_TEST(eo_weak_reference)
527{ 538{
528 eo_init(); 539 eo_init();
529 540
530 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 541 Eo *obj = NULL;
531 Eo *obj2 = eo_add(SIMPLE_CLASS, NULL); 542 eo_add(&obj, SIMPLE_CLASS, NULL);
543 Eo *obj2 = NULL;
544 eo_add(&obj2, SIMPLE_CLASS, NULL);
532 Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL; 545 Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL;
533 eo_wref_add(obj, &wref); 546 eo_wref_add(obj, &wref);
534 fail_if(!wref); 547 fail_if(!wref);
@@ -536,7 +549,7 @@ START_TEST(eo_weak_reference)
536 eo_unref(obj); 549 eo_unref(obj);
537 fail_if(wref); 550 fail_if(wref);
538 551
539 obj = eo_add(SIMPLE_CLASS, NULL); 552 eo_add(&obj, SIMPLE_CLASS, NULL);
540 eo_wref_add(obj, &wref); 553 eo_wref_add(obj, &wref);
541 554
542 eo_ref(obj); 555 eo_ref(obj);
@@ -548,7 +561,7 @@ START_TEST(eo_weak_reference)
548 eo_unref(obj); 561 eo_unref(obj);
549 fail_if(wref); 562 fail_if(wref);
550 563
551 obj = eo_add(SIMPLE_CLASS, NULL); 564 eo_add(&obj, SIMPLE_CLASS, NULL);
552 565
553 eo_wref_add(obj, &wref); 566 eo_wref_add(obj, &wref);
554 eo_wref_del(obj, &wref); 567 eo_wref_del(obj, &wref);
@@ -597,7 +610,8 @@ END_TEST
597START_TEST(eo_generic_data) 610START_TEST(eo_generic_data)
598{ 611{
599 eo_init(); 612 eo_init();
600 Eo *obj = eo_add(SIMPLE_CLASS, NULL); 613 Eo *obj = NULL;
614 eo_add(&obj, SIMPLE_CLASS, NULL);
601 void *data = NULL; 615 void *data = NULL;
602 616
603 eo_key_data_set(obj, "test1", (void *) 1); 617 eo_key_data_set(obj, "test1", (void *) 1);
@@ -641,7 +655,8 @@ START_TEST(eo_magic_checks)
641 655
642 memset(_buf, 1, sizeof(_buf)); 656 memset(_buf, 1, sizeof(_buf));
643 657
644 Eo *obj = eo_add(SIMPLE_CLASS, (Eo *) buf); 658 Eo *obj = NULL;
659 eo_add(&obj, SIMPLE_CLASS, (Eo *) buf);
645 fail_if(obj); 660 fail_if(obj);
646 661
647 while (1) 662 while (1)
@@ -651,10 +666,10 @@ START_TEST(eo_magic_checks)
651 Eo *wref = NULL; 666 Eo *wref = NULL;
652 Eo *obj2 = NULL; 667 Eo *obj2 = NULL;
653 668
654 obj = eo_add((Eo_Class *) buf, NULL); 669 eo_add(&obj, (Eo_Class *) buf, NULL);
655 fail_if(obj); 670 fail_if(obj);
656 671
657 obj = eo_add(SIMPLE_CLASS, NULL); 672 eo_add(&obj, SIMPLE_CLASS, NULL);
658 fail_if(!obj); 673 fail_if(!obj);
659 674
660 simple_a_set((Eo *) buf, ++i); 675 simple_a_set((Eo *) buf, ++i);
@@ -769,7 +784,8 @@ START_TEST(eo_multiple_do)
769 const Eo_Class *klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL); 784 const Eo_Class *klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL);
770 fail_if(!klass); 785 fail_if(!klass);
771 786
772 Eo *obj = eo_add(klass, NULL); 787 Eo *obj = NULL;
788 eo_add(&obj, klass, NULL);
773 fail_if(!obj); 789 fail_if(!obj);
774 790
775 Eina_Bool ca, cb, cc; 791 Eina_Bool ca, cb, cc;
@@ -798,24 +814,24 @@ START_TEST(eo_add_do_and_custom)
798 Eo *obj = NULL; 814 Eo *obj = NULL;
799 eo_init(); 815 eo_init();
800 816
801 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor(eoid)); 817 eo_add(&obj, SIMPLE_CLASS, NULL, eo_constructor(obj));
802 fail_if(!obj); 818 fail_if(!obj);
803 eo_unref(obj); 819 eo_unref(obj);
804 820
805 obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(eoid, 7)); 821 eo_add(&obj, SIMPLE_CLASS, NULL, simple_a_set(obj, 7));
806 fail_if(!obj); 822 fail_if(!obj);
807 pd = eo_data_scope_get(obj, SIMPLE_CLASS); 823 pd = eo_data_scope_get(obj, SIMPLE_CLASS);
808 fail_if(pd->a != 7); 824 fail_if(pd->a != 7);
809 eo_unref(obj); 825 eo_unref(obj);
810 826
811 obj = eo_add(SIMPLE_CLASS, NULL, eo_constructor(eoid), simple_a_set(eoid, 7)); 827 eo_add(&obj, SIMPLE_CLASS, NULL, eo_constructor(obj), simple_a_set(obj, 7));
812 fail_if(!obj); 828 fail_if(!obj);
813 pd = eo_data_scope_get(obj, SIMPLE_CLASS); 829 pd = eo_data_scope_get(obj, SIMPLE_CLASS);
814 fail_if(pd->a != 7); 830 fail_if(pd->a != 7);
815 eo_unref(obj); 831 eo_unref(obj);
816 832
817 Eina_Bool finalized; 833 Eina_Bool finalized;
818 obj = eo_add(SIMPLE_CLASS, NULL, finalized = eo_finalized_get(eoid)); 834 eo_add(&obj, SIMPLE_CLASS, NULL, finalized = eo_finalized_get(obj));
819 fail_if(finalized); 835 fail_if(finalized);
820 836
821 finalized = eo_finalized_get(obj); 837 finalized = eo_finalized_get(obj);
@@ -846,7 +862,8 @@ START_TEST(eo_pointers_indirection)
846 fail_if(!klass); 862 fail_if(!klass);
847 863
848 /* Check simple id validity */ 864 /* Check simple id validity */
849 Eo *obj = eo_add(klass, NULL); 865 Eo *obj = NULL;
866 eo_add(&obj, klass, NULL);
850 fail_if(!obj); 867 fail_if(!obj);
851 fail_if(!eo_isa(obj, klass)); 868 fail_if(!eo_isa(obj, klass));
852 obj = (Eo *)((char *)(obj) + 1); 869 obj = (Eo *)((char *)(obj) + 1);
@@ -857,17 +874,19 @@ START_TEST(eo_pointers_indirection)
857 fail_if(eo_isa(obj, klass)); 874 fail_if(eo_isa(obj, klass));
858 875
859 /* Check id invalidity after deletion */ 876 /* Check id invalidity after deletion */
860 Eo *obj1 = eo_add(klass, NULL); 877 Eo *obj1 = NULL;
878 eo_add(&obj1, klass, NULL);
861 fail_if(!obj1); 879 fail_if(!obj1);
862 eo_unref(obj1); 880 eo_unref(obj1);
863 Eo *obj2 = eo_add(klass, NULL); 881 Eo *obj2 = NULL;
882 eo_add(&obj2, klass, NULL);
864 fail_if(!obj2); 883 fail_if(!obj2);
865 fail_if(!eo_isa(obj2, klass)); 884 fail_if(!eo_isa(obj2, klass));
866 fail_if(eo_isa(obj1, klass)); 885 fail_if(eo_isa(obj1, klass));
867 eo_unref(obj2); 886 eo_unref(obj2);
868 887
869 /* Check id sanity checks for "close enough" ids. */ 888 /* Check id sanity checks for "close enough" ids. */
870 obj1 = eo_add(klass, NULL); 889 eo_add(&obj1, klass, NULL);
871 fail_if(!obj1); 890 fail_if(!obj1);
872 obj2 = (Eo *) (((Eo_Id) obj1) & ~MASK_OBJ_TAG); 891 obj2 = (Eo *) (((Eo_Id) obj1) & ~MASK_OBJ_TAG);
873 fail_if(eo_class_get(obj2)); 892 fail_if(eo_class_get(obj2));
@@ -880,7 +899,7 @@ START_TEST(eo_pointers_indirection)
880 /* Creation of the objects */ 899 /* Creation of the objects */
881 for ( obj_id = 0; obj_id < NB_OBJS; obj_id++) 900 for ( obj_id = 0; obj_id < NB_OBJS; obj_id++)
882 { 901 {
883 objs[obj_id] = eo_add(klass, NULL); 902 eo_add(&objs[obj_id], klass, NULL);
884 if(!objs[obj_id]) 903 if(!objs[obj_id])
885 fail_if(!objs[obj_id]); 904 fail_if(!objs[obj_id]);
886 if(!eo_isa(objs[obj_id], klass)) 905 if(!eo_isa(objs[obj_id], klass))
@@ -896,7 +915,7 @@ START_TEST(eo_pointers_indirection)
896 /* Creation of the deleted objects */ 915 /* Creation of the deleted objects */
897 for ( obj_id = 0; obj_id < NB_OBJS; obj_id+=2000) 916 for ( obj_id = 0; obj_id < NB_OBJS; obj_id+=2000)
898 { 917 {
899 objs[obj_id] = eo_add(klass, NULL); 918 eo_add(&objs[obj_id], klass, NULL);
900 if(!objs[obj_id]) 919 if(!objs[obj_id])
901 fail_if(!objs[obj_id]); 920 fail_if(!objs[obj_id]);
902 if(!eo_isa(objs[obj_id], klass)) 921 if(!eo_isa(objs[obj_id], klass))
@@ -942,7 +961,8 @@ START_TEST(eo_add_failures)
942 961
943 const Eo_Class *klass = eo_class_new(&class_desc, EO_CLASS, NULL); 962 const Eo_Class *klass = eo_class_new(&class_desc, EO_CLASS, NULL);
944 963
945 Eo *obj = eo_add(klass, NULL); 964 Eo *obj = NULL;
965 eo_add(&obj, klass, NULL);
946 966
947 fail_if(obj); 967 fail_if(obj);
948 968
@@ -981,7 +1001,8 @@ START_TEST(eo_del_intercept)
981 1001
982 /* Check unref interception */ 1002 /* Check unref interception */
983 intercepted = EINA_FALSE; 1003 intercepted = EINA_FALSE;
984 Eo *obj = eo_add(klass, NULL); 1004 Eo *obj = NULL;
1005 eo_add(&obj, klass, NULL);
985 fail_if(!obj); 1006 fail_if(!obj);
986 fail_if(!eo_isa(obj, klass)); 1007 fail_if(!eo_isa(obj, klass));
987 eo_del_intercept_set(obj, _del_intercept); 1008 eo_del_intercept_set(obj, _del_intercept);
@@ -991,7 +1012,7 @@ START_TEST(eo_del_intercept)
991 1012
992 /* Check del interception */ 1013 /* Check del interception */
993 intercepted = EINA_FALSE; 1014 intercepted = EINA_FALSE;
994 obj = eo_add(klass, NULL); 1015 eo_add(&obj, klass, NULL);
995 fail_if(!obj); 1016 fail_if(!obj);
996 fail_if(!eo_isa(obj, klass)); 1017 fail_if(!eo_isa(obj, klass));
997 eo_del_intercept_set(obj, _del_intercept); 1018 eo_del_intercept_set(obj, _del_intercept);