forked from enlightenment/efl
eolian: tests for default param values
This commit is contained in:
parent
b13bafabba
commit
5e063b37a2
|
@ -13,7 +13,7 @@ class Class_Simple {
|
||||||
get {
|
get {
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
int value; /*@ Value description */
|
int value (100); /*@ Value description */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b {
|
b {
|
||||||
|
@ -28,7 +28,7 @@ class Class_Simple {
|
||||||
params {
|
params {
|
||||||
@in int a; /*@ a */
|
@in int a; /*@ a */
|
||||||
@inout char b;
|
@inout char b;
|
||||||
@out double c;
|
@out double c (1337.6);
|
||||||
}
|
}
|
||||||
return: char * (null); /*@ comment for method return */
|
return: char * (null); /*@ comment for method return */
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,6 +501,11 @@ START_TEST(eolian_simple_parsing)
|
||||||
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
|
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
|
||||||
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
|
fail_if(strcmp(eolian_parameter_name_get(param), "value"));
|
||||||
fail_if(strcmp(eolian_parameter_description_get(param), "Value description"));
|
fail_if(strcmp(eolian_parameter_description_get(param), "Value description"));
|
||||||
|
expr = eolian_parameter_default_value_get(param);
|
||||||
|
fail_if(!expr);
|
||||||
|
v = eolian_expression_eval(expr, EOLIAN_MASK_INT);
|
||||||
|
fail_if(v.type != EOLIAN_EXPR_INT);
|
||||||
|
fail_if(v.value.i != 100);
|
||||||
|
|
||||||
/* legacy only */
|
/* legacy only */
|
||||||
fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROPERTY)));
|
fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROPERTY)));
|
||||||
|
@ -546,6 +551,11 @@ START_TEST(eolian_simple_parsing)
|
||||||
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double"));
|
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double"));
|
||||||
fail_if(strcmp(eolian_parameter_name_get(param), "c"));
|
fail_if(strcmp(eolian_parameter_name_get(param), "c"));
|
||||||
fail_if(eolian_parameter_description_get(param));
|
fail_if(eolian_parameter_description_get(param));
|
||||||
|
expr = eolian_parameter_default_value_get(param);
|
||||||
|
fail_if(!expr);
|
||||||
|
v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT);
|
||||||
|
fail_if(v.type != EOLIAN_EXPR_DOUBLE);
|
||||||
|
fail_if(v.value.d != 1337.6);
|
||||||
fail_if(eina_iterator_next(iter, &dummy));
|
fail_if(eina_iterator_next(iter, &dummy));
|
||||||
eina_iterator_free(iter);
|
eina_iterator_free(iter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue