On 09/30/2015 12:47 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
>> Nicolas Morey-Chaisemartin
>> Sent: Tuesday, September 29, 2015 5:16 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [API-NEXTv2 7/7] validation: packet: add tests for
>> packet alloc/free multi functions
>> +    CU_ASSERT_FATAL(odp_packet_alloc_multi(pool, packet_len,
>> +                                           packet, num_pkt) == num_pkt);
>> +
>> +    for (i = 0; i < num_pkt; ++i) {
> Check return value. It can be less than num_pkt. Check only indexes 0 ... ret 
> -1. Re-try to allocate rest of the packets.
This is actually OK becuase we use CU_ASSERT_FATAL and not CU_ASSERT.
If alloc_multi returned a value different from num_pkt, the test will exit 
before entering the loop.

Nicolas
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to