that's how this works now
This commit is contained in:
parent
041919d940
commit
2decb5f196
|
@ -12,6 +12,7 @@ import java.io.BufferedReader;
|
|||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
@ -51,6 +52,25 @@ public class ConfigFieldParserTest {
|
|||
assertEquals(16, TypesHelper.getElementSize(state, "pid_s"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multiplicationInDefine() throws IOException {
|
||||
String test = "struct pid_s\n" +
|
||||
"#define ERROR_BUFFER_SIZE 120\n" +
|
||||
"#define ERROR_BUFFER_COUNT 120\n" +
|
||||
"#define RESULT 120*@@ERROR_BUFFER_COUNT@@\n" +
|
||||
"\tint16_t periodMs;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
|
||||
"end_struct\n" +
|
||||
"";
|
||||
|
||||
VariableRegistry.INSTANCE.clear();
|
||||
BufferedReader reader = new BufferedReader(new StringReader(test));
|
||||
new ReaderState().readBufferedReader(reader, Collections.emptyList());
|
||||
|
||||
assertEquals("#define ERROR_BUFFER_COUNT 120\n" +
|
||||
"#define ERROR_BUFFER_SIZE 120\n" +
|
||||
"#define RESULT 120*@@ERROR_BUFFER_COUNT@@\n", VariableRegistry.INSTANCE.getDefinesSection());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void useCustomType() throws IOException {
|
||||
ReaderState state = new ReaderState();
|
||||
|
@ -72,7 +92,6 @@ public class ConfigFieldParserTest {
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFsioVisible() throws IOException {
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue