One caveat to using CUNIT asserts, there are aspects of tear down that some platforms can't handle yet. For those platforms in 1.0 do we want CUNIT to fail them ?
It does make some sense that they fail, that is the actual behavior after all, but it is also ugly because we don't have a mechanism to SKIP which means that "make check" becomes full of accepted errors that will mask real regressions. In the case of embedded apps there never is any tear down in many cases so there is no issue. In summary Really we want to document accepted failures with a SKIP for a given test in a per platform way, per release, but not obscure new failures, converting to CU_ASSERTS here will obscure regressions as things stand. Maybe we need some folks implementing against legacy platforms with this restriction to chime in on this one ? On 25 February 2015 at 12:08, Maxim Uvarov <[email protected]> wrote: > 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 > -- *Mike Holmes* Linaro Sr Technical Manager LNG - ODP
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
