Skip to content

Commit 765fd54

Browse files
Green-Skyiphydf
authored andcommitted
fix: tests use ipv6 by default, even with USE_IPV6 set to 0
1 parent acdc673 commit 765fd54

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

auto_tests/auto_test_support.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#define ABORT_ON_LOG_ERROR true
1414
#endif
1515

16+
#ifndef USE_IPV6
17+
#define USE_IPV6 1
18+
#endif
19+
1620
Run_Auto_Options default_run_auto_options(void)
1721
{
1822
return (Run_Auto_Options) {
@@ -193,6 +197,7 @@ void reload(AutoTox *autotox)
193197

194198
struct Tox_Options *const options = tox_options_new(nullptr);
195199
ck_assert(options != nullptr);
200+
tox_options_set_ipv6_enabled(options, USE_IPV6);
196201
tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE);
197202
tox_options_set_savedata_data(options, autotox->save_state, autotox->save_size);
198203
autotox->tox = tox_new_log(options, nullptr, &autotox->index);
@@ -214,6 +219,8 @@ static void initialise_autotox(struct Tox_Options *options, AutoTox *autotox, ui
214219
struct Tox_Options *default_opts = tox_options_new(nullptr);
215220
ck_assert(default_opts != nullptr);
216221

222+
tox_options_set_ipv6_enabled(default_opts, USE_IPV6);
223+
217224
if (options == nullptr) {
218225
options = default_opts;
219226
}
@@ -426,6 +433,7 @@ Tox *tox_new_log_lan(struct Tox_Options *options, Tox_Err_New *err, void *log_us
426433

427434
assert(log_options != nullptr);
428435

436+
tox_options_set_ipv6_enabled(log_options, USE_IPV6);
429437
tox_options_set_local_discovery_enabled(log_options, lan_discovery);
430438
// Use a higher start port for non-LAN-discovery tests so it's more likely for the LAN discovery
431439
// test to get the default port 33445.

0 commit comments

Comments
 (0)