diff options
author | Christophe Milard <christophe.milard@linaro.org> | 2015-07-02 15:37:46 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-07-09 13:21:51 +0300 |
commit | 18f7a7e3d6a5933b0f156aa3d13204ec8acd90ad (patch) | |
tree | 7e4db8d86b17ec919b95812e356cd2747f6a6fc5 /test/validation/errno | |
parent | 6674b8f64d7eadb5fbf883059f1755a1a4f7f9d8 (diff) |
validation: new module errno
Errno (earlyer part of the odp_ver_abt_log_dbg module)
now gets its own module. Test contents remains unchanged.
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/errno')
-rw-r--r-- | test/validation/errno/.gitignore | 2 | ||||
-rw-r--r-- | test/validation/errno/Makefile.am | 8 | ||||
-rw-r--r-- | test/validation/errno/errno.c | 34 | ||||
-rw-r--r-- | test/validation/errno/errno.h | 7 | ||||
-rw-r--r-- | test/validation/errno/errno_main.c | 12 |
5 files changed, 63 insertions, 0 deletions
diff --git a/test/validation/errno/.gitignore b/test/validation/errno/.gitignore new file mode 100644 index 000000000..b2aafc437 --- /dev/null +++ b/test/validation/errno/.gitignore @@ -0,0 +1,2 @@ +errno_main +liberrno.a diff --git a/test/validation/errno/Makefile.am b/test/validation/errno/Makefile.am new file mode 100644 index 000000000..0ac5d65ef --- /dev/null +++ b/test/validation/errno/Makefile.am @@ -0,0 +1,8 @@ +include ../Makefile.inc + +noinst_LIBRARIES = liberrno.a +liberrno_a_SOURCES = errno.c + +bin_PROGRAMS = errno_main$(EXEEXT) +dist_errno_main_SOURCES = errno_main.c +errno_main_LDADD = liberrno.a $(LIBCUNIT_COMMON) $(LIBODP) diff --git a/test/validation/errno/errno.c b/test/validation/errno/errno.c new file mode 100644 index 000000000..70a6613a5 --- /dev/null +++ b/test/validation/errno/errno.c @@ -0,0 +1,34 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp.h> +#include "odp_cunit_common.h" + +static void test_odp_errno_sunny_day(void) +{ + int my_errno; + + odp_errno_zero(); + my_errno = odp_errno(); + CU_ASSERT_TRUE(my_errno == 0); + odp_errno_print("odp_errno"); + CU_ASSERT_PTR_NOT_NULL(odp_errno_str(my_errno)); +} + +CU_TestInfo test_odp_errno[] = { + {"sunny day", test_odp_errno_sunny_day}, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo errno_suites[] = { + {"Errno", NULL, NULL, NULL, NULL, test_odp_errno}, + CU_SUITE_INFO_NULL, +}; + +int errno_main(void) +{ + return odp_cunit_run(errno_suites); +} diff --git a/test/validation/errno/errno.h b/test/validation/errno/errno.h new file mode 100644 index 000000000..f05d2c646 --- /dev/null +++ b/test/validation/errno/errno.h @@ -0,0 +1,7 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +int errno_main(void); diff --git a/test/validation/errno/errno_main.c b/test/validation/errno/errno_main.c new file mode 100644 index 000000000..0e82422b1 --- /dev/null +++ b/test/validation/errno/errno_main.c @@ -0,0 +1,12 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "errno.h" + +int main(void) +{ + return errno_main(); +} |