diff options
| author | Sam Roberts <vieuxtech@gmail.com> | 2012-02-29 16:55:55 -0800 |
|---|---|---|
| committer | Sam Roberts <vieuxtech@gmail.com> | 2012-04-11 13:54:01 -0700 |
| commit | 195b2a74bb3f368b1f31f9c8bbc1ce0f54de2035 (patch) | |
| tree | cc34f3c8af6a4769c5a7531f7e50ef7ed3c90283 | |
| parent | 38b99b80a282806a43d1fd8374791c5b66a49b52 (diff) | |
| download | luasocket-195b2a74bb3f368b1f31f9c8bbc1ce0f54de2035.tar.gz luasocket-195b2a74bb3f368b1f31f9c8bbc1ce0f54de2035.tar.bz2 luasocket-195b2a74bb3f368b1f31f9c8bbc1ce0f54de2035.zip | |
On failure, exit with a message instead of blocking indefinitely.
| -rwxr-xr-x | test/udp-zero-length-send-recv | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/udp-zero-length-send-recv b/test/udp-zero-length-send-recv index 7d76c98..541efd4 100755 --- a/test/udp-zero-length-send-recv +++ b/test/udp-zero-length-send-recv | |||
| @@ -24,12 +24,14 @@ if ok ~= 0 then | |||
| 24 | print("send of zero failed with:", ok, emsg) | 24 | print("send of zero failed with:", ok, emsg) |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | assert(r:settimeout(2)) | ||
| 28 | |||
| 27 | ok, emsg = r:receive() | 29 | ok, emsg = r:receive() |
| 28 | 30 | ||
| 29 | if not ok or string.len(ok) ~= 0 then | 31 | if not ok or string.len(ok) ~= 0 then |
| 30 | print("receive of zero failed with:", ok, emsg) | 32 | print("fail - receive of zero failed with:", ok, emsg) |
| 33 | os.exit(1) | ||
| 31 | end | 34 | end |
| 32 | 35 | ||
| 33 | print"ok" | 36 | print"ok" |
| 34 | 37 | ||
| 35 | |||
