On 02/06/17 17:40, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> 
> 
>> -----Original Message-----
>> From: lng-odp [mailto:[email protected]] On Behalf Of Maxim
>> Uvarov
>> Sent: Monday, February 06, 2017 4:34 PM
>> To: [email protected]
>> Subject: Re: [lng-odp] [PATCH 05/10] validation: packet: print reason for
>> suite init failure
>>
>> On 02/06/17 15:37, Petri Savolainen wrote:
>>> Knowing the reason for suite init function failure helps in
>>> debugging.
>>>
>>> Signed-off-by: Petri Savolainen <[email protected]>
>>> ---
>>>  test/common_plat/validation/api/packet/packet.c | 23
>> ++++++++++++++++++-----
>>>  1 file changed, 18 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/test/common_plat/validation/api/packet/packet.c
>> b/test/common_plat/validation/api/packet/packet.c
>>> index fa5206f..e3d28f6 100644
>>> --- a/test/common_plat/validation/api/packet/packet.c
>>> +++ b/test/common_plat/validation/api/packet/packet.c
>>> @@ -110,8 +110,10 @@ int packet_suite_init(void)
>>>     uint8_t data = 0;
>>>     uint32_t i;
>>>
>>> -   if (odp_pool_capability(&capa) < 0)
>>> +   if (odp_pool_capability(&capa) < 0) {
>>> +           printf("pool_capability failed\n");
>>>             return -1;
>>> +   }
>>
>>
>> it's it better to return -1, -2, -3 and put debug print in upper
>> function? Here:
>>
>>
>>      /* execute its init function */
>>      if (sinfo->pInitFunc) {
>>              ret = sinfo->pInitFunc();
>>              if (ret)
>>                      return ret;
>>      }
>>
>> or it can be CU_FAIL(msg) which already writes line number.
>>
>>
>> Maxim.
> 
> This is CUnit init time function, which cannot handle CU_xxx calls. At least, 
> other validation init calls used printf directly. I think "pool_capability 
> failed" is easier to (grep and) find than -2.
> 
> -Petri
> 


yes, init function does not support CU calls, forgot about that. Yes,
grep should be more easy. Ok, with that patch.

Maxim.

Reply via email to