Merge pull request #1305 from esnet/add_get_set_tests

Add test for get and set bind port and mss
This commit is contained in:
swlars 2022-04-01 13:40:05 -07:00 committed by GitHub
commit a8653a7443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,24 @@
#include "units.h" #include "units.h"
int test_iperf_set_test_bind_port(struct iperf_test *test)
{
int port;
port = iperf_get_test_bind_port(test);
iperf_set_test_bind_port(test, 5202);
port = iperf_get_test_bind_port(test);
assert(port == 5202);
return 0;
}
int test_iperf_set_mss(struct iperf_test *test)
{
int mss = iperf_get_test_mss(test);
iperf_set_test_mss(test, 535);
mss = iperf_get_test_mss(test);
assert(mss == 535);
return 0;
}
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -61,5 +79,14 @@ main(int argc, char **argv)
gint = iperf_get_test_connect_timeout(test); gint = iperf_get_test_connect_timeout(test);
assert(sint == gint); assert(sint == gint);
int ret;
ret = test_iperf_set_test_bind_port(test);
ret += test_iperf_set_mss(test);
if (ret < 0)
{
return -1;
}
return 0; return 0;
} }