On 2015-04-21 17:26, Mike Holmes wrote:
> Add test cases for APIs in the logical ODP THREAD grouping
>
> Signed-off-by: Mike Holmes <[email protected]>
> ---
> test/validation/.gitignore | 1 +
> test/validation/Makefile.am | 4 +++-
> test/validation/odp_thread.c | 41 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 45 insertions(+), 1 deletion(-)
> create mode 100644 test/validation/odp_thread.c
>
I think the helper tests should be under helper directory
Christophe
> diff --git a/test/validation/.gitignore b/test/validation/.gitignore
> index 01092d1..cd27c92 100644
> --- a/test/validation/.gitignore
> +++ b/test/validation/.gitignore
> @@ -19,3 +19,4 @@ odp_synchronizers
> odp_system
> odp_time
> odp_timer
> +odp_thread
> diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
> index 4c28325..6bac101 100644
> --- a/test/validation/Makefile.am
> +++ b/test/validation/Makefile.am
> @@ -22,7 +22,8 @@ EXECUTABLES = odp_buffer \
> odp_synchronizers \
> odp_time \
> odp_timer \
> - odp_errno
> + odp_errno \
> + odp_thread
>
> COMPILE_ONLY = odp_pktio
>
> @@ -63,3 +64,4 @@ dist_odp_packet_SOURCES = odp_packet.c $(ODP_CU_COMMON)
> dist_odp_pool_SOURCES = odp_pool.c $(ODP_CU_COMMON)
> dist_odp_errno_SOURCES = odp_errno.c $(ODP_CU_COMMON)
> dist_odp_cpumask_SOURCES = odp_cpumask.c $(ODP_CU_COMMON)
> +dist_odp_thread_SOURCES = odp_thread.c $(ODP_CU_COMMON)
> diff --git a/test/validation/odp_thread.c b/test/validation/odp_thread.c
> new file mode 100644
> index 0000000..84db1e7
> --- /dev/null
> +++ b/test/validation/odp_thread.c
> @@ -0,0 +1,41 @@
> +/* Copyright (c) 2015, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#include <odp.h>
> +#include <odp_cunit_common.h>
> +
> +/* Helper macro for CU_TestInfo initialization */
> +#define _CU_TEST_INFO(test_func) {#test_func, test_func}
> +
> +static void test_odp_cpu_id(void)
> +{
> + (void) odp_cpu_id();
> + CU_PASS();
> +}
> +
> +static void test_odp_thread_id(void)
> +{
> + (void) odp_thread_id();
> + CU_PASS();
> +}
> +
> +static void test_odp_thread_count(void)
> +{
> + (void) odp_thread_count();
> + CU_PASS();
> +}
> +
> +CU_TestInfo test_odp_thread[] = {
> + _CU_TEST_INFO(test_odp_cpu_id),
> + _CU_TEST_INFO(test_odp_thread_id),
> + _CU_TEST_INFO(test_odp_thread_count),
> + CU_TEST_INFO_NULL,
> +};
> +
> +CU_SuiteInfo odp_testsuites[] = {
> + {"thread", NULL, NULL, NULL, NULL, test_odp_thread},
> + CU_SUITE_INFO_NULL,
> +};
> --
> 2.1.0
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp