Eolian/Tests: Clean makefile + add return comment tests.

This commit is contained in:
Daniel Zaoui 2014-04-24 14:07:18 +03:00
parent dd587ba43b
commit 0dda45961f
5 changed files with 15 additions and 9 deletions

View File

@ -76,9 +76,6 @@ TESTS += tests/eolian/eolian_suite
tests_eolian_eolian_suite_LDADD = @CHECK_LIBS@ @USE_EOLIAN_LIBS@
tests_eolian_eolian_suite_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@
eoliandatafilesdir = $(datadir)/eolian/data
eoliandatafiles_DATA = tests/eolian/data/class_simple.eo
endif
EXTRA_DIST += \

View File

@ -1748,7 +1748,7 @@ _eof_trans:
#line 680 "lib/eolian/eo_lexer.rl"
{
if (!toknz->tmp.meth) ABORT(toknz, "No method!!!");
if (toknz->tmp.meth->ret != NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret == NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret->comment != NULL)
ABORT(toknz, "method '%s' return type has already a comment", toknz->tmp.meth->name);
toknz->tmp.meth->ret->comment = _eo_tokenizer_token_get(toknz, ( toknz->p)-2);
@ -3210,7 +3210,7 @@ _eof_trans:
#line 680 "lib/eolian/eo_lexer.rl"
{
if (!toknz->tmp.meth) ABORT(toknz, "No method!!!");
if (toknz->tmp.meth->ret != NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret == NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret->comment != NULL)
ABORT(toknz, "method '%s' return type has already a comment", toknz->tmp.meth->name);
toknz->tmp.meth->ret->comment = _eo_tokenizer_token_get(toknz, ( toknz->p)-2);

View File

@ -679,7 +679,7 @@ _eo_tokenizer_implement_get(Eo_Tokenizer *toknz, char *p)
action end_method_rettype_comment {
if (!toknz->tmp.meth) ABORT(toknz, "No method!!!");
if (toknz->tmp.meth->ret != NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret == NULL) ABORT(toknz, "No ret!!!");
if (toknz->tmp.meth->ret->comment != NULL)
ABORT(toknz, "method '%s' return type has already a comment", toknz->tmp.meth->name);
toknz->tmp.meth->ret->comment = _eo_tokenizer_token_get(toknz, fpc-2);

View File

@ -8,7 +8,7 @@ class Simple {
set {
/*@
comment a::set */
return Eina_Bool (EINA_TRUE);
return Eina_Bool (EINA_TRUE); /*@ comment for property set return */
}
get {
}
@ -25,7 +25,7 @@ class Simple {
@inout char *b;
@out double c;
}
return char *(NULL);
return char *(NULL); /*@ comment for method return */
}
}
};

View File

@ -78,15 +78,21 @@ START_TEST(eolian_simple_parsing)
fail_if(strcmp(string, "comment a::set"));
string = eolian_function_description_get(fid, EOLIAN_COMMENT_GET);
fail_if(string);
/* Function return */
/* Set return */
string = eolian_function_return_type_get(fid, EOLIAN_PROP_SET);
fail_if(!string);
fail_if(strcmp(string, "Eina_Bool"));
string = eolian_function_return_dflt_value_get(fid, EOLIAN_PROP_SET);
fail_if(!string);
fail_if(strcmp(string, "EINA_TRUE"));
string = eolian_function_return_comment_get(fid, EOLIAN_PROP_SET);
fail_if(!string);
fail_if(strcmp(string, "comment for property set return"));
/* Get return */
string = eolian_function_return_type_get(fid, EOLIAN_PROP_GET);
fail_if(string);
string = eolian_function_return_comment_get(fid, EOLIAN_PROP_GET);
fail_if(string);
/* Function parameters */
fail_if(eolian_property_keys_list_get(fid) != NULL);
@ -110,6 +116,9 @@ START_TEST(eolian_simple_parsing)
string = eolian_function_return_dflt_value_get(fid, EOLIAN_METHOD);
fail_if(!string);
fail_if(strcmp(string, "NULL"));
string = eolian_function_return_comment_get(fid, EOLIAN_METHOD);
fail_if(!string);
fail_if(strcmp(string, "comment for method return"));
/* Function parameters */
fail_if(!(list = eolian_parameters_list_get(fid)));