Skip to content

Commit aa64916

Browse files
committed
chore: Add code for future netprof TCP testing
TCP does not presently work for autotests, but this will allow us to test netprof with TCP packets when it's fixed
1 parent 9e5693d commit aa64916

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

auto_tests/netprof_test.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/** Auto Tests: basic network profile functionality test (UDP only)
2-
* TODO(JFreegman): test TCP packets as well
32
*/
43

54
#include <inttypes.h>
@@ -110,10 +109,24 @@ int main(void)
110109
{
111110
setvbuf(stdout, nullptr, _IONBF, 0);
112111

112+
Tox_Err_Options_New options_err;
113+
struct Tox_Options *tox_opts = tox_options_new(&options_err);
114+
115+
ck_assert_msg(options_err == TOX_ERR_OPTIONS_NEW_OK, "Failed to initialize tox options: %d\n", options_err);
116+
117+
tox_options_default(tox_opts);
118+
tox_options_set_udp_enabled(tox_opts, true);
119+
113120
Run_Auto_Options autotox_opts = default_run_auto_options();
114121
autotox_opts.graph = GRAPH_COMPLETE;
115122

116-
run_auto_test(nullptr, NUM_TOXES, test_netprof, 0, &autotox_opts);
123+
run_auto_test(tox_opts, NUM_TOXES, test_netprof, 0, &autotox_opts);
124+
125+
// TODO(Jfreegman): uncomment this when TCP autotests are fixed
126+
// tox_options_set_udp_enabled(tox_opts, false);
127+
// run_auto_test(tox_opts, NUM_TOXES, test_netprof, 0, &autotox_opts);
128+
129+
tox_options_free(tox_opts);
117130

118131
return 0;
119132
}

0 commit comments

Comments
 (0)