diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 6 | ||||
-rw-r--r-- | tests/websockets_bi.c | 4 | ||||
-rw-r--r-- | tests/websockets_bi_side.c | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index b26162c0..2d4146a9 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -10283,12 +10283,12 @@ elif 'browser' in str(sys.argv): return relay_server def test_zz_websockets_bi(self): - for fm in [0,1]: + for datagram in [0,1]: try: with self.WebsockHarness(8992, self.make_relay_server(8992, 8994)): with self.WebsockHarness(8994, no_server=True): - Popen([PYTHON, EMCC, path_from_root('tests', 'websockets_bi_side.c'), '-o', 'side.html', '-DSOCKK=8995', '-s', 'SOCKET_FORCED_MESSAGING=%d' % fm]).communicate() - self.btest('websockets_bi.c', expected='2499', args=['-s', 'SOCKET_FORCED_MESSAGING=%d' % fm]) + Popen([PYTHON, EMCC, path_from_root('tests', 'websockets_bi_side.c'), '-o', 'side.html', '-DSOCKK=8995', '-DTEST_DGRAM=%d' % datagram]).communicate() + self.btest('websockets_bi.c', expected='2499', args=['-DTEST_DGRAM=%d' % datagram]) finally: self.clean_pids() diff --git a/tests/websockets_bi.c b/tests/websockets_bi.c index 73d061d2..c2dbb7da 100644 --- a/tests/websockets_bi.c +++ b/tests/websockets_bi.c @@ -81,7 +81,11 @@ int main(void) struct sockaddr_in stSockAddr; int Res; +#if !TEST_DGRAM SocketFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); +#else + SocketFD = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); +#endif if (-1 == SocketFD) { diff --git a/tests/websockets_bi_side.c b/tests/websockets_bi_side.c index c9c50618..12b790fd 100644 --- a/tests/websockets_bi_side.c +++ b/tests/websockets_bi_side.c @@ -18,7 +18,11 @@ int main(void) { struct sockaddr_in stSockAddr; int Res; +#if !TEST_DGRAM int SocketFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); +#else + int SocketFD = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); +#endif if (-1 == SocketFD) { |