Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2012-01-30 10:05:42 -0500
committerThomas Schuetz2012-01-30 10:05:42 -0500
commitd5afc9c0c42138ac147199ae60193899953869cb (patch)
treec27b93e12a6cd508f5486a1a2a78f064663f3469 /examples/org.eclipse.etrice.generator.c.reference
parent17c0786b480e757f538d5e334e6e5c93f6751a4a (diff)
downloadorg.eclipse.etrice-d5afc9c0c42138ac147199ae60193899953869cb.tar.gz
org.eclipse.etrice-d5afc9c0c42138ac147199ae60193899953869cb.tar.xz
org.eclipse.etrice-d5afc9c0c42138ac147199ae60193899953869cb.zip
[generator.c.tests] moved testcases for C-generator to generator.c.tests
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c44
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c30
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h26
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.c67
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h26
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c49
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h26
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c45
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h20
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c99
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h18
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c116
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h21
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.c67
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.h26
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCGenerator.xml6
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCRuntime.xml18
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestEtUnitSpecial.xml5
18 files changed, 0 insertions, 709 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c b/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
deleted file mode 100644
index 242a53d14..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/RunAllTestcases.c
+++ /dev/null
@@ -1,44 +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 "test/generator/RunCGeneratorTestcases.h"
-#include "test/runtime/RunCRuntimeTestcases.h"
-
-void runTestCases(void);
-
-#include "test/experiments/test.h"
-void runROMTest(void);
-
-int main(void){
- runTestCases();
- return 0;
-}
-
-
-void runTestCases(void){
- RunCGeneratorTestcases();
- RunCRuntimeTestcases();
- runROMTest();
-}
-
-void runROMTest(void){
-
- if (Actor1.constData == &Actor1_const){
- printf("OK\n");
- }
- if (Actor1_const.actor == &Actor1){
- printf("OK\n");
- }
-}
-
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
deleted file mode 100644
index cf2d11e9c..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.c
+++ /dev/null
@@ -1,30 +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)
- *
- *******************************************************************************/
-
-/*
- * RunCGeneratorTestcases.c
- *
- * Created on: 12.01.2012
- * Author: tschuetz
- */
-
-#include "RunCGeneratorTestcases.h"
-
-#include "TestDataClass.h"
-#include "etUnit.h"
-
-
-void RunCGeneratorTestcases(void){
- etUnit_open("tmp/testlog","TestCGenerator");
- TestDataClass_runSuite();
- etUnit_close();
-}
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
deleted file mode 100644
index 03d5c4276..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/RunCGeneratorTestcases.h
+++ /dev/null
@@ -1,26 +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)
- *
- *******************************************************************************/
-
-
-/*
- * 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
deleted file mode 100644
index e3c521dd3..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.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)
- *
- *******************************************************************************/
-
-
-/*
- * TestDataClass.c
- *
- * Created on: 12.01.2012
- * Author: tschuetz
- */
-
-
-#include "TestDataClass.h"
-
-#include "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/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
deleted file mode 100644
index 3cbce4bc1..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/generator/TestDataClass.h
+++ /dev/null
@@ -1,26 +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)
- *
- *******************************************************************************/
-
-
-/*
- * 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
deleted file mode 100644
index a9a502f3b..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.c
+++ /dev/null
@@ -1,49 +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)
- *
- *******************************************************************************/
-
-
-/*
- * 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.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/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
deleted file mode 100644
index 5d17f7ddb..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/RunCRuntimeTestcases.h
+++ /dev/null
@@ -1,26 +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)
- *
- *******************************************************************************/
-
-
-/*
- * 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/runtime/TestEtMessage.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
deleted file mode 100644
index c360b0a84..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.c
+++ /dev/null
@@ -1,45 +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 "TestEtMessage.h"
-
-#include <stddef.h>
-#include "etUnit.h"
-#include "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/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h
deleted file mode 100644
index 67b45e4e1..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessage.h
+++ /dev/null
@@ -1,20 +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)
- *
- *******************************************************************************/
-
-#ifndef _TESTMESSAGE_H_
-#define _TESTMESSAGE_H_
-
-
-void TestEtMessage_runSuite(void);
-
-
-#endif /* _TESTMESSAGE_H_ */
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
deleted file mode 100644
index 3a453962c..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.c
+++ /dev/null
@@ -1,99 +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 "TestEtMessageQueue.h"
-#include "etUnit.h"
-#include "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/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h
deleted file mode 100644
index afceea8f8..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageQueue.h
+++ /dev/null
@@ -1,18 +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)
- *
- *******************************************************************************/
-
-#ifndef _TESTRMESSAGEQUEUE_H_
-#define _TESTRMESSAGEQUEUE_H_
-
-void TestEtMessageQueue_runSuite(void);
-
-#endif /* _TESTRMESSAGEQUEUE_H_ */
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
deleted file mode 100644
index 1d8b6cce8..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.c
+++ /dev/null
@@ -1,116 +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 "TestEtMessageService.h"
-#include "etUnit.h"
-#include "etMessageService.h"
-
-
-void TestEtMessageService_init(void){
-
- etMessageService msgService;
- uint16 max = 6;
- uint16 blockSize = 32;
-
- uint8 msgBuffer[max*blockSize];
-
- etMessageService_init(&msgService, msgBuffer, max, blockSize);
-
- EXPECT_EQUAL_PTR("msgService.messagePool.first", msgBuffer, msgService.messagePool.first);
- EXPECT_EQUAL_PTR("msgService.messagePool in between", &msgBuffer[3*blockSize], msgService.messagePool.first->next->next->next);
- EXPECT_EQUAL_PTR("msgService.messagePool.last(1)", &msgBuffer[5*blockSize], msgService.messagePool.first->next->next->next->next->next);
- EXPECT_EQUAL_PTR("msgService.messagePool.last(2)", &msgBuffer[5*blockSize], msgService.messagePool.last);
- EXPECT_EQUAL_PTR("msgService.messagePool.last.next", 0, msgService.messagePool.last->next);
-
-}
-
-void TestEtMessageService_GetPushPopReturn(void){
-
- etMessageService msgService;
- uint16 max = 6;
- uint16 blockSize = 32;
- uint8 msgBuffer[max*blockSize];
-
- etMessageService_init(&msgService, msgBuffer, max, blockSize);
-
- // get messages from pool
- etMessage* msg1 = etMessageService_getMessageBuffer(&msgService, sizeof(etMessage));
- etMessage* msg2 = etMessageService_getMessageBuffer(&msgService, sizeof(etMessage));
-
- EXPECT_EQUAL_INT16("msgService.messagePool.size", 4, msgService.messagePool.size);
-
- // define content
- msg1->address = 11;
- msg1->evtID = 111;
- msg2->address = 22;
- msg2->evtID = 222;
-
- // push messages to queue
- etMessageService_pushMessage(&msgService, msg2);
- etMessageService_pushMessage(&msgService, msg1);
-
- EXPECT_EQUAL_INT16("msgService.messageQueue.size", 2, msgService.messageQueue.size);
-
- // pop messages from queue
- etMessage* rcvMsg1 = etMessageService_popMessage(&msgService);
- etMessage* rcvMsg2 = etMessageService_popMessage(&msgService);
-
- EXPECT_EQUAL_INT16("msgService.messageQueue.size",0, msgService.messageQueue.size);
-
-
- EXPECT_EQUAL_INT16("msgService.popMessage", 22, rcvMsg1->address);
- EXPECT_EQUAL_INT16("msgService.popMessage", 222, rcvMsg1->evtID);
- EXPECT_EQUAL_INT16("msgService.popMessage", 11, rcvMsg2->address);
- EXPECT_EQUAL_INT16("msgService.popMessage", 111, rcvMsg2->evtID);
-
- etMessageService_returnMessageBuffer(&msgService, rcvMsg1);
- etMessageService_returnMessageBuffer(&msgService, rcvMsg2);
-
- EXPECT_EQUAL_INT16("msgService.messagePool.size", 6, msgService.messagePool.size);
-
-}
-
-void TestEtMessageService_GetReturn(void){
-
- etMessageService msgService;
- uint16 max = 2;
- uint16 blockSize = 32;
- uint8 msgBuffer[max*blockSize];
-
- etMessageService_init(&msgService, msgBuffer, max, blockSize);
-
- // get on message too much from pool
- etMessage* msg1 = etMessageService_getMessageBuffer(&msgService, sizeof(etMessage));
- etMessage* msg2 = etMessageService_getMessageBuffer(&msgService, sizeof(etMessage));
- etMessage* msg3 = etMessageService_getMessageBuffer(&msgService, sizeof(etMessage));
- EXPECT_TRUE("msgService getMessageBuffer", msg1!=NULL);
- EXPECT_TRUE("msgService getMessageBuffer", msg2!=NULL);
- EXPECT_EQUAL_PTR("msgService getMessageBuffer", msg3, NULL);
-
- // return messages
- etMessageService_returnMessageBuffer(&msgService, msg1);
- etMessageService_returnMessageBuffer(&msgService, msg2);
- EXPECT_EQUAL_INT16("msgService.messagePool.size", 2, msgService.messagePool.size);
-
- // get message bigger than blocksize
- etMessage* msg4 = etMessageService_getMessageBuffer(&msgService, 33);
- EXPECT_EQUAL_PTR("msgService getMessageBuffer", msg4, NULL);
-
-}
-
-void TestEtMessageService_runSuite(void){
- etUnit_openTestSuite("TestEtMessageService");
- ADD_TESTCASE(TestEtMessageService_init);
- ADD_TESTCASE(TestEtMessageService_GetPushPopReturn);
- ADD_TESTCASE(TestEtMessageService_GetReturn);
- etUnit_closeTestSuite();
-}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h
deleted file mode 100644
index 43a85baee..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtMessageService.h
+++ /dev/null
@@ -1,21 +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)
- *
- *******************************************************************************/
-
-#ifndef _TESTRMESSAGESERVICE_H_
-#define _TESTRMESSAGESERVICE_H_
-
-#include "etMessageService.h"
-
-void TestEtMessageService_runSuite(void);
-
-
-#endif /* _TESTRMESSAGESERVICE_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.c b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.c
deleted file mode 100644
index 3f01d0587..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.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)
- *
- *******************************************************************************/
-
-
-/*
- * TestEtUnit.c
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-#include "TestEtUnit.h"
-#include "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_FLOAT64("EXPECT_EQUAL_FLOAT64", (etFloat64) 123.456, (etFloat64) 123.456, (etFloat64) 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();
-}
-
-
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.h b/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.h
deleted file mode 100644
index e591d27ef..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src/test/runtime/TestEtUnit.h
+++ /dev/null
@@ -1,26 +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)
- *
- *******************************************************************************/
-
-
-/*
- * TestEtUnit.h
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-#ifndef _TESTETUNIT_H_
-#define _TESTETUNIT_H_
-
-void TestEtUnit_runSuite(void);
-
-#endif /* _TESTETUNIT_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCGenerator.xml b/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCGenerator.xml
deleted file mode 100644
index 160ccd2bf..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCGenerator.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<testsuites name="TestCGenerator" tests="0" failures="0" errors="0" time="0">
- <testsuite name="TestDataClass" tests="0" failures="0" errors="0" time="0">
- <testcase name="TestDataClass_Operations" time="0"/>
- <testcase name="TestDataClass_testDataClassDeepCopy" time="0"/>
- </testsuite>
-</testsuites>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCRuntime.xml b/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCRuntime.xml
deleted file mode 100644
index a5a4ad3d9..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestCRuntime.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<testsuites name="TestCRuntime" tests="0" failures="0" errors="0" time="0">
- <testsuite name="TestMessage" tests="0" failures="0" errors="0" time="0">
- <testcase name="TestEtMessage_testBasicMessage" time="0"/>
- </testsuite>
- <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="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>
- <testsuite name="TestEtUnit" tests="0" failures="0" errors="0" time="0">
- <testcase name="TestEtUnit_Expect_Order" time="0"/>
- <testcase name="TestEtUnit_Expect" time="0"/>
- </testsuite>
-</testsuites>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestEtUnitSpecial.xml b/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestEtUnitSpecial.xml
deleted file mode 100644
index f319d0648..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/tmp/testlog/TestEtUnitSpecial.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<testsuites name="TestEtUnitSpecial" tests="0" failures="0" errors="0" time="0">
- <testsuite name="etUnit" tests="0" failures="0" errors="0" time="0">
- <testcase name="openAll and closeAll" time="0"/>
- </testsuite>
-</testsuites>

Back to the top