Commit 81fbcbd3 authored by Sascha Niklas Schneiders's avatar Sascha Niklas Schneiders
Browse files

Added test for loading of small model

parent 07c265b9
......@@ -30,4 +30,15 @@ public class BasicGenerationTest extends AbstractSymtabTest {
String restPath = "testing/l0/";
testFilesAreEqual(files, restPath);
}
@Test
public void testSampleModel() throws IOException{
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("testing.model", ExpandedComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.setGenerationTargetPath("./target/generated-sources-cpp/testing/l0");
List<File> files = generatorCPP.generateFiles(componentSymbol, symtab);
}
}
package testing;
component Model {
port out Z(0:255)^{640,480} rgba[4];
instance ModelColor<640,480> modelColor;
connect modelColor.red -> rgba[1];
connect modelColor.green -> rgba[2];
connect modelColor.blue -> rgba[2];
connect modelColor.alpha -> rgba[4];
}
\ No newline at end of file
package testing;
component ModelColor<N1 width=1, N1 height=1>{
ports out Z(0:255)^{width,height} red,
out Z(0:255)^{width,height} green,
out Z(0:255)^{width,height} blue,
out Z(0:255)^{width,height} alpha;
implementation Math {
red = zeros(640, 480);
green = zeros(640, 480);
blue = zeros(640, 480);
alpha = zeros(640, 480);
//set concrete values here
}
}
\ No newline at end of file
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