Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c24
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h33
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c18
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h25
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c6
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c4
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c16
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestMessageService.xml14
10 files changed, 124 insertions, 24 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
new file mode 100644
index 000000000..d4235dbc3
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
@@ -0,0 +1,24 @@
+#include "DataClass1.h"
+
+#include <string.h>
+
+//--------------------- begin user code
+ // usercode3
+//--------------------- end user code
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value) {
+ return self->Attr1*value;
+}
+float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value) {
+ return self->Attr3*value;
+}
+
+// deep copy
+void DataClass1_deepCopy(DataClass1* source, DataClass1* target) {
+ memcpy(target, source, sizeof(DataClass1));
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
new file mode 100644
index 000000000..dbf8dee81
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
@@ -0,0 +1,33 @@
+#ifndef _DataClass1_H_
+#define _DataClass1_H_
+
+#include "etDatatypes.h"
+
+/* TODO: includes only for used DataClasses, also for other models */
+#include "DataClass2.h"
+
+//--------------------- begin user code
+ // usercode1
+//--------------------- end user code
+
+typedef struct {
+ //--------------------- begin user code
+ // usercode2
+ //--------------------- end user code
+ //--------------------- attributes
+ int32 Attr1;
+ DataClass2 ComplexAttr;
+ float32 Attr3;
+} DataClass1;
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value);
+float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value);
+
+// deep copy
+void DataClass1_deepCopy(DataClass1* source, DataClass1* target);
+
+#endif /* _DataClass1_H_ */
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
new file mode 100644
index 000000000..2150d7b41
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
@@ -0,0 +1,18 @@
+#include "DataClass2.h"
+
+#include <string.h>
+
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+void DataClass2_Operation1(DataClass2* self) {
+ /*nothing to do*/
+}
+
+// deep copy
+void DataClass2_deepCopy(DataClass2* source, DataClass2* target) {
+ memcpy(target, source, sizeof(DataClass2));
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
new file mode 100644
index 000000000..2d8cbb74f
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
@@ -0,0 +1,25 @@
+#ifndef _DataClass2_H_
+#define _DataClass2_H_
+
+#include "etDatatypes.h"
+
+/* TODO: includes only for used DataClasses, also for other models */
+
+
+typedef struct {
+ //--------------------- attributes
+ int32 Attr1;
+ float32 Attr2;
+ int32 Attr3;
+} DataClass2;
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+void DataClass2_Operation1(DataClass2* self);
+
+// deep copy
+void DataClass2_deepCopy(DataClass2* source, DataClass2* target);
+
+#endif /* _DataClass2_H_ */
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c b/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
index 55aad6b4d..3408a0434 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
@@ -26,11 +26,11 @@ int main(void){
void runTestCases(void){
- RUnit_open("tmp/testlog","TestMessageService");
+ etUnit_open("tmp/testlog","TestMessageService");
RunCGeneratorTestcases();
RunCRuntimeTestcases();
- RUnit_close();
+ etUnit_close();
}
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
index 8a9aab638..5c481fd4f 100644
--- 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
@@ -8,7 +8,7 @@
#include "TestDataClass.h"
-#include "RUnit.h"
+#include "etUnit.h"
#include "../../../src-gen/cGenRef/DataClass1.h"
@@ -47,8 +47,8 @@ void TestDataClass_testDataClassDeepCopy(void){
}
void TestDataClass_runSuite(void){
- RUnit_openTestSuite("TestDataClass");
+ etUnit_openTestSuite("TestDataClass");
ADD_TESTCASE(TestDataClass_Operations);
ADD_TESTCASE(TestDataClass_testDataClassDeepCopy);
- RUnit_closeTestSuite();
+ etUnit_closeTestSuite();
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
index 0dcd7e47d..c360b0a84 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
@@ -38,8 +38,8 @@ void TestEtMessage_testBasicMessage(void){
}
void TestEtMessage_runSuite(void){
- RUnit_openTestSuite("TestMessage");
+ etUnit_openTestSuite("TestMessage");
ADD_TESTCASE(TestEtMessage_testBasicMessage);
- RUnit_closeTestSuite();
+ etUnit_closeTestSuite();
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
index bf60c7e69..34efb3b31 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
@@ -94,8 +94,8 @@ void TestEtMessageQueue_testMassiveMessaging(void){
}
void TestEtMessageQueue_runSuite(void){
- RUnit_openTestSuite("TestetMessageQueue");
+ etUnit_openTestSuite("TestetMessageQueue");
ADD_TESTCASE(TestEtMessageQueue_testPushPop);
ADD_TESTCASE(TestEtMessageQueue_testMassiveMessaging);
- RUnit_closeTestSuite();
+ etUnit_closeTestSuite();
}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
index 49ce679de..1d8b6cce8 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
@@ -18,8 +18,8 @@
void TestEtMessageService_init(void){
etMessageService msgService;
- int16 max = 6;
- int16 blockSize = 32;
+ uint16 max = 6;
+ uint16 blockSize = 32;
uint8 msgBuffer[max*blockSize];
@@ -36,8 +36,8 @@ void TestEtMessageService_init(void){
void TestEtMessageService_GetPushPopReturn(void){
etMessageService msgService;
- int16 max = 6;
- int16 blockSize = 32;
+ uint16 max = 6;
+ uint16 blockSize = 32;
uint8 msgBuffer[max*blockSize];
etMessageService_init(&msgService, msgBuffer, max, blockSize);
@@ -82,8 +82,8 @@ void TestEtMessageService_GetPushPopReturn(void){
void TestEtMessageService_GetReturn(void){
etMessageService msgService;
- int16 max = 2;
- int16 blockSize = 32;
+ uint16 max = 2;
+ uint16 blockSize = 32;
uint8 msgBuffer[max*blockSize];
etMessageService_init(&msgService, msgBuffer, max, blockSize);
@@ -108,9 +108,9 @@ void TestEtMessageService_GetReturn(void){
}
void TestEtMessageService_runSuite(void){
- RUnit_openTestSuite("TestEtMessageService");
+ etUnit_openTestSuite("TestEtMessageService");
ADD_TESTCASE(TestEtMessageService_init);
ADD_TESTCASE(TestEtMessageService_GetPushPopReturn);
ADD_TESTCASE(TestEtMessageService_GetReturn);
- RUnit_closeTestSuite();
+ etUnit_closeTestSuite();
}
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 904c4ba9f..0a2578004 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
@@ -6,13 +6,13 @@
<testsuite name="TestMessage" tests="0" failures="0" errors="0" time="0">
<testcase name="TestEtMessage_testBasicMessage" time="0"/>
</testsuite>
- <testsuite name="TestRMessageQueue" tests="0" failures="0" errors="0" time="0">
- <testcase name="testPushPop" time="0"/>
- <testcase name="MassiveMessaging" time="0"/>
+ <testsuite name="TestetMessageQueue" tests="0" failures="0" errors="0" time="0">
+ <testcase name="TestEtMessageQueue_testPushPop" time="0"/>
+ <testcase name="TestEtMessageQueue_testMassiveMessaging" time="0"/>
</testsuite>
- <testsuite name="TestRMessageService" tests="0" failures="0" errors="0" time="0">
- <testcase name="testRMessageService_init" time="0"/>
- <testcase name="testRMessageService_GetPushPopReturn" time="0"/>
- <testcase name="testRMessageService_GetReturn" time="0"/>
+ <testsuite name="TestEtMessageService" tests="0" failures="0" errors="0" time="0">
+ <testcase name="TestEtMessageService_init" time="0"/>
+ <testcase name="TestEtMessageService_GetPushPopReturn" time="0"/>
+ <testcase name="TestEtMessageService_GetReturn" time="0"/>
</testsuite>
</testsuites>

Back to the top