@@ -4,8 +4,31 @@
* 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));
+
+ while (*s) {
+ if (isdigit(*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_sys_cpu_count(void)
{
@@ -59,6 +82,7 @@ static void test_odp_sys_cpu_hz(void)
}
CU_TestInfo test_odp_system[] = {
+ {"odp version", test_odp_version_numbers},
{"odp_sys_cpu_count", test_odp_sys_cpu_count},
{"odp_sys_cache_line_size", test_odp_sys_cache_line_size},
{"odp_sys_cpu_model_str", test_odp_sys_cpu_model_str},
test for https://bugs.linaro.org/show_bug.cgi?id=1194 Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- test/validation/odp_system.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)