Commit b847f3ec authored by Alexander Ryndin's avatar Alexander Ryndin
Browse files

add test for math assignment declaration bug (static B myVar = false)

parent af34bb7f
......@@ -540,4 +540,20 @@ public class GenerationTest extends AbstractSymtabTest {
Assert.assertNotNull(files);
Assert.assertFalse(files.isEmpty());
}
@Test
@Ignore("https://github.com/EmbeddedMontiArc/EMAM2Cpp/issues/27")
public void cppCodeForMyComponent6CanBeGenerated() throws IOException {
TaggingResolver symTab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol componentSymbol = symTab.<ExpandedComponentInstanceSymbol>resolve(
"testing.subpackage6.myComponent6",
ExpandedComponentInstanceSymbol.KIND
).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.setGenerationTargetPath("./target/generated-sources-cpp/testing/MyComponent6");
List<File> files = generatorCPP.generateFiles(componentSymbol, symTab);
Assert.assertNotNull(files);
Assert.assertFalse(files.isEmpty());
}
}
package testing.subpackage6;
component MyComponent6 {
port
in Q (0.0 : 0.1 : 100.0) in1,
out Q (0.0 : 0.1 : 100.0) out1;
implementation Math {
// on the very first execution the condition is false
static B someCondition = false;
if someCondition
out1 = 11.1;
else
out1 = 22.2;
end
// on all the following executions the condition is true
someCondition = true;
}
}
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