Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-04-05 15:38:19 +0000
committerGerrit Code Review @ Eclipse.org2013-04-05 15:38:19 +0000
commitb81d2baedd6d0ea41f4a2b4d75a7a1d4f167bdc5 (patch)
treee96302526c057e0f58bf39bbb04afbe59ad8b88e
parentfdd2e7c1a1d22340d03f2a0cf2ff907433899b7c (diff)
parent0975a61ef1d78b12b1af44db18c976460884812c (diff)
downloadorg.eclipse.etrice-b81d2baedd6d0ea41f4a2b4d75a7a1d4f167bdc5.tar.gz
org.eclipse.etrice-b81d2baedd6d0ea41f4a2b4d75a7a1d4f167bdc5.tar.xz
org.eclipse.etrice-b81d2baedd6d0ea41f4a2b4d75a7a1d4f167bdc5.zip
Merge changes I57c3f5ab,I42cb0df0
* changes: [test.c] fixed StaticConfigTest [runtime.c] added etunit float64 test method
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zipbin689683 -> 688861 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zipbin682584 -> 691559 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zipbin45630 -> 45630 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zipbin3530613 -> 3530305 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zipbin3021330 -> 3056151 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zipbin47583 -> 47583 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zipbin18750 -> 2410419 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zipbin98395 -> 98395 bytes
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c8
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h2
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/make.xml5
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/StaticConfigTest_C.room34
12 files changed, 29 insertions, 20 deletions
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
index 829ee7877..006613567 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
index 38eb33a6f..028f5a34f 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
index 9986bb8f7..5b9aec094 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
index 3523dd932..6b47b1de2 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
index fd8e66bd6..a6870c6d7 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
index b023f4210..a3a94fe18 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
index 8a38957e3..c81b964ee 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zip
Binary files differ
diff --git a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
index cdce5ca4a..27a7f4458 100644
--- a/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
+++ b/plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.java.zip
Binary files differ
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
index d5e0b7d89..3cbc316ce 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
@@ -48,7 +48,7 @@ static OrderInfo etUnit_orderInfo[ETUNIT_ORDER_MAX];
/* forward declarations of private functions */
static void expect_equal_int(etInt16 id, const char* message, etInt32 expected, etInt32 actual, const char* file, int line);
static void expect_equal_uint(etInt16 id, const char* message, etUInt32 expected, etUInt32 actual, const char* file, int line);
-static void expect_equal_float(etInt16 id, const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision, const char* file, int line);
+static void expect_equal_float(etInt16 id, const char* message, etFloat64 expected, etFloat64 actual, etFloat64 precision, const char* file, int line);
static void etUnit_handleExpect(etInt16 id, etBool result, const char *trace, const char* expected, const char* actual, const char* file, int line);
/* public functions */
@@ -206,6 +206,10 @@ void expectEqualFloat32(etInt16 id, const char* message, etFloat32 expected, etF
expect_equal_float(id, message, expected, actual, precision, file, line);
}
+void expectEqualFloat64(etInt16 id, const char* message, etFloat64 expected, etFloat64 actual, etFloat64 precision, const char* file, int line) {
+ expect_equal_float(id, message, expected, actual, precision, file, line);
+}
+
static OrderInfo* getOrderInfo(etInt16 id) {
int i;
for (i=0; i<ETUNIT_ORDER_MAX; ++i)
@@ -296,7 +300,7 @@ static void expect_equal_uint(etInt16 id, const char* message, etUInt32 expected
}
-static void expect_equal_float(etInt16 id, const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision, const char* file, int line) {
+static void expect_equal_float(etInt16 id, const char* message, etFloat64 expected, etFloat64 actual, etFloat64 precision, const char* file, int line) {
if (expected - actual < -precision || expected - actual > precision) {
char testresult[ETUNIT_FAILURE_TEXT_LEN];
char exp[16], act[16];
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
index 9f6782f3c..8e896441f 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
@@ -47,6 +47,7 @@ void etUnit_closeAll(etInt16 id);
/* float values */
#define EXPECT_EQUAL_FLOAT32(id, msg, expected, actual, precision) expectEqualFloat32(id, msg, expected, actual, precision, __FILE__, __LINE__)
+#define EXPECT_EQUAL_FLOAT64(id, msg, expected, actual, precision) expectEqualFloat64(id, msg, expected, actual, precision, __FILE__, __LINE__)
/* Pointers */
#define EXPECT_EQUAL_PTR(id, msg, expected, actual) \
@@ -76,6 +77,7 @@ void expectEqualUInt8(etInt16 id, const char* msg, etUInt8 expected, etUInt8 act
void expectEqualUInt16(etInt16 id, const char* msg, etUInt16 expected, etUInt16 actual, const char* file, int line);
void expectEqualUInt32(etInt16 id, const char* msg, etUInt32 expected, etUInt32 actual, const char* file, int line);
void expectEqualFloat32(etInt16 id, const char* msg, etFloat32 expected, etFloat32 actual, etFloat32 precision, const char* file, int line);
+void expectEqualFloat64(etInt16 id, const char* msg, etFloat64 expected, etFloat64 actual, etFloat64 precision, const char* file, int line);
void expect_equal_void_ptr(etInt16 id, const char* msg, const void* expected, const void* actual, const char* file, int line);
void expectOrderStart(etInt16 id, etInt16* list, etInt16 size, const char* file, int line);
void expectOrder(etInt16 id, const char* msg, etInt16 identifier, const char* file, int line);
diff --git a/tests/org.eclipse.etrice.generator.c.tests/make.xml b/tests/org.eclipse.etrice.generator.c.tests/make.xml
index 84de120f0..34e52ac6a 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/make.xml
+++ b/tests/org.eclipse.etrice.generator.c.tests/make.xml
@@ -450,14 +450,13 @@
<classpath refid="clspath"/>
</java>
- <!-- TODO: jh
+
<java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
<arg value="-suite"/>
<arg value="org.eclipse.etrice.generator.c.tests.StaticConfigTest"/>
<arg value="./tmp/StaticConfigTest.etu"/>
<classpath refid="clspath"/>
</java>
- -->
<java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
<arg value="-suite"/>
@@ -474,9 +473,7 @@
<move file="./tmp/HandlerTest.xml" tofile="./tmp/CHandlerTest.xml"/>
<move file="./tmp/ChoicePointTest.xml" tofile="./tmp/CChoicePointTest.xml"/>
<move file="./tmp/SendingDataTestC.xml" tofile="./tmp/CSendingDataTest.xml"/>
- <!-- TODO: jh
<move file="./tmp/StaticConfigTest.xml" tofile="./tmp/CStaticConfigTest.xml"/>
- -->
<move file="./tmp/DataDrivenTest.xml" tofile="./tmp/CDataDrivenTest.xml"/>
<copy todir="${test.results}" >
<fileset dir="./tmp">
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/StaticConfigTest_C.room b/tests/org.eclipse.etrice.generator.common.tests/models/StaticConfigTest_C.room
index ee2ad8c2b..2d19592a8 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/StaticConfigTest_C.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/StaticConfigTest_C.room
@@ -92,7 +92,7 @@ RoomModel StaticConfigTest {
"EXPECT_TRUE(caseId,\"testee_1:data_1:4\", data_1.int32_c == 96);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:5\", data_1.int64_c == 192);"
"EXPECT_EQUAL_FLOAT32(caseId,\"testee_1:data_1:6\", 9.6f, data_1.float32_c, 0.1f);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:7\", data_1.float64_c == 19.2);"
+ "EXPECT_EQUAL_FLOAT64(caseId,\"testee_1:data_1:7\", 19.2, data_1.float64_c, 0.1);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:8\", data_1.char_c == \'C\');"
"EXPECT_TRUE(caseId,\"testee_1:varCheck:8.1\", strcmp(data_1.string_c, \":)\") == 0 );"
"EXPECT_TRUE(caseId,\"testee_1:data_1:10\", data_1.bool_i);"
@@ -101,7 +101,7 @@ RoomModel StaticConfigTest {
"EXPECT_TRUE(caseId,\"testee_1:data_1:13\", data_1.int32_i == 8);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:14\", data_1.int64_i == 16);"
"EXPECT_EQUAL_FLOAT32(caseId,\"testee_1:data_1:15\", 1.6f, data_1.float32_i, 0.1f);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:16\", data_1.float64_i == 3.2);"
+ "EXPECT_EQUAL_FLOAT64(caseId,\"testee_1:data_1:16\", 3.2, data_1.float64_i, 0.1);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:17\", data_1.char_i == \'I\');"
"EXPECT_TRUE(caseId,\"testee_1:varCheck:18\", strcmp(data_1.string_i, \":]\") == 0 );"
@@ -111,16 +111,20 @@ RoomModel StaticConfigTest {
"EXPECT_TRUE(caseId,\"testee_1:data_1:21\", data_1.int16_array_c[0] == 48 && data_1.int16_array_c[1] == 96);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:22\", data_1.int32_array_c[0] == 96 && data_1.int32_array_c[1] == 192);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:23\", data_1.int64_array_c[0] == 192 && data_1.int64_array_c[1] == 384);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:24\", data_1.float32_array_c[0] == 9.6f && data_1.float32_array_c[1] == 9.6f);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:25\", data_1.float64_array_c[0] == 19.2 && data_1.float64_array_c[1] == 19.2);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"testee_1:data_1:24_1\", 9.6f, data_1.float32_array_c[0], 0.1f);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"testee_1:data_1:24_2\", 9.6f, data_1.float32_array_c[1], 0.1f);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"testee_1:data_1:25_1\", 19.2, data_1.float64_array_c[0], 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"testee_1:data_1:25_2\", 19.2, data_1.float64_array_c[1], 0.1);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:26\", strcmp(data_1.char_array_c, \"Claz\") == 0);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:27\", data_1.bool_array_i[0] == TRUE && data_1.bool_array_i[1] == TRUE);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:28\", data_1.int8_array_i[0] == 2 && data_1.int8_array_i[1] == 6);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:29\", data_1.int16_array_i[0] == 4 && data_1.int16_array_i[1] == 12);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:30\", data_1.int32_array_i[0] == 8 && data_1.int32_array_i[1] == 24);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:31\", data_1.int64_array_i[0] == 16 && data_1.int64_array_i[1] == 48);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:32\", data_1.float32_array_i[0] == 1.6f && data_1.float32_array_i[1] == 1.6f);"
- "EXPECT_TRUE(caseId,\"testee_1:data_1:33\", data_1.float64_array_i[0] == 3.2 && data_1.float64_array_i[1] == 3.2);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"testee_1:data_1:32_1\", 1.6f, data_1.float32_array_i[0], 0.1f);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"testee_1:data_1:32_2\", 1.6f, data_1.float32_array_i[1], 0.1f);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"testee_1:data_1:33_1\", 3.2, data_1.float64_array_i[0], 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"testee_1:data_1:33_2\", 3.2, data_1.float64_array_i[1], 0.1);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:34\", strcmp(data_1.char_array_i, \"Inst\") == 0);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:35\", data_1.data_2.int32_c == 42);"
"EXPECT_TRUE(caseId,\"testee_1:data_1:36\", data_1.data_2.int32_i == 43);"
@@ -159,9 +163,9 @@ RoomModel StaticConfigTest {
Behavior {
Operation Testee_Super2_ac() {
"caseId = etUnit_openTestCase(\"AttrConfigTest_case_Testee_Super2_ac\");"
- "EXPECT_TRUE(caseId, \"Testee_Super2_ac:1\", float64_super_r == 1.1);"
- "EXPECT_TRUE(caseId, \"Testee_Super2_ac:2\", float64_super_c == 2.2);"
- "EXPECT_TRUE(caseId, \"Testee_Super2_ac:3\", float64_super_i == 3.3);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Testee_Super2_ac:1\", 1.1, float64_super_r, 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Testee_Super2_ac:2\", 2.2, float64_super_c, 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Testee_Super2_ac:3\", 3.3, float64_super_i, 0.1);"
// reg_port
"EXPECT_EQUAL_FLOAT32(caseId, \"Testee_Super2_ac:5\", 4.0f, ((TestProtocolAttributesPort_var*) self->constData->reg_port.varData)->float_r, 0.1f);"
@@ -194,8 +198,8 @@ RoomModel StaticConfigTest {
State s1 {
entry {
- "EXPECT_TRUE(caseId, \"Testee_2_ac:1\", float64_super_c == 2.2);"
- "EXPECT_TRUE(caseId, \"Testee_2_ac:2\", float64_super_i == 4.4);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Testee_2_ac:1\", 2.2, float64_super_c, 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Testee_2_ac:2\", 4.4, float64_super_i, 0.1);"
"EXPECT_TRUE(caseId, \"Testee_2_ac:3\", int32_own_r == 11);"
"EXPECT_TRUE(caseId, \"Testee_2_ac:4\", int32_own_c == 12);"
"EXPECT_TRUE(caseId, \"Testee_2_ac:5\", int32_own_i == 13);"
@@ -333,7 +337,7 @@ RoomModel StaticConfigTest {
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:4\", int32_r == 32);"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:5\", int64_r == 64);"
"EXPECT_EQUAL_FLOAT32(caseId,\"Data_1_dc:varCheck:6\", 3.2f, float32_r, 0.1f);"
- "EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:7\", float64_r == 6.4);"
+ "EXPECT_EQUAL_FLOAT64(caseId,\"Data_1_dc:varCheck:7\", 6.4, float64_r, 0.1);"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:8\", char_r == \'R\');"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:8\", strcmp(string_r, \":/\") == 0 );"
@@ -343,8 +347,10 @@ RoomModel StaticConfigTest {
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:12\", int16_array_r[0] == 16 && int16_array_r[1] == 32);"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:13\", int32_array_r[0] == 32 && int32_array_r[1] == 64);"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:24\", int64_array_r[0] == 64 && int64_array_r[1] == 128);"
- "EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:25\", float32_array_r[0] == 3.2f && float32_array_r[1] == 6.4f);"
- "EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:26\", float64_array_r[0] == 6.4 && float64_array_r[1] == 12.8);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"Data_1_dc:varCheck:25_1\", 3.2f, float32_array_r[0], 0.1f);"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"Data_1_dc:varCheck:25_2\", 6.4f, float32_array_r[1], 0.1f);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Data_1_dc:varCheck:26_1\", 6.4, float64_array_r[0], 0.1);"
+ "EXPECT_EQUAL_FLOAT64(caseId, \"Data_1_dc:varCheck:26_2\", 12.8, float64_array_r[1], 0.1);"
"EXPECT_TRUE(caseId,\"Data_1_dc:varCheck:27\", strcmp(char_array_r, \"ROOM\")==0);"
}
}

Back to the top