We had a situation where the API ut_kvp_getListCount has been triggered with some wrong profiles which will eventually fail. But the problem here is that the var count is not initialized due to which it generates a random value instead of zero during the failure. This random value created infinite loops in some of the VTS test cases.
Failure:
if (fy_node_is_sequence(node)) at line 600 fails due to some bad reason and as the count variable is not initialized, it will return a random value from here.
Solution: initialize the variable count to 0.
Please also check that the count is of type "uint32_t ", while we check this for -1 in certain cases.
count = fy_node_sequence_item_count(node);
if (count == -1)
{
UT_LOG_ERROR("fy_node_sequence_item_count() returned error\n ");
return 0;
}
We had a situation where the API ut_kvp_getListCount has been triggered with some wrong profiles which will eventually fail. But the problem here is that the var count is not initialized due to which it generates a random value instead of zero during the failure. This random value created infinite loops in some of the VTS test cases.
Failure: if (fy_node_is_sequence(node)) at line 600 fails due to some bad reason and as the count variable is not initialized, it will return a random value from here.
Solution: initialize the variable count to 0.
Please also check that the count is of type "uint32_t ", while we check this for -1 in certain cases.