app/test: fix build with overflowed EFD value
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 25 Jan 2017 11:29:18 +0000 (11:29 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 30 Jan 2017 16:17:15 +0000 (17:17 +0100)
commita085723ac8cdb41750738567b8da2d3fc7b2363c
tree1510abcbbfac820d1157c9981a432f689cd8c6b4
parentdd10203ba39e449bfcff6211265e7ff956774132
app/test: fix build with overflowed EFD value

When RTE_EFD_VALUE_NUM_BITS is 32, there was a compilation issue
because of an overflow:

app/test/test_efd.c:157:55: error: overflow in expression;
result is 2147483647 with type 'int' [-Werror,-Winteger-overflow]
        data[0] = mrand48() & ((1 << RTE_EFD_VALUE_NUM_BITS) - 1);

This commit fixes the issue by using a setting a different
macro VALUE_BITMASK with a conditional

Fixes: 0e925aef2779 ("app/test: add EFD functional and perf tests")

Reported-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test/test_efd.c
app/test/test_efd_perf.c