aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/test_hash.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:50:04 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:50:10 +0000
commit36e178648f46ea9fb63d89097c59ce45fb8a67fe (patch)
treee3ee0ea25a45aa28918dc721dd1fe19b27d6849c /app/test/test_hash.c
parent1ab31fb74132eabd45f326413eb6e4f647de48d9 (diff)
parentf7a9461e29147c47ce2bb81bd157ac1833cf5eb1 (diff)
Merge tag 'upstream/16.11.9' into 16.11.x
Upstream version 16.11.9 Change-Id: I947c2532ec89a9850d135bde544b4d5812b49e4f Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'app/test/test_hash.c')
-rw-r--r--app/test/test_hash.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index 2c87efe6..c55ec0da 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -110,29 +110,23 @@ static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
return 3;
}
+#define UNIT_TEST_HASH_VERBOSE 0
/*
* Print out result of unit test hash operation.
*/
-#if defined(UNIT_TEST_HASH_VERBOSE)
static void print_key_info(const char *msg, const struct flow_key *key,
int32_t pos)
{
- uint8_t *p = (uint8_t *)key;
- unsigned i;
-
- printf("%s key:0x", msg);
- for (i = 0; i < sizeof(struct flow_key); i++) {
- printf("%02X", p[i]);
+ if (UNIT_TEST_HASH_VERBOSE) {
+ const uint8_t *p = (const uint8_t *)key;
+ unsigned int i;
+
+ printf("%s key:0x", msg);
+ for (i = 0; i < sizeof(struct flow_key); i++)
+ printf("%02X", p[i]);
+ printf(" @ pos %d\n", pos);
}
- printf(" @ pos %d\n", pos);
-}
-#else
-static void print_key_info(__attribute__((unused)) const char *msg,
- __attribute__((unused)) const struct flow_key *key,
- __attribute__((unused)) int32_t pos)
-{
}
-#endif
/* Keys used by unit test functions */
static struct flow_key keys[5] = { {