Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.etrice.generator.c.tests/src')
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/generator/TestDataClass.c134
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/RunCRuntimeTestcases.c98
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessage.c90
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageQueue.c198
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageService.h42
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtUnit.c134
6 files changed, 348 insertions, 348 deletions
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/generator/TestDataClass.c b/tests/org.eclipse.etrice.generator.c.tests/src/test/generator/TestDataClass.c
index 4ecaf4213..b41cfa60c 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/generator/TestDataClass.c
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/generator/TestDataClass.c
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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)
- *
- *******************************************************************************/
-
-
-/*
- * TestDataClass.c
- *
- * Created on: 12.01.2012
- * Author: tschuetz
- */
-
-
-#include "TestDataClass.h"
-
-#include "etUnit/etUnit.h"
-
-#include "../../../src-gen/cGenRef/DataClass1.h"
-
-void TestDataClass_Operations(void){
-
- DataClass1 d;
- d.Attr1 = 123;
- d.ComplexAttr.Attr1 = 456;
- d.ComplexAttr.Attr2 = (float32)789.123;
- d.ComplexAttr.Attr3 = 789;
- d.Attr3 = (float32)321.123;
-
- 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);
-
-}
-
-
-void TestDataClass_testDataClassDeepCopy(void){
-
- 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);
-
-}
-
-void TestDataClass_runSuite(void){
- etUnit_openTestSuite("TestDataClass");
- ADD_TESTCASE(TestDataClass_Operations);
- ADD_TESTCASE(TestDataClass_testDataClassDeepCopy);
- etUnit_closeTestSuite();
-}
+/*******************************************************************************
+ * 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)
+ *
+ *******************************************************************************/
+
+
+/*
+ * TestDataClass.c
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+
+#include "TestDataClass.h"
+
+#include "etUnit/etUnit.h"
+
+#include "../../../src-gen/cGenRef/DataClass1.h"
+
+void TestDataClass_Operations(void){
+
+ DataClass1 d;
+ d.Attr1 = 123;
+ d.ComplexAttr.Attr1 = 456;
+ d.ComplexAttr.Attr2 = (float32)789.123;
+ d.ComplexAttr.Attr3 = 789;
+ d.Attr3 = (float32)321.123;
+
+ 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);
+
+}
+
+
+void TestDataClass_testDataClassDeepCopy(void){
+
+ 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);
+
+}
+
+void TestDataClass_runSuite(void){
+ etUnit_openTestSuite("TestDataClass");
+ ADD_TESTCASE(TestDataClass_Operations);
+ ADD_TESTCASE(TestDataClass_testDataClassDeepCopy);
+ etUnit_closeTestSuite();
+}
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/RunCRuntimeTestcases.c b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/RunCRuntimeTestcases.c
index a8536fe89..bc60644c3 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/RunCRuntimeTestcases.c
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/RunCRuntimeTestcases.c
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * 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)
- *
- *******************************************************************************/
-
-
-/*
- * RunRuntimeTestcases.c
- *
- * Created on: 12.01.2012
- * Author: tschuetz
- */
-
-
-
-#include "RunCRuntimeTestcases.h"
-
-#include "TestEtMessage.h"
-#include "TestEtMessageQueue.h"
-#include "TestEtMessageService.h"
-#include "TestEtUnit.h"
-
-#include "etUnit/etUnit.h"
-
-
-void RunCRuntimeTestcases(void){
- etUnit_open("tmp/testlog","TestCRuntime");
-
- TestEtMessage_runSuite();
- TestEtMessageQueue_runSuite();
- TestEtMessageService_runSuite();
- TestEtUnit_runSuite();
-
- etUnit_close();
-
- /* special situation for testing openAll and closeAll of etUnit
- * this has to be done outside of etUnit_open and etUnit_close */
- etUnit_openAll("tmp/testlog","TestEtUnitSpecial", "etUnit", "openAll and closeAll");
- EXPECT_TRUE("Open and Close", TRUE);
- etUnit_closeAll();
-}
-
+/*******************************************************************************
+ * 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)
+ *
+ *******************************************************************************/
+
+
+/*
+ * RunRuntimeTestcases.c
+ *
+ * Created on: 12.01.2012
+ * Author: tschuetz
+ */
+
+
+
+#include "RunCRuntimeTestcases.h"
+
+#include "TestEtMessage.h"
+#include "TestEtMessageQueue.h"
+#include "TestEtMessageService.h"
+#include "TestEtUnit.h"
+
+#include "etUnit/etUnit.h"
+
+
+void RunCRuntimeTestcases(void){
+ etUnit_open("tmp/testlog","TestCRuntime");
+
+ TestEtMessage_runSuite();
+ TestEtMessageQueue_runSuite();
+ TestEtMessageService_runSuite();
+ TestEtUnit_runSuite();
+
+ etUnit_close();
+
+ /* special situation for testing openAll and closeAll of etUnit
+ * this has to be done outside of etUnit_open and etUnit_close */
+ etUnit_openAll("tmp/testlog","TestEtUnitSpecial", "etUnit", "openAll and closeAll");
+ EXPECT_TRUE("Open and Close", TRUE);
+ etUnit_closeAll();
+}
+
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessage.c b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessage.c
index a0e6b55b9..ed317284f 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessage.c
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessage.c
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * 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 "TestEtMessage.h"
-
-#include <stddef.h>
-#include "etUnit/etUnit.h"
-#include "messaging/etMessage.h"
-
-
-
-void TestEtMessage_testBasicMessage(void){
-
- etMessage msg1 = {(etMessage*)1234567, 123,456,};
- etMessage msg2 = {NULL, 222,333};
-
- // basic checks -> detects structure changes that would cause problems for generated code
- EXPECT_EQUAL_PTR("Message.next", 1234567, msg1.next);
- EXPECT_EQUAL_INT16("Message.address", 123, msg1.address);
- EXPECT_EQUAL_INT16("Message.evtID", 456, msg1.evtID);
-
- // build pointer ring
- msg1.next = &msg2;
- msg2.next = &msg1;
-
- EXPECT_EQUAL_INT16("msg1.NextMsg", msg2.evtID, msg1.next->evtID);
- EXPECT_EQUAL_INT16("msg2.NextMsg", msg1.evtID, msg2.next->evtID);
-
-}
-
-void TestEtMessage_runSuite(void){
- etUnit_openTestSuite("TestMessage");
- ADD_TESTCASE(TestEtMessage_testBasicMessage);
- etUnit_closeTestSuite();
-}
-
+/*******************************************************************************
+ * 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 "TestEtMessage.h"
+
+#include <stddef.h>
+#include "etUnit/etUnit.h"
+#include "messaging/etMessage.h"
+
+
+
+void TestEtMessage_testBasicMessage(void){
+
+ etMessage msg1 = {(etMessage*)1234567, 123,456,};
+ etMessage msg2 = {NULL, 222,333};
+
+ // basic checks -> detects structure changes that would cause problems for generated code
+ EXPECT_EQUAL_PTR("Message.next", 1234567, msg1.next);
+ EXPECT_EQUAL_INT16("Message.address", 123, msg1.address);
+ EXPECT_EQUAL_INT16("Message.evtID", 456, msg1.evtID);
+
+ // build pointer ring
+ msg1.next = &msg2;
+ msg2.next = &msg1;
+
+ EXPECT_EQUAL_INT16("msg1.NextMsg", msg2.evtID, msg1.next->evtID);
+ EXPECT_EQUAL_INT16("msg2.NextMsg", msg1.evtID, msg2.next->evtID);
+
+}
+
+void TestEtMessage_runSuite(void){
+ etUnit_openTestSuite("TestMessage");
+ ADD_TESTCASE(TestEtMessage_testBasicMessage);
+ etUnit_closeTestSuite();
+}
+
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageQueue.c b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageQueue.c
index 30228fc98..1febd72ce 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageQueue.c
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageQueue.c
@@ -1,99 +1,99 @@
-/*******************************************************************************
- * 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 "TestEtMessageQueue.h"
-#include "etUnit/etUnit.h"
-#include "messaging/etMessageQueue.h"
-
-void TestEtMessageQueue_testPushPop(void){
-
- etMessage msg1 = {NULL, 123, 456};
- etMessage msg2 = {NULL, 222, 333};
-
- etMessageQueue queue1;
- etMessageQueue_init(&queue1);
-
- etMessageQueue_push(&queue1, &msg1);
- etMessageQueue_push(&queue1, &msg2);
-
- EXPECT_EQUAL_INT16("etMessageQueue.size before", 2, queue1.size);
- EXPECT_EQUAL_INT16("etMessageQueue.highWaterMark before", 2, queue1.highWaterMark);
-
- etMessage* rcvMsg1 = etMessageQueue_pop(&queue1);
- etMessage* rcvMsg2 = etMessageQueue_pop(&queue1);
-
- EXPECT_EQUAL_INT16("etMessageQueue.size after", 0, queue1.size);
- EXPECT_EQUAL_INT16("etMessageQueue.highWaterMark after", 2, queue1.highWaterMark);
-
- EXPECT_EQUAL_INT16("rcvMsg1->address", 123, rcvMsg1->address);
- EXPECT_EQUAL_INT16("rcvMsg1->evtID", 456, rcvMsg1->evtID);
- EXPECT_EQUAL_PTR("rcvMsg1->next", NULL, rcvMsg1->next);
-
- EXPECT_EQUAL_INT16("rcvMsg2->address", 222, rcvMsg2->address);
- EXPECT_EQUAL_INT16("rcvMsg2->evtID", 333, rcvMsg2->evtID);
- EXPECT_EQUAL_PTR("rcvMsg2->next", NULL, rcvMsg2->next);
-
- EXPECT_EQUAL_PTR("etMessageQueue->first", NULL, queue1.first);
- EXPECT_EQUAL_PTR("etMessageQueue->last", NULL, queue1.last);
-
- etMessage* rcvMsg3 = etMessageQueue_pop(&queue1);
- EXPECT_EQUAL_PTR("etMessageQueue_pop if empty", NULL, rcvMsg3);
-
-}
-
-#define MAX 1000
-
-void TestEtMessageQueue_testMassiveMessaging(void){
-
- etMessage msgArray[MAX];
-
- etMessageQueue queue1;
- etMessageQueue_init(&queue1);
-
- int16 i;
- for(i=0; i<MAX; i++){
- //etMessage_init(&msgArray[i]);
- msgArray[i].address = i;
- msgArray[i].evtID = i;
- }
-
- int j;
- for(j=0; j<3; j++){
- for (i=0; i<MAX; i++){
- etMessageQueue_push(&queue1, &(msgArray[i]));
- }
- for (i=0; i<MAX; i++){
- etMessage* msg = etMessageQueue_pop(&queue1);
- // EXPECTS are hidden to avoid too many testcases in log
- if (msg == NULL){
- EXPECT_FALSE("msg == NULL", TRUE);
- break;
- }
- if (msg->address != msg->evtID){
- EXPECT_FALSE("msg->address != msg->evtID", TRUE);
- break;
- }
- if (msg->address != i){
- EXPECT_FALSE("msg->address != i", TRUE);
- break;
- }
- }
- EXPECT_EQUAL_INT32("i==MAX", MAX, i);
- }
-}
-
-void TestEtMessageQueue_runSuite(void){
- etUnit_openTestSuite("TestEtMessageQueue");
- ADD_TESTCASE(TestEtMessageQueue_testPushPop);
- ADD_TESTCASE(TestEtMessageQueue_testMassiveMessaging);
- etUnit_closeTestSuite();
-}
+/*******************************************************************************
+ * 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 "TestEtMessageQueue.h"
+#include "etUnit/etUnit.h"
+#include "messaging/etMessageQueue.h"
+
+void TestEtMessageQueue_testPushPop(void){
+
+ etMessage msg1 = {NULL, 123, 456};
+ etMessage msg2 = {NULL, 222, 333};
+
+ etMessageQueue queue1;
+ etMessageQueue_init(&queue1);
+
+ etMessageQueue_push(&queue1, &msg1);
+ etMessageQueue_push(&queue1, &msg2);
+
+ EXPECT_EQUAL_INT16("etMessageQueue.size before", 2, queue1.size);
+ EXPECT_EQUAL_INT16("etMessageQueue.highWaterMark before", 2, queue1.highWaterMark);
+
+ etMessage* rcvMsg1 = etMessageQueue_pop(&queue1);
+ etMessage* rcvMsg2 = etMessageQueue_pop(&queue1);
+
+ EXPECT_EQUAL_INT16("etMessageQueue.size after", 0, queue1.size);
+ EXPECT_EQUAL_INT16("etMessageQueue.highWaterMark after", 2, queue1.highWaterMark);
+
+ EXPECT_EQUAL_INT16("rcvMsg1->address", 123, rcvMsg1->address);
+ EXPECT_EQUAL_INT16("rcvMsg1->evtID", 456, rcvMsg1->evtID);
+ EXPECT_EQUAL_PTR("rcvMsg1->next", NULL, rcvMsg1->next);
+
+ EXPECT_EQUAL_INT16("rcvMsg2->address", 222, rcvMsg2->address);
+ EXPECT_EQUAL_INT16("rcvMsg2->evtID", 333, rcvMsg2->evtID);
+ EXPECT_EQUAL_PTR("rcvMsg2->next", NULL, rcvMsg2->next);
+
+ EXPECT_EQUAL_PTR("etMessageQueue->first", NULL, queue1.first);
+ EXPECT_EQUAL_PTR("etMessageQueue->last", NULL, queue1.last);
+
+ etMessage* rcvMsg3 = etMessageQueue_pop(&queue1);
+ EXPECT_EQUAL_PTR("etMessageQueue_pop if empty", NULL, rcvMsg3);
+
+}
+
+#define MAX 1000
+
+void TestEtMessageQueue_testMassiveMessaging(void){
+
+ etMessage msgArray[MAX];
+
+ etMessageQueue queue1;
+ etMessageQueue_init(&queue1);
+
+ int16 i;
+ for(i=0; i<MAX; i++){
+ //etMessage_init(&msgArray[i]);
+ msgArray[i].address = i;
+ msgArray[i].evtID = i;
+ }
+
+ int j;
+ for(j=0; j<3; j++){
+ for (i=0; i<MAX; i++){
+ etMessageQueue_push(&queue1, &(msgArray[i]));
+ }
+ for (i=0; i<MAX; i++){
+ etMessage* msg = etMessageQueue_pop(&queue1);
+ // EXPECTS are hidden to avoid too many testcases in log
+ if (msg == NULL){
+ EXPECT_FALSE("msg == NULL", TRUE);
+ break;
+ }
+ if (msg->address != msg->evtID){
+ EXPECT_FALSE("msg->address != msg->evtID", TRUE);
+ break;
+ }
+ if (msg->address != i){
+ EXPECT_FALSE("msg->address != i", TRUE);
+ break;
+ }
+ }
+ EXPECT_EQUAL_INT32("i==MAX", MAX, i);
+ }
+}
+
+void TestEtMessageQueue_runSuite(void){
+ etUnit_openTestSuite("TestEtMessageQueue");
+ ADD_TESTCASE(TestEtMessageQueue_testPushPop);
+ ADD_TESTCASE(TestEtMessageQueue_testMassiveMessaging);
+ etUnit_closeTestSuite();
+}
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageService.h b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageService.h
index b8925ebdd..22bd62dc5 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageService.h
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtMessageService.h
@@ -1,21 +1,21 @@
-/*******************************************************************************
- * 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)
- *
- *******************************************************************************/
-
-#ifndef _TESTRMESSAGESERVICE_H_
-#define _TESTRMESSAGESERVICE_H_
-
-#include "messaging/etMessageService.h"
-
-void TestEtMessageService_runSuite(void);
-
-
-#endif /* _TESTRMESSAGESERVICE_H_ */
+/*******************************************************************************
+ * 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)
+ *
+ *******************************************************************************/
+
+#ifndef _TESTRMESSAGESERVICE_H_
+#define _TESTRMESSAGESERVICE_H_
+
+#include "messaging/etMessageService.h"
+
+void TestEtMessageService_runSuite(void);
+
+
+#endif /* _TESTRMESSAGESERVICE_H_ */
diff --git a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtUnit.c b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtUnit.c
index 42359c26a..f69abb441 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtUnit.c
+++ b/tests/org.eclipse.etrice.generator.c.tests/src/test/runtime/TestEtUnit.c
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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)
- *
- *******************************************************************************/
-
-
-/*
- * TestEtUnit.c
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-#include "TestEtUnit.h"
-#include "etUnit/etUnit.h"
-
-void TestEtUnit_Expect(void){
- EXPECT_TRUE("EXPECT_TRUE", TRUE);
- EXPECT_FALSE("EXPECT_FALSE", FALSE);
-
- /* signed integer values */
- EXPECT_EQUAL_INT8("EXPECT_EQUAL_INT8", -123, -123);
- EXPECT_EQUAL_INT16("EXPECT_EQUAL_INT16", -12345, -12345);
- EXPECT_EQUAL_INT32("EXPECT_EQUAL_INT32", -1234567, -1234567);
-
- /* unsigned integer values */
- EXPECT_EQUAL_UINT8("EXPECT_EQUAL_INT8", 123, 123);
- EXPECT_EQUAL_UINT16("EXPECT_EQUAL_INT16", 12345, 12345);
- EXPECT_EQUAL_UINT32("EXPECT_EQUAL_INT32", 1234567, 1234567);
-
- /* float values */
- EXPECT_EQUAL_FLOAT32("EXPECT_EQUAL_FLOAT32", (etFloat32) 123.456, (etFloat32) 123.456, (etFloat32) 0.0001);
- EXPECT_EQUAL_FLOAT32("EXPECT_EQUAL_FLOAT32", (etFloat32) 123.456, (etFloat32) 123.456, (etFloat32) 0.0001);
-
- /* Pointers */
- etUInt16 value;
- etUInt16* valuePtr = &value;
-
- EXPECT_EQUAL_PTR("EXPECT_EQUAL_PTR", &value, valuePtr) \
-
-}
-
-
-void TestEtUnit_Expect_Order(void){
- etInt16 list[] = {1,2,3,4};
- EXPECT_ORDER_START(list, 4);
- EXPECT_ORDER("id=1", 1);
- EXPECT_ORDER("id=2", 2);
- EXPECT_ORDER("id=3", 3);
- EXPECT_ORDER_END("id=4", 4);
-}
-
-void TestEtUnit_runSuite(void){
- etUnit_openTestSuite("TestEtUnit");
- ADD_TESTCASE(TestEtUnit_Expect_Order);
- ADD_TESTCASE(TestEtUnit_Expect);
- etUnit_closeTestSuite();
-}
-
-
+/*******************************************************************************
+ * 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)
+ *
+ *******************************************************************************/
+
+
+/*
+ * TestEtUnit.c
+ *
+ * Created on: 16.01.2012
+ * Author: tschuetz
+ */
+
+#include "TestEtUnit.h"
+#include "etUnit/etUnit.h"
+
+void TestEtUnit_Expect(void){
+ EXPECT_TRUE("EXPECT_TRUE", TRUE);
+ EXPECT_FALSE("EXPECT_FALSE", FALSE);
+
+ /* signed integer values */
+ EXPECT_EQUAL_INT8("EXPECT_EQUAL_INT8", -123, -123);
+ EXPECT_EQUAL_INT16("EXPECT_EQUAL_INT16", -12345, -12345);
+ EXPECT_EQUAL_INT32("EXPECT_EQUAL_INT32", -1234567, -1234567);
+
+ /* unsigned integer values */
+ EXPECT_EQUAL_UINT8("EXPECT_EQUAL_INT8", 123, 123);
+ EXPECT_EQUAL_UINT16("EXPECT_EQUAL_INT16", 12345, 12345);
+ EXPECT_EQUAL_UINT32("EXPECT_EQUAL_INT32", 1234567, 1234567);
+
+ /* float values */
+ EXPECT_EQUAL_FLOAT32("EXPECT_EQUAL_FLOAT32", (etFloat32) 123.456, (etFloat32) 123.456, (etFloat32) 0.0001);
+ EXPECT_EQUAL_FLOAT32("EXPECT_EQUAL_FLOAT32", (etFloat32) 123.456, (etFloat32) 123.456, (etFloat32) 0.0001);
+
+ /* Pointers */
+ etUInt16 value;
+ etUInt16* valuePtr = &value;
+
+ EXPECT_EQUAL_PTR("EXPECT_EQUAL_PTR", &value, valuePtr) \
+
+}
+
+
+void TestEtUnit_Expect_Order(void){
+ etInt16 list[] = {1,2,3,4};
+ EXPECT_ORDER_START(list, 4);
+ EXPECT_ORDER("id=1", 1);
+ EXPECT_ORDER("id=2", 2);
+ EXPECT_ORDER("id=3", 3);
+ EXPECT_ORDER_END("id=4", 4);
+}
+
+void TestEtUnit_runSuite(void){
+ etUnit_openTestSuite("TestEtUnit");
+ ADD_TESTCASE(TestEtUnit_Expect_Order);
+ ADD_TESTCASE(TestEtUnit_Expect);
+ etUnit_closeTestSuite();
+}
+
+

Back to the top