CU_ASSERT doesn't seem to work within the "term_global"
routine, apparently they can only be called within the tests
themselves?

At the moment I'm inclined to leave my patch as is.

-----Original Message-----
From: Robbie King (robking) 
Sent: Tuesday, March 03, 2015 9:08 AM
To: 'Maxim Uvarov'; [email protected]
Subject: RE: [lng-odp] [PATCHv1 2/3] validation: crypto: add common test cleanup

I believe this will always print the one of the two legs
even when successful:

   if ((ODP_POOL_INVALID != pool && odp_pool_destroy(pool))
        fprintf(stderr, "Completion pool destroy failed.\n");
   else
        fprintf(stderr, "Completion pool not found.\n");

I will change to the CUnit constructs.


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Maxim Uvarov
Sent: Wednesday, February 25, 2015 12:08 PM
To: [email protected]
Subject: Re: [lng-odp] [PATCHv1 2/3] validation: crypto: add common test cleanup

On 02/24/2015 10:27 PM, Robbie King wrote:
> Signed-off-by: Robbie King <[email protected]>
> ---
>   test/validation/odp_crypto.c | 32 ++++++++++++++++++++++++++++++++
>   1 file changed, 32 insertions(+)
>
> diff --git a/test/validation/odp_crypto.c b/test/validation/odp_crypto.c
> index b109a75..6efe0d6 100644
> --- a/test/validation/odp_crypto.c
> +++ b/test/validation/odp_crypto.c
> @@ -62,3 +62,35 @@ int tests_global_init(void)
>   
>       return 0;
>   }
> +
> +int tests_global_term(void)
> +{
> +     odp_pool_t pool;
> +     odp_queue_t out_queue;
> +
> +     pool = odp_pool_lookup("compl_pool");
> +     if (ODP_POOL_INVALID != pool) {
> +             if (odp_pool_destroy(pool))
> +                     fprintf(stderr, "Completion pool destroy failed.\n");
> +     } else {
> +             fprintf(stderr, "Completion pool not found.\n");
> +     }
You can move print sentence to one tab left

if ((ODP_POOL_INVALID != pool && odp_pool_destroy(pool))
     fprintf(stderr, "Completion pool destroy failed.\n");
else
     fprintf(stderr, "Completion pool not found.\n");

Or might be use cunit assert:

CU_ASSERT(ODP_POOL_INVALID != pool);
CU_ASSERT(0 == odp_pool_destroy(pool));

2 lines instead of 7.

Thanks,
Maxim.

> +
> +     out_queue = odp_queue_lookup("crypto-out");
> +     if (ODP_QUEUE_INVALID != out_queue) {
> +             if (odp_queue_destroy(out_queue))
> +                     fprintf(stderr, "Crypto outq destroy failed.\n");
> +     } else {
> +             fprintf(stderr, "Crypto outq not found.\n");
> +     }
> +
> +     pool = odp_pool_lookup("packet_pool");
> +     if (ODP_POOL_INVALID != pool) {
> +             if (odp_pool_destroy(pool))
> +                     fprintf(stderr, "Packet pool destroy failed.\n");
> +     } else {
> +             fprintf(stderr, "Packet pool not found.\n");
> +     }
> +
> +     return 0;
> +}


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to