aboutsummaryrefslogtreecommitdiff
path: root/test/validation/api/timer
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2018-02-15 03:04:03 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-02-20 22:19:55 +0300
commiteba4477a5cd5300d608ddfc53ff00cd3e51805a6 (patch)
tree975fc0ecb955773cf6714def076070a6b2c0c34b /test/validation/api/timer
parent3e90ecc0bfa4487a29fbdff7ccc1cf5a2a1e8bc0 (diff)
validation: timer: simplify test infrastructure
Merge separate file with just main() function into main test file. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test/validation/api/timer')
-rw-r--r--test/validation/api/timer/Makefile.am2
-rw-r--r--test/validation/api/timer/timer.c11
-rw-r--r--test/validation/api/timer/timer.h27
-rw-r--r--test/validation/api/timer/timer_main.c14
4 files changed, 6 insertions, 48 deletions
diff --git a/test/validation/api/timer/Makefile.am b/test/validation/api/timer/Makefile.am
index 576174400..bc33e731f 100644
--- a/test/validation/api/timer/Makefile.am
+++ b/test/validation/api/timer/Makefile.am
@@ -1,4 +1,4 @@
include ../Makefile.inc
test_PROGRAMS = timer_main
-timer_main_SOURCES = timer_main.c timer.c timer.h
+timer_main_SOURCES = timer.c
diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c
index 7ea508aa0..26a5b6086 100644
--- a/test/validation/api/timer/timer.c
+++ b/test/validation/api/timer/timer.c
@@ -20,7 +20,6 @@
#include <odp/helper/odph_api.h>
#include "odp_cunit_common.h"
#include "test_debug.h"
-#include "timer.h"
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -56,7 +55,7 @@ struct test_timer {
#define TICK_INVALID (~(uint64_t)0)
-void timer_test_timeout_pool_alloc(void)
+static void timer_test_timeout_pool_alloc(void)
{
odp_pool_t pool;
const int num = 3;
@@ -110,7 +109,7 @@ void timer_test_timeout_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-void timer_test_timeout_pool_free(void)
+static void timer_test_timeout_pool_free(void)
{
odp_pool_t pool;
odp_timeout_t tmo;
@@ -141,7 +140,7 @@ void timer_test_timeout_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-void timer_test_odp_timer_cancel(void)
+static void timer_test_odp_timer_cancel(void)
{
odp_pool_t pool;
odp_pool_param_t params;
@@ -504,7 +503,7 @@ static int worker_entrypoint(void *arg TEST_UNUSED)
}
/* @private Timer test case entrypoint */
-void timer_test_odp_timer_all(void)
+static void timer_test_odp_timer_all(void)
{
int rc;
odp_pool_param_t params;
@@ -630,7 +629,7 @@ odp_suiteinfo_t timer_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int timer_main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
/* parse common options: */
if (odp_cunit_parse_options(argc, argv))
diff --git a/test/validation/api/timer/timer.h b/test/validation/api/timer/timer.h
deleted file mode 100644
index bd304fffd..000000000
--- a/test/validation/api/timer/timer.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef _ODP_TEST_TIMER_H_
-#define _ODP_TEST_TIMER_H_
-
-#include <odp_cunit_common.h>
-
-/* test functions: */
-void timer_test_timeout_pool_alloc(void);
-void timer_test_timeout_pool_free(void);
-void timer_test_odp_timer_cancel(void);
-void timer_test_odp_timer_all(void);
-
-/* test arrays: */
-extern odp_testinfo_t timer_suite[];
-
-/* test registry: */
-extern odp_suiteinfo_t timer_suites[];
-
-/* main test program: */
-int timer_main(int argc, char *argv[]);
-
-#endif
diff --git a/test/validation/api/timer/timer_main.c b/test/validation/api/timer/timer_main.c
deleted file mode 100644
index f65c1e3a0..000000000
--- a/test/validation/api/timer/timer_main.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "config.h"
-
-#include "timer.h"
-
-int main(int argc, char *argv[])
-{
- return timer_main(argc, argv);
-}