diff options
author | Christophe Milard <christophe.milard@linaro.org> | 2015-06-19 18:11:53 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-06-30 16:49:12 +0300 |
commit | 599577a290dca695cfebc01f42a7d2a6e2ef2644 (patch) | |
tree | 5367703a7340a4a5dfd16e8683855174f2e9bbf4 /test/validation/random | |
parent | 2465dade60c84b0d039924dad260003f089b3ffe (diff) |
validation: creating own dir and lib for random
Module random now gets its own directory and create its own lib
(currentely only containing its executable)
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test/validation/random')
-rw-r--r-- | test/validation/random/.gitignore | 2 | ||||
-rw-r--r-- | test/validation/random/Makefile.am | 8 | ||||
-rw-r--r-- | test/validation/random/random.c | 36 | ||||
-rw-r--r-- | test/validation/random/random.h | 7 | ||||
-rw-r--r-- | test/validation/random/random_main.c | 12 |
5 files changed, 65 insertions, 0 deletions
diff --git a/test/validation/random/.gitignore b/test/validation/random/.gitignore new file mode 100644 index 000000000..5ae7ebfe8 --- /dev/null +++ b/test/validation/random/.gitignore @@ -0,0 +1,2 @@ +random_main +librandom.a diff --git a/test/validation/random/Makefile.am b/test/validation/random/Makefile.am new file mode 100644 index 000000000..2f3954729 --- /dev/null +++ b/test/validation/random/Makefile.am @@ -0,0 +1,8 @@ +include ../Makefile.inc + +noinst_LIBRARIES = librandom.a +librandom_a_SOURCES = random.c + +bin_PROGRAMS = random_main$(EXEEXT) +dist_random_main_SOURCES = random_main.c +random_main_LDADD = librandom.a $(LIBCUNIT_COMMON) $(LIBODP) diff --git a/test/validation/random/random.c b/test/validation/random/random.c new file mode 100644 index 000000000..a42523faf --- /dev/null +++ b/test/validation/random/random.c @@ -0,0 +1,36 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp.h> +#include <odp_cunit_common.h> +#include "random.h" + +/* Helper macro for CU_TestInfo initialization */ +#define _CU_TEST_INFO(test_func) {#test_func, test_func} + +static void random_test_get_size(void) +{ + int32_t ret; + uint8_t buf[32]; + + ret = odp_random_data(buf, sizeof(buf), false); + CU_ASSERT(ret == sizeof(buf)); +} + +static CU_TestInfo random_suite[] = { + _CU_TEST_INFO(random_test_get_size), + CU_TEST_INFO_NULL, +}; + +static CU_SuiteInfo random_suites[] = { + {"Random", NULL, NULL, NULL, NULL, random_suite}, + CU_SUITE_INFO_NULL, +}; + +int random_main(void) +{ + return odp_cunit_run(random_suites); +} diff --git a/test/validation/random/random.h b/test/validation/random/random.h new file mode 100644 index 000000000..c40ee1f33 --- /dev/null +++ b/test/validation/random/random.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +int random_main(void); diff --git a/test/validation/random/random_main.c b/test/validation/random/random_main.c new file mode 100644 index 000000000..36b32f73d --- /dev/null +++ b/test/validation/random/random_main.c @@ -0,0 +1,12 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "random.h" + +int main(void) +{ + return random_main(); +} |