Commit 4514cd2d authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Fix string variables.

Add test ctrl file for testing variable types.
parent cdce9652
......@@ -332,7 +332,7 @@ var : stringvar
stringvar: STRINGSYM
| STRINGVARIABLESYM
{ controller_load_variable_string_get($1); }
{ $$ = controller_load_variable_string_get($1); }
;
floatlist: floatlistvar
......
......@@ -34,6 +34,7 @@ SRCS += $(TEST_BLOCK_SRCS)
CTRL_TESTS += \
$(DIR)/test.test.output \
$(DIR)/test_variables.test.output \
$(DIR)/test_import.test.output \
$(DIR)/test_link.test.output \
$(DIR)/test_module.test.output \
......
# a comment
#comment
trigger {
{ "immediate" }
# comment inside trigger
}
#empty trigger
trigger{}
#empty trigger
trigger{#with a comment
}
blocks (100.0, 0.0) {
{ "test_input_bool", "input_bool" }
{ "test_input_uint32", "input_uint32" }
......@@ -21,15 +28,8 @@ blocks (100.0, 0.0) {
#empty blocks
blocks(100.0, 0.0){}
alias {
{ "input_bool", "input_bool", "value" }
}
#empty alias
alias{}
links {
{ $<input_bool>, "output_bool", "value", true }
{ "input_bool", "value", "output_bool", "value", true }
{ "input_uint32", "value", "output_uint32", "value", true }
{ "input_sint32", "value", "output_sint32", "value", true }
{ "input_float", "value", "output_float", "value", true }
......
trigger {
{ "immediate" }
}
# first set it wrong, then override to right value
set intvartrue false
set intvartrue true
set intvarfour 4
set doublevarhundred 100.0
set stringvarvalue "value"
blocks ($(doublevarhundred), 0.0) {
{ "test_input_bool", "input_bool" }
{ "test_input_uint32", "input_uint32" }
{ "test_input_sint32", "input_sint32" }
{ "test_input_float", "input_float" }
{ "test_output_bool", "output_bool" }
{ "test_output_uint32", "output_uint32" }
{ "test_output_sint32", "output_sint32" }
{ "test_output_float", "output_float" }
}
alias {
{ "input_bool", "input_bool", "value" }
}
#empty alias
alias{}
links {
{ $<input_bool>, "output_bool", ${stringvarvalue}, true }
{ "input_uint32", "value", "output_uint32", "value", true }
{ "input_sint32", "value", "output_sint32", "value", true }
{ "input_float", "value", "output_float", "value", true }
}
params {
{ "input_bool", "value", $[intvarfour], (int) { $[intvartrue], false, true, false } }
{ "output_bool", "value", 4, (int) { true, false, true, false } }
{ "input_float", "value", 4,
(float) { 12345678.9, -3.3333333, $(intvarfour), 42.01e-20 } }
{ "output_float", "value", 4,
(float) { 12345678.9, -3.3333333, 4.0, 42.01e-20 },
(float) { 0.0, 0.0, 0.0, 0.0 } }
{ "input_uint32", "value", 4, (int) { $[intvarfour], $[intvartrue], (int)0xdeadbeef, 123456789 } }
{ "output_uint32", "value", 4, (int) { 4, 1, (int)0xdeadbeef, 123456789 } }
{ "input_sint32", "value", 4, (int) { 0, 1, $[doublevarhundred], 123456789 } }
{ "output_sint32", "value", 4, (int) { 0, 1, 100, 123456789 } }
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment