Commit 9b9d7b81 authored by Christoph Richter's avatar Christoph Richter
Browse files

Added additional test for add

parent 5ade1c2c
......@@ -158,4 +158,18 @@ public class BasicMathGenerationArmadilloTest extends AbstractSymtabTest {
String restPath = "armadillo/testMath/l0/";
testFilesAreEqual(files, restPath);
}
@Test
public void matScalarAddTest() throws IOException {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("test.math.matScalarAddTest", ExpandedComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
generatorCPP.setGenerationTargetPath("./target/generated-sources-cpp/armadillo/testMath/l0");
List<File> files = generatorCPP.generateFiles(symtab, componentSymbol, symtab);
String restPath = "armadillo/testMath/l0/";
testFilesAreEqual(files, restPath);
}
}
#ifndef TEST_MATH_MATSCALARADDTEST
#define TEST_MATH_MATSCALARADDTEST
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "armadillo.h"
using namespace arma;
class test_math_matScalarAddTest{
public:
void init()
{
}
void execute()
{
mat A = (ones<mat>(2, 2));
double b = 1;
A = A+1;
}
};
#endif
package test.math;
component MatScalarAddTest{
implementation Math{
Q^{2,2} A = ones(2,2);
Q b = 1;
A = A + 1;
}
}
\ 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