test/common: fix log2 check
We recently started to get random failures on the common_autotest ut with
clang on Ubuntu 16.04.6.
Example: https://travis-ci.com/DPDK/dpdk/jobs/
263177424
Wrong rte_log2_u64(0) val 0, expected
ffffffff
Test Failed
The ut passes 0 to log2() to get an expected value.
Quoting log2 / log(3) manual:
If x is zero, then a pole error occurs, and the functions return
-HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively.
rte_log2_uXX helpers handle 0 as a special value and return 0.
Let's have dedicated tests for this case.
Fixes:
05c4345ef5c2 ("test: add unit test for integer log2 function")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>