diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-05 12:15:05 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-05 12:15:05 -0800 |
commit | d15a3b366c7ec8b0f2dfc44e7802d7cc3ebd8290 (patch) | |
tree | 9a63ae6f04db60ca6d06d4c9603bcc7c7c821fdd /tests | |
parent | 814cd72af956fd215938e1d1bc8a9266339f63a4 (diff) |
fix networking for both stream and dgram
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) { |