summaryrefslogtreecommitdiff
path: root/src/tests/eolian/eolian_parsing.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-10 14:28:19 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-10 14:28:19 +0100
commit33c147f6d42d4377b0ea368101071d4e1db25cac (patch)
tree6df346205126b0b44a2a1c807f1b56c7c2a7c779 /src/tests/eolian/eolian_parsing.c
parent93eadd76d6d49bbe1e49eaf976b4c6fd5545f340 (diff)
eolian: remove the unnecessary subtypes API
Inner type can now be retrieved as a base type of the type. If the type has two inner types or more, there is a new API that allows you to get the second inner type by calling it on the first one (same would apply to getting third via second etc.). This API is simpler to use and doesn't require an iterator.
Diffstat (limited to '')
-rw-r--r--src/tests/eolian/eolian_parsing.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 33befe1890..02232f3045 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -388,13 +388,12 @@ START_TEST(eolian_typedef)
388 fail_if(!eolian_type_is_own(type)); 388 fail_if(!eolian_type_is_own(type));
389 fail_if(strcmp(type_name, "Eina_List *")); 389 fail_if(strcmp(type_name, "Eina_List *"));
390 eina_stringshare_del(type_name); 390 eina_stringshare_del(type_name);
391 fail_if(!(iter = eolian_type_subtypes_get(type))); 391 fail_if(!(type = eolian_type_base_type_get(type)));
392 fail_if(!eina_iterator_next(iter, (void**)&type)); 392 fail_if(!!eolian_type_next_type_get(type));
393 fail_if(!(type_name = eolian_type_c_type_get(type))); 393 fail_if(!(type_name = eolian_type_c_type_get(type)));
394 fail_if(strcmp(type_name, "Eo *")); 394 fail_if(strcmp(type_name, "Eo *"));
395 fail_if(eolian_type_is_own(type)); 395 fail_if(eolian_type_is_own(type));
396 eina_stringshare_del(type_name); 396 eina_stringshare_del(type_name);
397 eina_iterator_free(iter);
398 397
399 /* List */ 398 /* List */
400 fail_if(!(iter = eolian_typedecl_aliases_get_by_file("typedef.eo"))); 399 fail_if(!(iter = eolian_typedecl_aliases_get_by_file("typedef.eo")));
@@ -441,20 +440,18 @@ START_TEST(eolian_complex_type)
441 fail_if(!eolian_type_is_own(type)); 440 fail_if(!eolian_type_is_own(type));
442 fail_if(strcmp(type_name, "Eina_List *")); 441 fail_if(strcmp(type_name, "Eina_List *"));
443 eina_stringshare_del(type_name); 442 eina_stringshare_del(type_name);
444 fail_if(!(iter = eolian_type_subtypes_get(type))); 443 fail_if(!(type = eolian_type_base_type_get(type)));
445 fail_if(!eina_iterator_next(iter, (void**)&type)); 444 fail_if(!!eolian_type_next_type_get(type));
446 fail_if(!(type_name = eolian_type_c_type_get(type))); 445 fail_if(!(type_name = eolian_type_c_type_get(type)));
447 fail_if(eolian_type_is_own(type)); 446 fail_if(eolian_type_is_own(type));
448 fail_if(strcmp(type_name, "Eina_Array *")); 447 fail_if(strcmp(type_name, "Eina_Array *"));
449 eina_stringshare_del(type_name); 448 eina_stringshare_del(type_name);
450 eina_iterator_free(iter); 449 fail_if(!(type = eolian_type_base_type_get(type)));
451 fail_if(!(iter = eolian_type_subtypes_get(type))); 450 fail_if(!!eolian_type_next_type_get(type));
452 fail_if(!eina_iterator_next(iter, (void**)&type));
453 fail_if(!(type_name = eolian_type_c_type_get(type))); 451 fail_if(!(type_name = eolian_type_c_type_get(type)));
454 fail_if(!eolian_type_is_own(type)); 452 fail_if(!eolian_type_is_own(type));
455 fail_if(strcmp(type_name, "Eo **")); 453 fail_if(strcmp(type_name, "Eo **"));
456 eina_stringshare_del(type_name); 454 eina_stringshare_del(type_name);
457 eina_iterator_free(iter);
458 /* Properties parameter type */ 455 /* Properties parameter type */
459 fail_if(!(iter = eolian_property_values_get(fid, EOLIAN_PROP_GET))); 456 fail_if(!(iter = eolian_property_values_get(fid, EOLIAN_PROP_GET)));
460 fail_if(!(eina_iterator_next(iter, (void**)&param))); 457 fail_if(!(eina_iterator_next(iter, (void**)&param)));
@@ -466,13 +463,12 @@ START_TEST(eolian_complex_type)
466 fail_if(!eolian_type_is_own(type)); 463 fail_if(!eolian_type_is_own(type));
467 fail_if(strcmp(type_name, "Eina_List *")); 464 fail_if(strcmp(type_name, "Eina_List *"));
468 eina_stringshare_del(type_name); 465 eina_stringshare_del(type_name);
469 fail_if(!(iter = eolian_type_subtypes_get(type))); 466 fail_if(!(type = eolian_type_base_type_get(type)));
470 fail_if(!eina_iterator_next(iter, (void**)&type)); 467 fail_if(!!eolian_type_next_type_get(type));
471 fail_if(!(type_name = eolian_type_c_type_get(type))); 468 fail_if(!(type_name = eolian_type_c_type_get(type)));
472 fail_if(eolian_type_is_own(type)); 469 fail_if(eolian_type_is_own(type));
473 fail_if(strcmp(type_name, "int")); 470 fail_if(strcmp(type_name, "int"));
474 eina_stringshare_del(type_name); 471 eina_stringshare_del(type_name);
475 eina_iterator_free(iter);
476 472
477 /* Methods return type */ 473 /* Methods return type */
478 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); 474 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
@@ -481,13 +477,12 @@ START_TEST(eolian_complex_type)
481 fail_if(!eolian_type_is_own(type)); 477 fail_if(!eolian_type_is_own(type));
482 fail_if(strcmp(type_name, "Eina_List *")); 478 fail_if(strcmp(type_name, "Eina_List *"));
483 eina_stringshare_del(type_name); 479 eina_stringshare_del(type_name);
484 fail_if(!(iter = eolian_type_subtypes_get(type))); 480 fail_if(!(type = eolian_type_base_type_get(type)));
485 fail_if(!eina_iterator_next(iter, (void**)&type)); 481 fail_if(!!eolian_type_next_type_get(type));
486 fail_if(!(type_name = eolian_type_c_type_get(type))); 482 fail_if(!(type_name = eolian_type_c_type_get(type)));
487 fail_if(eolian_type_is_own(type)); 483 fail_if(eolian_type_is_own(type));
488 fail_if(strcmp(type_name, "Eina_Stringshare *")); 484 fail_if(strcmp(type_name, "Eina_Stringshare *"));
489 eina_stringshare_del(type_name); 485 eina_stringshare_del(type_name);
490 eina_iterator_free(iter);
491 /* Methods parameter type */ 486 /* Methods parameter type */
492 fail_if(!(iter = eolian_function_parameters_get(fid))); 487 fail_if(!(iter = eolian_function_parameters_get(fid)));
493 fail_if(!(eina_iterator_next(iter, (void**)&param))); 488 fail_if(!(eina_iterator_next(iter, (void**)&param)));