Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2017-09-15 08:21:23 +0000
committerJuergen Haug2017-09-15 09:02:45 +0000
commit8717d9195225478e83e7ac8554e78c96b9d98991 (patch)
tree5a38662e396490551b0ef27c4547a04fd01dbdfd /runtime
parent3e4147f26230e0776bd5710da57541a5f8c31294 (diff)
downloadorg.eclipse.etrice-8717d9195225478e83e7ac8554e78c96b9d98991.tar.gz
org.eclipse.etrice-8717d9195225478e83e7ac8554e78c96b9d98991.tar.xz
org.eclipse.etrice-8717d9195225478e83e7ac8554e78c96b9d98991.zip
[etUnit] consistent reset of counters
Diffstat (limited to 'runtime')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c19
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h9
2 files changed, 5 insertions, 23 deletions
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 2dd752a55..77e832b80 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
@@ -21,14 +21,12 @@
/*** member variables */
-static etInt16 etUnit_failedSuites = 0;
-
/* file handling */
static FILE* etUnit_reportfile = NULL;
/* counters */
-static etInt16 etUnit_nextCaseId = 1;
-static etInt32 etUnit_errorCounter = 0;
+static etInt16 etUnit_nextCaseId;
+static etInt32 etUnit_errorCounter;
#define ETUNIT_MAX_TEST_CASES 256
static etBool etUnit_testcaseSuccess[ETUNIT_MAX_TEST_CASES];
@@ -104,6 +102,8 @@ void etUnit_open(const char* testResultPath, const char* testFileName) {
etUnit_orderInfo[i].id = 0;
for (i = 0; i < ETUNIT_MAX_TEST_CASES; ++i)
etUnit_testcaseSuccess[i] = ET_TRUE;
+ etUnit_errorCounter = 0;
+ etUnit_nextCaseId = 1;
if (etUnit_reportfile == NULL) {
etUnit_reportfile = etLogger_fopen(filename, "w+");
@@ -133,8 +133,6 @@ void etUnit_close(void) {
else
etLogger_logErrorF("Error Counter: %ld", etUnit_errorCounter);
etLogger_logInfoF("************* TEST END **************");
-
- etUnit_errorCounter = 0;
}
void etUnit_openTestSuite(const char* testSuiteName) {
@@ -144,7 +142,6 @@ void etUnit_openTestSuite(const char* testSuiteName) {
}
void etUnit_closeTestSuite(void) {
- etUnit_failedSuites += (etUnit_isSuccessSuite()) ? 0 : 1;
}
etInt16 etUnit_openTestCase(const char* testCaseName) {
@@ -336,14 +333,6 @@ etBool etUnit_isSuccess(etInt16 id) {
return etUnit_testcaseSuccess[id];
}
-etBool etUnit_isSuccessSuite() {
- return etUnit_errorCounter == 0;
-}
-
-etBool etUnit_isSuccessAll() {
- return etUnit_failedSuites == 0;
-}
-
/* private functions */
static void expect_equal_int(etInt16 id, const char* message, etInt32 expected, etInt32 actual, const char* file, int line) {
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 b29080445..004f2843f 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
@@ -71,14 +71,7 @@ void etUnit_closeTestCase(etInt16 id);
* \param id the test case id
*/
etBool etUnit_isSuccess(etInt16 id);
-/**
- * indicate success of current test suite
- */
-etBool etUnit_isSuccessSuite();
-/**
- * indicate success of all test suites
- */
-etBool etUnit_isSuccessAll();
+
/**
* releases the \ref etRuntime_getTerminateSemaphore() and thus makes the program terminate
*

Back to the top