aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py24
-rw-r--r--tests/unistd/login.out2
-rw-r--r--tests/unistd/misc.out8
-rw-r--r--tests/unistd/unlink.out2
-rw-r--r--tests/websockets_bi.c16
-rw-r--r--tests/websockets_bi_side.c7
6 files changed, 35 insertions, 24 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 803c1d2b..9db26947 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2244,8 +2244,8 @@ returned |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie',
}
'''
expected = '''
- <Numerical argument out of domain>
- <Resource temporarily unavailable>
+ <Math arg out of domain of func>
+ <No more processes>
<34>
<123>
'''
@@ -12919,20 +12919,22 @@ elif 'browser' in str(sys.argv):
def test_websockets_bi(self):
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', '-DTEST_DGRAM=%d' % datagram]).communicate()
- self.btest('websockets_bi.c', expected='2499', args=['-DTEST_DGRAM=%d' % datagram])
- finally:
- self.clean_pids()
+ for fileops in [0,1]:
+ try:
+ print >> sys.stderr, 'test_websocket_bi datagram %d, fileops %d' % (datagram, fileops)
+ 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', '-DTEST_DGRAM=%d' % datagram]).communicate()
+ self.btest('websockets_bi.c', expected='2499', args=['-DSOCKK=8993', '-DTEST_DGRAM=%d' % datagram, '-DTEST_FILE_OPS=%s' % fileops])
+ finally:
+ self.clean_pids()
def test_websockets_bi_listen(self):
try:
with self.WebsockHarness(6992, self.make_relay_server(6992, 6994)):
with self.WebsockHarness(6994, no_server=True):
Popen([PYTHON, EMCC, path_from_root('tests', 'websockets_bi_side.c'), '-o', 'side.html', '-DSOCKK=6995']).communicate()
- self.btest('websockets_bi_listener.c', expected='2499')
+ self.btest('websockets_bi_listener.c', expected='2499', args=['-DSOCKK=6993'])
finally:
self.clean_pids()
@@ -12948,7 +12950,7 @@ elif 'browser' in str(sys.argv):
with self.WebsockHarness(3992, self.make_relay_server(3992, 3994)):
with self.WebsockHarness(3994, no_server=True):
Popen([PYTHON, EMCC, path_from_root('tests', 'websockets_bi_side_bigdata.c'), '-o', 'side.html', '-DSOCKK=3995', '-s', 'SOCKET_DEBUG=0', '-I' + path_from_root('tests')]).communicate()
- self.btest('websockets_bi_bigdata.c', expected='0', args=['-s', 'SOCKET_DEBUG=0', '-I' + path_from_root('tests')])
+ self.btest('websockets_bi_bigdata.c', expected='0', args=['-DSOCKK=3993', '-s', 'SOCKET_DEBUG=0', '-I' + path_from_root('tests')])
finally:
self.clean_pids()
diff --git a/tests/unistd/login.out b/tests/unistd/login.out
index c1919c3c..50e850ae 100644
--- a/tests/unistd/login.out
+++ b/tests/unistd/login.out
@@ -3,7 +3,7 @@ errno: 0
gethostname/2 ret: -1
gethostname/2: em------------------------
-errno: 36
+errno: 91
gethostname/256 ret: 0
gethostname/256: emscripten
diff --git a/tests/unistd/misc.out b/tests/unistd/misc.out
index a872a258..43971955 100644
--- a/tests/unistd/misc.out
+++ b/tests/unistd/misc.out
@@ -11,8 +11,8 @@ lockf(good): 0, errno: 0
lockf(bad): -1, errno: 9
nice: 0, errno: 1
pause: -1, errno: 4
-pipe(good): -1, errno: 38
-pipe(bad): -1, errno: 38
+pipe(good): -1, errno: 88
+pipe(bad): -1, errno: 88
execl: -1, errno: 8
execle: -1, errno: 8
execlp: -1, errno: 8
@@ -29,8 +29,8 @@ alarm: 0, errno: 0
ualarm: 0, errno: 0
fork: -1, errno: 11
vfork: -1, errno: 11
-crypt: (null), errno: 38
-encrypt, errno: 38
+crypt: (null), errno: 88
+encrypt, errno: 88
getgid: 0, errno: 0
getegid: 0, errno: 0
getuid: 0, errno: 0
diff --git a/tests/unistd/unlink.out b/tests/unistd/unlink.out
index 1dcec761..f7a894cb 100644
--- a/tests/unistd/unlink.out
+++ b/tests/unistd/unlink.out
@@ -37,6 +37,6 @@ access(/empty-forbidden) after rmdir: 0
access(/full) before: 0
errno: 21
access(/full) after unlink: 0
-errno: 39
+errno: 90
access(/full) after rmdir: 0
diff --git a/tests/websockets_bi.c b/tests/websockets_bi.c
index 18cdd664..fb60177b 100644
--- a/tests/websockets_bi.c
+++ b/tests/websockets_bi.c
@@ -14,6 +14,10 @@
#define EXPECTED_BYTES 28
+#ifndef SOCKK
+#define SOCKK 8992
+#endif
+
int SocketFD;
unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
@@ -25,7 +29,11 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
char buffer[1024];
int n;
unsigned int offset = 0;
+#if TEST_FILE_OPS
+ while((errno = 0, (n = read(sock, buffer, sizeof(buffer)))>0) ||
+#else
while((errno = 0, (n = recv(sock, buffer, sizeof(buffer), 0))>0) ||
+#endif
errno == EINTR) {
if(n>0)
{
@@ -96,13 +104,7 @@ int main(void)
memset(&stSockAddr, 0, sizeof(stSockAddr));
stSockAddr.sin_family = AF_INET;
- stSockAddr.sin_port = htons(
-#if EMSCRIPTEN
- 8993
-#else
- 8992
-#endif
- );
+ stSockAddr.sin_port = htons(SOCKK);
Res = inet_pton(AF_INET, "127.0.0.1", &stSockAddr.sin_addr);
if (0 > Res) {
diff --git a/tests/websockets_bi_side.c b/tests/websockets_bi_side.c
index 12b790fd..1d557ed8 100644
--- a/tests/websockets_bi_side.c
+++ b/tests/websockets_bi_side.c
@@ -54,10 +54,17 @@ int main(void)
exit(EXIT_FAILURE);
}
+#if TEST_FILE_OPS
+ printf("write..\n");
+
+ char data[] = "hello from the other siide (fileops)\n";
+ write(SocketFD, data, sizeof(data));
+#else
printf("send..\n");
char data[] = "hello from the other siide\n";
send(SocketFD, data, sizeof(data), 0);
+#endif
printf("stall..\n");