diff mbox

[v3] valididation: errno: add sunnyday test

Message ID 1424986452-23324-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 7ad4a20880ccef1fb6595d732863c6bb6461e7c4
Headers show

Commit Message

Mike Holmes Feb. 26, 2015, 9:34 p.m. UTC
Call the public APIs for errno in a sunny day configuration.

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/validation/.gitignore  |  1 +
 test/validation/Makefile.am |  4 +++-
 test/validation/odp_errno.c | 28 ++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 test/validation/odp_errno.c

Comments

Bill Fischofer Feb. 27, 2015, 12:17 a.m. UTC | #1
On Thu, Feb 26, 2015 at 3:34 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Call the public APIs for errno in a sunny day configuration.
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  test/validation/.gitignore  |  1 +
>  test/validation/Makefile.am |  4 +++-
>  test/validation/odp_errno.c | 28 ++++++++++++++++++++++++++++
>  3 files changed, 32 insertions(+), 1 deletion(-)
>  create mode 100644 test/validation/odp_errno.c
>
> diff --git a/test/validation/.gitignore b/test/validation/.gitignore
> index e419f32..1a69f89 100644
> --- a/test/validation/.gitignore
> +++ b/test/validation/.gitignore
> @@ -16,3 +16,4 @@ odp_pool
>  odp_timer
>  odp_time
>  odp_synchronizers
> +odp_errno
> diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
> index f5bb9ac..fe43084 100644
> --- a/test/validation/Makefile.am
> +++ b/test/validation/Makefile.am
> @@ -19,7 +19,8 @@ EXECUTABLES = odp_buffer \
>               odp_system \
>               odp_synchronizers \
>               odp_time \
> -             odp_timer
> +             odp_timer \
> +             odp_errno
>
>  COMPILE_ONLY = odp_pktio
>
> @@ -57,3 +58,4 @@ dist_odp_timer_SOURCES  = odp_timer.c $(ODP_CU_COMMON)
>  dist_odp_pktio_SOURCES = odp_pktio.c $(ODP_CU_COMMON)
>  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)
> diff --git a/test/validation/odp_errno.c b/test/validation/odp_errno.c
> new file mode 100644
> index 0000000..89b99d7
> --- /dev/null
> +++ b/test/validation/odp_errno.c
> @@ -0,0 +1,28 @@
> +/* 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 odp_testsuites[] = {
> +       {"Errno", NULL, NULL, NULL, NULL, test_odp_errno},
> +       CU_SUITE_INFO_NULL,
> +};
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Feb. 27, 2015, 11:16 a.m. UTC | #2
Merged,
Maxim.

On 02/27/2015 03:17 AM, Bill Fischofer wrote:
>
>
> On Thu, Feb 26, 2015 at 3:34 PM, Mike Holmes <mike.holmes@linaro.org 
> <mailto:mike.holmes@linaro.org>> wrote:
>
>     Call the public APIs for errno in a sunny day configuration.
>
>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>
>
>
> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      test/validation/.gitignore  |  1 +
>      test/validation/Makefile.am |  4 +++-
>      test/validation/odp_errno.c | 28 ++++++++++++++++++++++++++++
>      3 files changed, 32 insertions(+), 1 deletion(-)
>      create mode 100644 test/validation/odp_errno.c
>
>     diff --git a/test/validation/.gitignore b/test/validation/.gitignore
>     index e419f32..1a69f89 100644
>     --- a/test/validation/.gitignore
>     +++ b/test/validation/.gitignore
>     @@ -16,3 +16,4 @@ odp_pool
>      odp_timer
>      odp_time
>      odp_synchronizers
>     +odp_errno
>     diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
>     index f5bb9ac..fe43084 100644
>     --- a/test/validation/Makefile.am
>     +++ b/test/validation/Makefile.am
>     @@ -19,7 +19,8 @@ EXECUTABLES = odp_buffer \
>                   odp_system \
>                   odp_synchronizers \
>                   odp_time \
>     -             odp_timer
>     +             odp_timer \
>     +             odp_errno
>
>      COMPILE_ONLY = odp_pktio
>
>     @@ -57,3 +58,4 @@ dist_odp_timer_SOURCES  = odp_timer.c
>     $(ODP_CU_COMMON)
>      dist_odp_pktio_SOURCES = odp_pktio.c $(ODP_CU_COMMON)
>      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)
>     diff --git a/test/validation/odp_errno.c b/test/validation/odp_errno.c
>     new file mode 100644
>     index 0000000..89b99d7
>     --- /dev/null
>     +++ b/test/validation/odp_errno.c
>     @@ -0,0 +1,28 @@
>     +/* 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 odp_testsuites[] = {
>     +       {"Errno", NULL, NULL, NULL, NULL, test_odp_errno},
>     +       CU_SUITE_INFO_NULL,
>     +};
>     --
>     2.1.0
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index e419f32..1a69f89 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -16,3 +16,4 @@  odp_pool
 odp_timer
 odp_time
 odp_synchronizers
+odp_errno
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index f5bb9ac..fe43084 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -19,7 +19,8 @@  EXECUTABLES = odp_buffer \
 	      odp_system \
 	      odp_synchronizers \
 	      odp_time \
-	      odp_timer
+	      odp_timer \
+	      odp_errno
 
 COMPILE_ONLY = odp_pktio
 
@@ -57,3 +58,4 @@  dist_odp_timer_SOURCES  = odp_timer.c $(ODP_CU_COMMON)
 dist_odp_pktio_SOURCES	= odp_pktio.c $(ODP_CU_COMMON)
 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)
diff --git a/test/validation/odp_errno.c b/test/validation/odp_errno.c
new file mode 100644
index 0000000..89b99d7
--- /dev/null
+++ b/test/validation/odp_errno.c
@@ -0,0 +1,28 @@ 
+/* 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 odp_testsuites[] = {
+	{"Errno", NULL, NULL, NULL, NULL, test_odp_errno},
+	CU_SUITE_INFO_NULL,
+};