Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2013-04-30 06:20:01 -0400
committerThomas Schuetz2013-04-30 06:20:01 -0400
commit557eaf3819ee03755134775d16ce1a2951e74222 (patch)
tree51412ce0cdf159f18346e83a52a46cfc22394c1a /runtime/org.eclipse.etrice.runtime.c/src/common
parentfe7515af364af304ab279f66225cc9567e157b10 (diff)
downloadorg.eclipse.etrice-557eaf3819ee03755134775d16ce1a2951e74222.tar.gz
org.eclipse.etrice-557eaf3819ee03755134775d16ce1a2951e74222.tar.xz
org.eclipse.etrice-557eaf3819ee03755134775d16ce1a2951e74222.zip
[runtime.c.tests] added testcases for etTimeHelpers
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/common')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.c47
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.h45
2 files changed, 44 insertions, 48 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.c b/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.c
index 1aadc102c..82ada3166 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.c
@@ -1,25 +1,22 @@
-/*******************************************************************************
- * Copyright (c) 2013 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 "helpers/etTimeHelpers.h"
-
-void etTimeHelpers_subtract(etTime *first, etTime* second){
- /* TODO: implement */
-}
-
-void etTimeHelpers_add(etTime *first, etTime* second){
- /* TODO: implement */
-}
-
-etInt32 etTimeHelpers_convertToMSec(etTime *time){
- return time->sec * 1000 + time->nSec / 1000000;
-}
+/*******************************************************************************
+ * Copyright (c) 2013 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 "helpers/etTimeHelpers.h"
+
+etInt32 etTimeHelpers_convertToMSec(etTime *time){
+ return time->sec * 1000 + time->nSec / 1000000;
+}
+
+void etTimeHelpers_convertToEtTime(etTime *result, etInt32 milliSeconds){
+ result->sec = milliSeconds/1000;
+ result->nSec = milliSeconds%1000 * 1000000;
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.h b/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.h
index 71f20e4ce..c7aa1a49a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/helpers/etTimeHelpers.h
@@ -1,23 +1,22 @@
-/*******************************************************************************
- * Copyright (c) 2013 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 ETTIMEHELPERS_H_
-#define ETTIMEHELPERS_H_
-
-#include "osal/etTime.h"
-
-void etTime_subtract(etTime *self, etTime* subtractValue);
-void etTime_add(etTime *self, etTime* addValue);
-etInt32 etTimeHelpers_convertToMSec(etTime *time);
-
-
-#endif /* ETTIMEHELPERS_H_ */
+/*******************************************************************************
+ * Copyright (c) 2013 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 _ETTIMEHELPERS_H_
+#define _ETTIMEHELPERS_H_
+
+#include "osal/etTime.h"
+
+etInt32 etTimeHelpers_convertToMSec(etTime *time);
+void etTimeHelpers_convertToEtTime(etTime *result, etInt32 milliSeconds);
+
+
+#endif /* _ETTIMEHELPERS_H_ */

Back to the top