diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2017-09-22 20:58:36 +0200 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2017-09-22 21:03:28 +0200 |
commit | 6587b19e778cf5415a8d201f1ab9993611254255 (patch) | |
tree | 842479d8b15e2081f100846748232ae518bd7374 | |
parent | 5e788e3a5c99a28152d5960fe49bdd3ef4d9707e (diff) |
eolian: add tests for builtin queries
-rw-r--r-- | src/tests/eolian/eolian_parsing.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 9e2c0d9bfc..86c079817e 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c | |||
@@ -412,12 +412,14 @@ START_TEST(eolian_complex_type) | |||
412 | fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET))); | 412 | fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET))); |
413 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN))); | 413 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN))); |
414 | fail_if(!eolian_type_is_owned(type)); | 414 | fail_if(!eolian_type_is_owned(type)); |
415 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_LIST); | ||
415 | fail_if(strcmp(type_name, "Eina_List *")); | 416 | fail_if(strcmp(type_name, "Eina_List *")); |
416 | eina_stringshare_del(type_name); | 417 | eina_stringshare_del(type_name); |
417 | fail_if(!(type = eolian_type_base_type_get(type))); | 418 | fail_if(!(type = eolian_type_base_type_get(type))); |
418 | fail_if(!!eolian_type_next_type_get(type)); | 419 | fail_if(!!eolian_type_next_type_get(type)); |
419 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 420 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); |
420 | fail_if(eolian_type_is_owned(type)); | 421 | fail_if(eolian_type_is_owned(type)); |
422 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY); | ||
421 | fail_if(strcmp(type_name, "Eina_Array *")); | 423 | fail_if(strcmp(type_name, "Eina_Array *")); |
422 | eina_stringshare_del(type_name); | 424 | eina_stringshare_del(type_name); |
423 | fail_if(!(type = eolian_type_base_type_get(type))); | 425 | fail_if(!(type = eolian_type_base_type_get(type))); |
@@ -455,6 +457,7 @@ START_TEST(eolian_complex_type) | |||
455 | fail_if(!!eolian_type_next_type_get(type)); | 457 | fail_if(!!eolian_type_next_type_get(type)); |
456 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 458 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); |
457 | fail_if(eolian_type_is_owned(type)); | 459 | fail_if(eolian_type_is_owned(type)); |
460 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE); | ||
458 | fail_if(strcmp(type_name, "Eina_Stringshare *")); | 461 | fail_if(strcmp(type_name, "Eina_Stringshare *")); |
459 | eina_stringshare_del(type_name); | 462 | eina_stringshare_del(type_name); |
460 | /* Methods parameter type */ | 463 | /* Methods parameter type */ |
@@ -466,6 +469,7 @@ START_TEST(eolian_complex_type) | |||
466 | fail_if(!(type = eolian_parameter_type_get(param))); | 469 | fail_if(!(type = eolian_parameter_type_get(param))); |
467 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM))); | 470 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM))); |
468 | fail_if(!eolian_type_is_owned(type)); | 471 | fail_if(!eolian_type_is_owned(type)); |
472 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_MSTRING); | ||
469 | fail_if(strcmp(type_name, "char *")); | 473 | fail_if(strcmp(type_name, "char *")); |
470 | eina_stringshare_del(type_name); | 474 | eina_stringshare_del(type_name); |
471 | 475 | ||
@@ -554,6 +558,8 @@ START_TEST(eolian_simple_parsing) | |||
554 | /* Set return */ | 558 | /* Set return */ |
555 | tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET); | 559 | tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET); |
556 | fail_if(!tp); | 560 | fail_if(!tp); |
561 | printf("BUILT %d\n", (int)eolian_type_builtin_type_get(tp)); | ||
562 | fail_if(eolian_type_builtin_type_get(tp) != EOLIAN_TYPE_BUILTIN_BOOL); | ||
557 | fail_if(strcmp(eolian_type_name_get(tp), "bool")); | 563 | fail_if(strcmp(eolian_type_name_get(tp), "bool")); |
558 | expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET); | 564 | expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET); |
559 | fail_if(!expr); | 565 | fail_if(!expr); |
@@ -614,6 +620,7 @@ START_TEST(eolian_simple_parsing) | |||
614 | fail_if(strcmp(eolian_parameter_name_get(param), "b")); | 620 | fail_if(strcmp(eolian_parameter_name_get(param), "b")); |
615 | fail_if(!(eina_iterator_next(iter, (void**)¶m))); | 621 | fail_if(!(eina_iterator_next(iter, (void**)¶m))); |
616 | fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM); | 622 | fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM); |
623 | fail_if(eolian_type_builtin_type_get(eolian_parameter_type_get(param)) != EOLIAN_TYPE_BUILTIN_DOUBLE); | ||
617 | fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double")); | 624 | fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double")); |
618 | fail_if(strcmp(eolian_parameter_name_get(param), "c")); | 625 | fail_if(strcmp(eolian_parameter_name_get(param), "c")); |
619 | expr = eolian_parameter_default_value_get(param); | 626 | expr = eolian_parameter_default_value_get(param); |