diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-07-02 18:44:05 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-07-02 18:44:05 +0000 |
commit | b1a4ad2b1996936744c679e6ae563986ff701a3a (patch) | |
tree | c446d3bf2fe5bb0452027ee93388e505c2dfa53d /test | |
parent | 63807d647624df155a81a2b323f370e2c36192f6 (diff) | |
download | luasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.tar.gz luasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.tar.bz2 luasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.zip |
Compiles and runs on windows.
Diffstat (limited to 'test')
-rw-r--r-- | test/mimetest.lua | 2 | ||||
-rw-r--r-- | test/testclnt.lua | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/mimetest.lua b/test/mimetest.lua index 0b3db33..413a83b 100644 --- a/test/mimetest.lua +++ b/test/mimetest.lua | |||
@@ -8,7 +8,7 @@ local qptest = "qptest.bin" | |||
8 | local eqptest = "qptest.bin2" | 8 | local eqptest = "qptest.bin2" |
9 | local dqptest = "qptest.bin3" | 9 | local dqptest = "qptest.bin3" |
10 | 10 | ||
11 | local b64test = "luasocket.dylib" | 11 | local b64test = "luasocket.dll" |
12 | local eb64test = "b64test.bin" | 12 | local eb64test = "b64test.bin" |
13 | local db64test = "b64test.bin2" | 13 | local db64test = "b64test.bin2" |
14 | 14 | ||
diff --git a/test/testclnt.lua b/test/testclnt.lua index 38dc19a..cdd2c08 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua | |||
@@ -438,6 +438,25 @@ function rebind_test() | |||
438 | end | 438 | end |
439 | 439 | ||
440 | ------------------------------------------------------------------------ | 440 | ------------------------------------------------------------------------ |
441 | function getstats_test() | ||
442 | reconnect() | ||
443 | local t = 0 | ||
444 | for i = 1, 25 do | ||
445 | local c = math.random(1, 100) | ||
446 | remote (string.format ([[ | ||
447 | str = data:receive(%d) | ||
448 | data:send(str) | ||
449 | ]], c)) | ||
450 | c:send(string.rep("a", c)) | ||
451 | c:receive(c) | ||
452 | local r, s, a = c:getstats() | ||
453 | assert(r == t, "received count failed") | ||
454 | assert(s == t, "sent count failed") | ||
455 | end | ||
456 | print("ok") | ||
457 | end | ||
458 | |||
459 | ------------------------------------------------------------------------ | ||
441 | test("method registration") | 460 | test("method registration") |
442 | test_methods(socket.tcp(), { | 461 | test_methods(socket.tcp(), { |
443 | "accept", | 462 | "accept", |
@@ -499,6 +518,9 @@ test("accept function: ") | |||
499 | accept_timeout() | 518 | accept_timeout() |
500 | accept_errors() | 519 | accept_errors() |
501 | 520 | ||
521 | test("getstats test") | ||
522 | getstats_test() | ||
523 | |||
502 | test("character line") | 524 | test("character line") |
503 | test_asciiline(1) | 525 | test_asciiline(1) |
504 | test_asciiline(17) | 526 | test_asciiline(17) |