Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2012-01-12 08:13:30 -0500
committerThomas Schuetz2012-01-12 08:13:30 -0500
commit1d5477d83b321341015ae4aaebe834e71445b4bf (patch)
tree72103474cf7302e13e72f1461b64bad1f462e78d /examples/org.eclipse.etrice.generator.c.reference
parente867baba4f31fe39d2fed1599b0c455cde88e257 (diff)
downloadorg.eclipse.etrice-1d5477d83b321341015ae4aaebe834e71445b4bf.tar.gz
org.eclipse.etrice-1d5477d83b321341015ae4aaebe834e71445b4bf.tar.xz
org.eclipse.etrice-1d5477d83b321341015ae4aaebe834e71445b4bf.zip
[generator.c.reference] cleaned up testcases for runtime.c and generator.c
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.cproject5
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c36
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c67
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c14
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c45
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c21
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.c)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.h)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.c)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.h)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.c)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h (renamed from examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.h)0
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml2
16 files changed, 159 insertions, 70 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.cproject b/examples/org.eclipse.etrice.generator.c.reference/.cproject
index aea2b3be9..cb221d1b0 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/.cproject
+++ b/examples/org.eclipse.etrice.generator.c.reference/.cproject
@@ -34,6 +34,7 @@
<option id="gnu.c.compiler.option.include.paths.937550345" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.misc.other.674019116" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -Wconversion" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.215126527" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2141539090" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
@@ -52,7 +53,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src|src-gen" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src-gen|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src-gen"/>
</sourceEntries>
@@ -114,8 +115,8 @@
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src-gen"/>
- <entry excluding="src|src-gen" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="runtime/RMessageQueue.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ <entry excluding="src-gen|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c b/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
new file mode 100644
index 000000000..6caff4b38
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#include <stdio.h>
+
+#include "RUnit.h"
+
+#include "test/generator/RunCGeneratorTestcases.h"
+#include "test/runtime/RunCRuntimeTestcases.h"
+
+void runTestCases(void);
+
+int main(void){
+ runTestCases();
+ return 0;
+}
+
+
+void runTestCases(void){
+ RUnit_open("tmp/testlog","TestMessageService");
+
+ RunCGeneratorTestcases();
+ RunCRuntimeTestcases();
+
+ RUnit_close();
+}
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c b/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c
deleted file mode 100644
index 9aa04ff58..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Thomas Schuetz (initial contribution)
- *
- *******************************************************************************/
-
-#include <stdio.h>
-#include "../src-gen/cGenRef/DataClass1.h"
-#include "RUnit.h"
-#include "RMessage.h"
-#include "test/TestEtMessage.h"
-#include "test/TestEtMessageQueue.h"
-#include "test/TestEtMessageService.h"
-
-
-
-void runTestCases(void);
-
-int main(void){
- runTestCases();
- return 0;
-}
-
-void testDataClassDeepCopy(void){
- RUnit_openTestSuite("testGeneratedDataClass");
- RUnit_openTestCase("testDataClassDeepCopy");
-
-
- DataClass1 d, e;
- d.Attr1 = 123;
- d.ComplexAttr.Attr1 = 456;
- d.ComplexAttr.Attr2 = 789.123;
- d.ComplexAttr.Attr3 = 789;
- d.Attr3 = 321.123;
-
- DataClass1_deepCopy(&d,&e);
-
- EXPECT_EQUAL_INT32("Attr1", 123, e.Attr1);
- EXPECT_EQUAL_INT32("ComplexAttr.Attr1", 456, e.ComplexAttr.Attr1);
- EXPECT_EQUAL_FLOAT32("ComplexAttr.Attr2", 789.123, e.ComplexAttr.Attr2, 0.001);
- EXPECT_EQUAL_INT32("ComplexAttr.Attr3", 789, e.ComplexAttr.Attr3);
- EXPECT_EQUAL_FLOAT32("Attr3", 321.123, e.Attr3, 0.0001);
-
- EXPECT_EQUAL_INT32("Operation DataClass1_MultiplyWithAttr1", 246, DataClass1_MultiplyWithAttr1(&d, 2));
- EXPECT_EQUAL_FLOAT32("Operation DataClass1_MultiplyWithAttr3", 642.246, DataClass1_MultiplyWithAttr3(&d, 2), 0.0001);
-
- RUnit_closeTestCase();
- RUnit_closeTestSuite();
-}
-
-void runTestCases(void){
- RUnit_open("tmp/testlog","TestMessageService");
-
- testDataClassDeepCopy();
- TestEtMessage_runSuite();
- TestEtMessageQueue_runSuite();
- TestEtMessageService_runSuite();
-
- RUnit_close();
-}
-
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c
new file mode 100644
index 000000000..db8176609
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c
@@ -0,0 +1,14 @@
+/*
+ * RunCGeneratorTestcases.c
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+#include "RunCGeneratorTestcases.h"
+
+#include "TestDataClass.h"
+
+void RunCGeneratorTestcases(void){
+ TestDataClass_runSuite();
+}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h
new file mode 100644
index 000000000..01472caa9
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h
@@ -0,0 +1,13 @@
+/*
+ * RunCGeneratorTestcases.h
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+#ifndef _RUNCGENERATORTESTCASES_H_
+#define _RUNCGENERATORTESTCASES_H_
+
+void RunCGeneratorTestcases(void);
+
+#endif /* _RUNCGENERATORTESTCASES_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c
new file mode 100644
index 000000000..066eb97e6
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c
@@ -0,0 +1,45 @@
+/*
+ * TestDataClass.c
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+
+#include "TestDataClass.h"
+
+#include "RUnit.h"
+
+#include "../../../src-gen/cGenRef/DataClass1.h"
+
+void TestDataClass_testDataClassDeepCopy(void){
+ RUnit_openTestCase("testDataClassDeepCopy");
+
+
+ DataClass1 d, e;
+ d.Attr1 = 123;
+ d.ComplexAttr.Attr1 = 456;
+ d.ComplexAttr.Attr2 = (float32)789.123;
+ d.ComplexAttr.Attr3 = 789;
+ d.Attr3 = (float32)321.123;
+
+ DataClass1_deepCopy(&d,&e);
+
+ EXPECT_EQUAL_INT32("Attr1", 123, e.Attr1);
+ EXPECT_EQUAL_INT32("ComplexAttr.Attr1", 456, e.ComplexAttr.Attr1);
+ EXPECT_EQUAL_FLOAT32("ComplexAttr.Attr2", (float32)789.123, e.ComplexAttr.Attr2, 0.001f);
+ EXPECT_EQUAL_INT32("ComplexAttr.Attr3", 789, e.ComplexAttr.Attr3);
+ EXPECT_EQUAL_FLOAT32("Attr3", (float32)321.123, e.Attr3, (float32)0.0001);
+
+ EXPECT_EQUAL_INT32("Operation DataClass1_MultiplyWithAttr1", 246, DataClass1_MultiplyWithAttr1(&d, 2));
+ EXPECT_EQUAL_FLOAT32("Operation DataClass1_MultiplyWithAttr3", (float32)642.246, DataClass1_MultiplyWithAttr3(&d, 2), (float32)0.0001);
+
+ RUnit_closeTestCase();
+}
+
+void TestDataClass_runSuite(void){
+ RUnit_openTestSuite("TestDataClass");
+ TestDataClass_testDataClassDeepCopy();
+ RUnit_closeTestSuite();
+
+}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h
new file mode 100644
index 000000000..a3c9b4078
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h
@@ -0,0 +1,13 @@
+/*
+ * TestEmDataClass.h
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+#ifndef _TESTDATACLASS_H_
+#define _TESTDATACLASS_H_
+
+void TestDataClass_runSuite(void);
+
+#endif /* _TESTDATACLASS_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c
new file mode 100644
index 000000000..7180c67b9
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c
@@ -0,0 +1,21 @@
+/*
+ * RunRuntimeTestcases.c
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+
+
+#include "RunCRuntimeTestcases.h"
+
+#include "TestEtMessage.h"
+#include "TestEtMessageQueue.h"
+#include "TestEtMessageService.h"
+
+void RunCRuntimeTestcases(void){
+ TestEtMessage_runSuite();
+ TestEtMessageQueue_runSuite();
+ TestEtMessageService_runSuite();
+}
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h
new file mode 100644
index 000000000..604dc0a3e
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h
@@ -0,0 +1,13 @@
+/*
+ * RunRuntimeTestcases.h
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+#ifndef _RUNCRUNTIMETESTCASES_H_
+#define _RUNCRUNTIMETESTCASES_H_
+
+void RunCRuntimeTestcases(void);
+
+#endif /* _RUNCRUNTIMETESTCASES_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
index a9d7b6aee..a9d7b6aee 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h
index 67b45e4e1..67b45e4e1 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessage.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
index 6b03602df..6b03602df 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h
index afceea8f8..afceea8f8 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageQueue.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
index ed14defb1..ed14defb1 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h
index 287ff8c8b..287ff8c8b 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/TestEtMessageService.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml b/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml
index 26e811bc0..36d6edbba 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml
+++ b/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml
@@ -1,5 +1,5 @@
<testsuites name="TestMessageService" tests="0" failures="0" errors="0" time="0">
- <testsuite name="testGeneratedDataClass" tests="0" failures="0" errors="0" time="0">
+ <testsuite name="TestDataClass" tests="0" failures="0" errors="0" time="0">
<testcase name="testDataClassDeepCopy" time="0"/>
</testsuite>
<testsuite name="TestMessage" tests="0" failures="0" errors="0" time="0">

Back to the top