Skip to content

Commit

Permalink
chore: Add code for future netprof TCP testing
Browse files Browse the repository at this point in the history
TCP does not presently work for autotests, but this
will allow us to test netprof with TCP packets
when it's fixed
  • Loading branch information
JFreegman committed Jan 15, 2025
1 parent 9e5693d commit aa64916
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions auto_tests/netprof_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/** Auto Tests: basic network profile functionality test (UDP only)
* TODO(JFreegman): test TCP packets as well
*/

#include <inttypes.h>
Expand Down Expand Up @@ -110,10 +109,24 @@ int main(void)
{
setvbuf(stdout, nullptr, _IONBF, 0);

Tox_Err_Options_New options_err;
struct Tox_Options *tox_opts = tox_options_new(&options_err);

ck_assert_msg(options_err == TOX_ERR_OPTIONS_NEW_OK, "Failed to initialize tox options: %d\n", options_err);

tox_options_default(tox_opts);
tox_options_set_udp_enabled(tox_opts, true);

Run_Auto_Options autotox_opts = default_run_auto_options();
autotox_opts.graph = GRAPH_COMPLETE;

run_auto_test(nullptr, NUM_TOXES, test_netprof, 0, &autotox_opts);
run_auto_test(tox_opts, NUM_TOXES, test_netprof, 0, &autotox_opts);

// TODO(Jfreegman): uncomment this when TCP autotests are fixed
// tox_options_set_udp_enabled(tox_opts, false);
// run_auto_test(tox_opts, NUM_TOXES, test_netprof, 0, &autotox_opts);

tox_options_free(tox_opts);

return 0;
}
Expand Down

0 comments on commit aa64916

Please sign in to comment.