X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_hash_functions.c;h=76d51b6e71a2a435791f1956c71cac367664d496;hb=f0243339496d48e6f5d76e6ef6741d6986b965d0;hp=c1fc9492d5f3bafd71dd5c0a58d81897b177b4aa;hpb=a9de470cc7c0649221e156fc5f30a2dbdfe7c166;p=dpdk.git diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c index c1fc9492d5..76d51b6e71 100644 --- a/app/test/test_hash_functions.c +++ b/app/test/test_hash_functions.c @@ -152,10 +152,10 @@ verify_precalculated_hash_func_tests(void) for (i = 0; i < 64; i++) key[i] = (uint8_t) i; - for (i = 0; i < sizeof(hashtest_key_lens) / sizeof(uint32_t); i++) { - for (j = 0; j < sizeof(hashtest_initvals) / sizeof(uint32_t); j++) { + for (i = 0; i < RTE_DIM(hashtest_key_lens); i++) { + for (j = 0; j < RTE_DIM(hashtest_initvals); j++) { hash = rte_jhash(key, hashtest_key_lens[i], - hashtest_initvals[j]); + hashtest_initvals[j]); if (hash != hash_values_jhash[j][i]) { printf("jhash for %u bytes with initial value 0x%x." "Expected 0x%x, but got 0x%x\n", @@ -192,8 +192,8 @@ verify_jhash_32bits(void) for (i = 0; i < 64; i++) key[i] = rand() & 0xff; - for (i = 0; i < sizeof(hashtest_key_lens) / sizeof(uint32_t); i++) { - for (j = 0; j < sizeof(hashtest_initvals) / sizeof(uint32_t); j++) { + for (i = 0; i < RTE_DIM(hashtest_key_lens); i++) { + for (j = 0; j < RTE_DIM(hashtest_initvals); j++) { /* Key size must be multiple of 4 (32 bits) */ if ((hashtest_key_lens[i] & 0x3) == 0) { hash = rte_jhash(key, hashtest_key_lens[i],