diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-08 08:44:43 +0200 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2025-08-11 10:00:44 +0200 |
commit | a2569cbe25e9c57d3fb9d80fe1727b71bcdadc13 (patch) | |
tree | befda313f71b0ef6462285e5612f9874a7749bd3 | |
parent | c65d12699f99507b04620cca406b532410a17b58 (diff) | |
download | ouroboros-a2569cbe25e9c57d3fb9d80fe1727b71bcdadc13.tar.gz ouroboros-a2569cbe25e9c57d3fb9d80fe1727b71bcdadc13.zip |
ipcpd: Fix DHT test initializer compilation error
dht_test.c:167:48: error: initializer element is not a compile-time constant
static struct dir_dht_config test_dht_config = default_dht_config;
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r-- | src/ipcpd/unicast/dir/tests/dht_test.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ipcpd/unicast/dir/tests/dht_test.c b/src/ipcpd/unicast/dir/tests/dht_test.c index 72e8f0df..b6563a03 100644 --- a/src/ipcpd/unicast/dir/tests/dht_test.c +++ b/src/ipcpd/unicast/dir/tests/dht_test.c @@ -164,8 +164,6 @@ static const buffer_t test_val2 = { .len = 12 }; -static struct dir_dht_config test_dht_config = default_dht_config; - static int random_value_len(buffer_t * b) { assert(b != NULL); @@ -318,6 +316,15 @@ static void clear_contacts(dht_contact_msg_t ** contacts, } /* Start of actual tests */ +static struct dir_dht_config test_dht_config = { + .params = { + .alpha = 3, + .k = 8, + .t_expire = 86400, + .t_refresh = 900, + .t_replicate = 900 + } +}; static int test_dht_init_fini(void) { @@ -1758,7 +1765,7 @@ static int test_dht_query(void) sink_init(); - cfg = default_dht_config; + cfg = test_dht_config; cfg.peer = generate_cookie(); if (dht_init(&cfg)) { @@ -1814,7 +1821,7 @@ static int test_dht_query_contacts(void) sink_init(); - cfg = default_dht_config; + cfg = test_dht_config; cfg.peer = generate_cookie(); if (dht_init(&cfg)) { |