Added test: 3 dimensional Matrices

parent 95a62156
...@@ -238,4 +238,28 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -238,4 +238,28 @@ public class GenerationTest extends AbstractSymtabTest {
assertEquals(fileNames.contains("RosAdapter_tests_a_addComp.h"), genRosAdapter); assertEquals(fileNames.contains("RosAdapter_tests_a_addComp.h"), genRosAdapter);
assertEquals(fileNames.contains("DummyAdapter_tests_a_addComp.h"), genDummyAdapter); assertEquals(fileNames.contains("DummyAdapter_tests_a_addComp.h"), genDummyAdapter);
} }
@Ignore
//Cpp: No 3 dim matrices(https://github.com/EmbeddedMontiArc/EMAM2Cpp/issues/37)
// No types other then Q(https://github.com/EmbeddedMontiArc/EMAM2Cpp/issues/14)
@Test
public void testThreeDimMatrix() throws IOException {
TaggingResolver taggingResolver = createSymTabAndTaggingResolver("src/test/resources/");
//register the middleware tag types
RosToEmamTagSchema.registerTagTypes(taggingResolver);
ExpandedComponentInstanceSymbol componentInstanceSymbol = taggingResolver.<ExpandedComponentInstanceSymbol>resolve("tests.matrix.threeDimMatrixComp", ExpandedComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentInstanceSymbol);
//make sure the middleware tags are loaded
TagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
middlewareGenerator.setGenerationTargetPath("./target/generated-sources-cmake/threeDimMatrixComp/src/");
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
}
} }
package tests.matrix;
component ThreeDimMatrixComp{
ports in Q^{3,224,224} in1,
in Z^{3,224,224} in2,
in B^{3,224,224} in3,
out Q^{3,224,224} out1,
out Z^{3,224,224} out2,
out B^{3,224,224} out3;
}
\ No newline at end of file
package tests.matrix;
conforms to de.monticore.lang.monticar.generator.roscpp.RosToEmamTagSchema;
tags ThreeDimMatrixComp{
tag threeDimMatrixComp.in1 with RosConnection = {topic=(/topicName1,std_msgs/Float64MultiArray)};
tag threeDimMatrixComp.in2 with RosConnection = {topic=(/topicName2,std_msgs/Int32MultiArray)};
tag threeDimMatrixComp.in3 with RosConnection = {topic=(/topicName3,std_msgs/ByteMultiArray)};
tag threeDimMatrixComp.out1 with RosConnection = {topic=(/topicName4,std_msgs/Float64MultiArray)};
tag threeDimMatrixComp.out2 with RosConnection = {topic=(/topicName5,std_msgs/Int32MultiArray)};
tag threeDimMatrixComp.out3 with RosConnection = {topic=(/topicName6,std_msgs/ByteMultiArray)};
}
\ No newline at end of file
Markdown is supported
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