On 21 November 2014 17:02, Mike Holmes <[email protected]> wrote:
>
>
> On 21 November 2014 06:46, Maxim Uvarov <[email protected]> wrote:
>>
>> On 11/21/2014 02:40 PM, Taras Kondratiuk wrote:
>>>
>>> On 11/20/2014 08:18 PM, Madhusudan Venugopal wrote:
>>>>
>>>>   int main(void)
>>>>   {
>>>> -    CU_pSuite ptr_suite = NULL;
>>>> -    /* initialize the CUnit test registry */
>>>> +    CU_pSuite p_suite;
>>>> +    CU_pTest ret;
>>>> +
>>>>       if (CUE_SUCCESS != CU_initialize_registry())
>>>>           return CU_get_error();
>>>> -    /* add a suite to the registry */
>>>> -    ptr_suite = CU_add_suite(__FILE__, init, finalise);
>>>> -    if (NULL == ptr_suite) {
>>>> +
>>>> +    p_suite = CU_add_suite(__FILE__, init, NULL);
>>>> +    if (!p_suite) {
>>>>           CU_cleanup_registry();
>>>>           return CU_get_error();
>>>>       }
>>>> -    /* add the tests to the suite */
>>>> -    if (NULL == CU_ADD_TEST(ptr_suite, test_odp_init_global)) {
>>>> +
>>>> +    ret = CU_ADD_TEST(p_suite, test_odp_init_global);
>>>> +    if (!ret) {
>>>>           CU_cleanup_registry();
>>>>           return CU_get_error();
>>>>       }
>>>> -    /* Run all tests using the CUnit Basic interface */
>>>> +
>>>> +    ret = CU_ADD_TEST(p_suite, odp_init_local_singlethread_sunnyday);
>>>> +    if (!ret) {
>>>> +        CU_cleanup_registry();
>>>> +        return CU_get_error();
>>>> +    }
>>>> +
>>>> +    ret = CU_ADD_TEST(p_suite,
>>>> odp_init_local_thread_per_core_sunnyday);
>>>> +    if (!ret) {
>>>> +        CU_cleanup_registry();
>>>> +        return CU_get_error();
>>>> +    }
>>>
>>>
>>> If there are more than a two tests, then CU_register_suites() API looks
>>> cleaner than adding tests one by one.
>>>
>>
>> Agree. Please use CU_register_suites().
>
>
>
> Agree, lets make this the standard.

+1

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

Reply via email to