diff options
Diffstat (limited to 'test/testclnt.lua')
| -rw-r--r-- | test/testclnt.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/testclnt.lua b/test/testclnt.lua index ec154ea..ee64d3a 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua | |||
| @@ -642,14 +642,16 @@ function test_maxsize() | |||
| 642 | assert(not ok, "A6 failed: wanted > maxsize should raise") | 642 | assert(not ok, "A6 failed: wanted > maxsize should raise") |
| 643 | ok = pcall(data.receive, data, "*l", nil, math.huge) | 643 | ok = pcall(data.receive, data, "*l", nil, math.huge) |
| 644 | assert(not ok, "A7 failed: maxsize=math.huge should raise (size_t overflow)") | 644 | assert(not ok, "A7 failed: maxsize=math.huge should raise (size_t overflow)") |
| 645 | ok = pcall(data.receive, data, math.huge) | ||
| 646 | assert(not ok, "A8 failed: wanted=math.huge should raise (size_t overflow)") | ||
| 645 | data:settimeout(0.1) | 647 | data:settimeout(0.1) |
| 646 | ok = pcall(data.receive, data, 50, nil, 100) | 648 | ok = pcall(data.receive, data, 50, nil, 100) |
| 647 | assert(ok, "A8 failed: wanted <= maxsize should not raise") | 649 | assert(ok, "A9 failed: wanted <= maxsize should not raise") |
| 648 | data:settimeout(-1) | 650 | data:settimeout(-1) |
| 649 | remote [[ data:send('intact\n') ]] | 651 | remote [[ data:send('intact\n') ]] |
| 650 | local line, err = data:receive("*l", nil, 100) | 652 | local line, err = data:receive("*l", nil, 100) |
| 651 | assert(line == "intact", | 653 | assert(line == "intact", |
| 652 | "A9 failed: socket touched by a failed argcheck (err=" .. | 654 | "A10 failed: socket touched by a failed argcheck (err=" .. |
| 653 | tostring(err) .. ")") | 655 | tostring(err) .. ")") |
| 654 | pass("ok") | 656 | pass("ok") |
| 655 | 657 | ||
