diff mbox

[2/2] validation: add test on unused retvals

Message ID 1440098294-24278-2-git-send-email-mike.holmes@linaro.org
State Accepted
Commit cdea0d65a82c718b1b134037a1a71010fffde5ce
Headers show

Commit Message

Mike Holmes Aug. 20, 2015, 7:18 p.m. UTC
Fix unused return codes by testing for validity

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/validation/classification/odp_classification_tests.c | 1 +
 test/validation/common/mask_common.c                      | 1 +
 2 files changed, 2 insertions(+)

Comments

Bill Fischofer Aug. 20, 2015, 8:06 p.m. UTC | #1
On Thu, Aug 20, 2015 at 2:18 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Fix unused return codes by testing for validity
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

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


> ---
>  test/validation/classification/odp_classification_tests.c | 1 +
>  test/validation/common/mask_common.c                      | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/test/validation/classification/odp_classification_tests.c
> b/test/validation/classification/odp_classification_tests.c
> index 0e0c4eb..a312dc9 100644
> --- a/test/validation/classification/odp_classification_tests.c
> +++ b/test/validation/classification/odp_classification_tests.c
> @@ -407,6 +407,7 @@ void configure_cls_pmr_chain(void)
>
>         retval = odp_cos_set_queue(cos_list[CLS_PMR_CHAIN_DST],
>                                    queue_list[CLS_PMR_CHAIN_DST]);
> +       CU_ASSERT(retval == 0);
>
>         parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask);
>         pmr_list[CLS_PMR_CHAIN_SRC] = odp_pmr_create(ODP_PMR_SIP_ADDR,
> &addr,
> diff --git a/test/validation/common/mask_common.c
> b/test/validation/common/mask_common.c
> index fce7725..9b1a23f 100644
> --- a/test/validation/common/mask_common.c
> +++ b/test/validation/common/mask_common.c
> @@ -145,6 +145,7 @@ MASK_TESTFUNC(to_from_str)
>
>         str_sz = _odp_mask_to_str(&mask, buf_out,
>                                   stringlen(TEST_MASK_0) + 1);
> +       CU_ASSERT(str_sz  == (int32_t)stringlen(TEST_MASK_0) + 1);
>
>         CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_0,
>                                 stringlen(TEST_MASK_0) + 1);
> --
> 2.1.4
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index 0e0c4eb..a312dc9 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -407,6 +407,7 @@  void configure_cls_pmr_chain(void)
 
 	retval = odp_cos_set_queue(cos_list[CLS_PMR_CHAIN_DST],
 				   queue_list[CLS_PMR_CHAIN_DST]);
+	CU_ASSERT(retval == 0);
 
 	parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask);
 	pmr_list[CLS_PMR_CHAIN_SRC] = odp_pmr_create(ODP_PMR_SIP_ADDR, &addr,
diff --git a/test/validation/common/mask_common.c b/test/validation/common/mask_common.c
index fce7725..9b1a23f 100644
--- a/test/validation/common/mask_common.c
+++ b/test/validation/common/mask_common.c
@@ -145,6 +145,7 @@  MASK_TESTFUNC(to_from_str)
 
 	str_sz = _odp_mask_to_str(&mask, buf_out,
 				  stringlen(TEST_MASK_0) + 1);
+	CU_ASSERT(str_sz  == (int32_t)stringlen(TEST_MASK_0) + 1);
 
 	CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_0,
 				stringlen(TEST_MASK_0) + 1);