diff mbox

[1/6] validation: single src for odp_ver_abt_log_dbg

Message ID 1435924179-30967-2-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 51082e89a0e275752c56cf8a3063afcc0f0875c6
Headers show

Commit Message

Christophe Milard July 3, 2015, 11:49 a.m. UTC
ODP API module odp_ver_abt_log_dbg used to contain both
tests for Errno and System, and was therefore originaly split
in 3 main source files (Errno, system, and a main).
As Errno tests have now been separated, there is no reason for having two
source files any longer. This patch just concatenate the system tests
(system.c) and the main (odp_ver_abt_log_dbg.c) in the main,
so that a single source file remains.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/Makefile.am                        |  3 +-
 test/validation/ver_abt_log_dbg/odp_system.c       | 94 ----------------------
 test/validation/ver_abt_log_dbg/odp_system.h       |  9 ---
 .../ver_abt_log_dbg/odp_ver_abt_log_dbg.c          | 87 +++++++++++++++++++-
 4 files changed, 87 insertions(+), 106 deletions(-)
 delete mode 100644 test/validation/ver_abt_log_dbg/odp_system.c
 delete mode 100644 test/validation/ver_abt_log_dbg/odp_system.h
diff mbox

Patch

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 7add2e6..9fe977e 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -20,8 +20,7 @@  odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_timer_SOURCES  = odp_timer.c
 odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
-dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
-                                    ver_abt_log_dbg/odp_ver_abt_log_dbg.c
+dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_ver_abt_log_dbg.c
 
 ODP_MODULES = buffer \
 	      classification \
diff --git a/test/validation/ver_abt_log_dbg/odp_system.c b/test/validation/ver_abt_log_dbg/odp_system.c
deleted file mode 100644
index 5185a71..0000000
--- a/test/validation/ver_abt_log_dbg/odp_system.c
+++ /dev/null
@@ -1,94 +0,0 @@ 
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-#include <ctype.h>
-#include "odp.h"
-#include "odp_cunit_common.h"
-#include "test_debug.h"
-
-static void test_odp_version_numbers(void)
-{
-	int char_ok;
-	char version_string[128];
-	char *s = version_string;
-
-	strncpy(version_string, odp_version_api_str(),
-		sizeof(version_string)-1);
-
-	while (*s) {
-		if (isdigit((int)*s) || (strncmp(s, ".", 1) == 0)) {
-			char_ok = 1;
-			s++;
-		} else {
-			char_ok = 0;
-			LOG_DBG("\nBAD VERSION=%s\n", version_string);
-			break;
-		}
-	}
-	CU_ASSERT(char_ok);
-}
-
-static void test_odp_cpu_count(void)
-{
-	int cpus;
-
-	cpus = odp_cpu_count();
-	CU_ASSERT(0 < cpus);
-}
-
-static void test_odp_sys_cache_line_size(void)
-{
-	uint64_t cache_size;
-
-	cache_size = odp_sys_cache_line_size();
-	CU_ASSERT(0 < cache_size);
-	CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size);
-}
-
-static void test_odp_sys_cpu_model_str(void)
-{
-	char model[128];
-
-	snprintf(model, 128, "%s", odp_sys_cpu_model_str());
-	CU_ASSERT(strlen(model) > 0);
-	CU_ASSERT(strlen(model) < 127);
-}
-
-static void test_odp_sys_page_size(void)
-{
-	uint64_t page;
-
-	page = odp_sys_page_size();
-	CU_ASSERT(0 < page);
-	CU_ASSERT(ODP_PAGE_SIZE == page);
-}
-
-static void test_odp_sys_huge_page_size(void)
-{
-	uint64_t page;
-
-	page = odp_sys_huge_page_size();
-	CU_ASSERT(0 < page);
-}
-
-static void test_odp_sys_cpu_hz(void)
-{
-	uint64_t hz;
-
-	hz = odp_sys_cpu_hz();
-	CU_ASSERT(0 < hz);
-}
-
-CU_TestInfo test_odp_system[] = {
-	{"odp version",  test_odp_version_numbers},
-	{"odp_cpu_count",  test_odp_cpu_count},
-	{"odp_sys_cache_line_size",  test_odp_sys_cache_line_size},
-	{"odp_sys_cpu_model_str",  test_odp_sys_cpu_model_str},
-	{"odp_sys_page_size",  test_odp_sys_page_size},
-	{"odp_sys_huge_page_size",  test_odp_sys_huge_page_size},
-	{"odp_sys_cpu_hz",  test_odp_sys_cpu_hz},
-	CU_TEST_INFO_NULL,
-};
diff --git a/test/validation/ver_abt_log_dbg/odp_system.h b/test/validation/ver_abt_log_dbg/odp_system.h
deleted file mode 100644
index ce99bed..0000000
--- a/test/validation/ver_abt_log_dbg/odp_system.h
+++ /dev/null
@@ -1,9 +0,0 @@ 
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:	BSD-3-Clause
- */
-
-#include "odp_cunit_common.h"
-
-extern CU_TestInfo test_odp_system[];
diff --git a/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c b/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c
index 59297a6..b462e8d 100644
--- a/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c
+++ b/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c
@@ -4,9 +4,94 @@ 
  * SPDX-License-Identifier:	BSD-3-Clause
  */
 
+#include <ctype.h>
 #include <odp.h>
 #include "odp_cunit_common.h"
-#include "odp_system.h"
+#include "test_debug.h"
+
+static void test_odp_version_numbers(void)
+{
+	int char_ok;
+	char version_string[128];
+	char *s = version_string;
+
+	strncpy(version_string, odp_version_api_str(),
+		sizeof(version_string) - 1);
+
+	while (*s) {
+		if (isdigit((int)*s) || (strncmp(s, ".", 1) == 0)) {
+			char_ok = 1;
+			s++;
+		} else {
+			char_ok = 0;
+			LOG_DBG("\nBAD VERSION=%s\n", version_string);
+			break;
+		}
+	}
+	CU_ASSERT(char_ok);
+}
+
+static void test_odp_cpu_count(void)
+{
+	int cpus;
+
+	cpus = odp_cpu_count();
+	CU_ASSERT(0 < cpus);
+}
+
+static void test_odp_sys_cache_line_size(void)
+{
+	uint64_t cache_size;
+
+	cache_size = odp_sys_cache_line_size();
+	CU_ASSERT(0 < cache_size);
+	CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size);
+}
+
+static void test_odp_sys_cpu_model_str(void)
+{
+	char model[128];
+
+	snprintf(model, 128, "%s", odp_sys_cpu_model_str());
+	CU_ASSERT(strlen(model) > 0);
+	CU_ASSERT(strlen(model) < 127);
+}
+
+static void test_odp_sys_page_size(void)
+{
+	uint64_t page;
+
+	page = odp_sys_page_size();
+	CU_ASSERT(0 < page);
+	CU_ASSERT(ODP_PAGE_SIZE == page);
+}
+
+static void test_odp_sys_huge_page_size(void)
+{
+	uint64_t page;
+
+	page = odp_sys_huge_page_size();
+	CU_ASSERT(0 < page);
+}
+
+static void test_odp_sys_cpu_hz(void)
+{
+	uint64_t hz;
+
+	hz = odp_sys_cpu_hz();
+	CU_ASSERT(0 < hz);
+}
+
+CU_TestInfo test_odp_system[] = {
+	{"odp version",  test_odp_version_numbers},
+	{"odp_cpu_count",  test_odp_cpu_count},
+	{"odp_sys_cache_line_size",  test_odp_sys_cache_line_size},
+	{"odp_sys_cpu_model_str",  test_odp_sys_cpu_model_str},
+	{"odp_sys_page_size",  test_odp_sys_page_size},
+	{"odp_sys_huge_page_size",  test_odp_sys_huge_page_size},
+	{"odp_sys_cpu_hz",  test_odp_sys_cpu_hz},
+	CU_TEST_INFO_NULL,
+};
 
 CU_SuiteInfo odp_testsuites[] = {
 	{"System Info", NULL, NULL, NULL, NULL, test_odp_system},