[Pkg-javascript-commits] [sockjs-client] 136/434: Better error messages in tests, tweaked large_message test data.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 199aef090ded486b8df083913c35ffd6f677fa33
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Wed Sep 7 15:17:55 2011 +0100

    Better error messages in tests, tweaked large_message test data.
---
 tests/html/src/tests.coffee | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/html/src/tests.coffee b/tests/html/src/tests.coffee
index 0abb942..041b26d 100644
--- a/tests/html/src/tests.coffee
+++ b/tests/html/src/tests.coffee
@@ -29,9 +29,8 @@ echo_factory_factory = (protocol, messages) ->
                 r.send(a[0])
         r.onclose = (e) ->
             if a.length
-                ok(false, "Transport closed prematurely.")
+                ok(false, "Transport closed prematurely. " + e)
             else
-                log('onclose ' + e)
                 ok(true)
             start()
 
@@ -122,11 +121,12 @@ factor_echo_large_message = (protocol) ->
     # Should be larger than 128k - the limit for a single request in
     # some streaming transports.
     messages = [
-        Array(4096).join('x'),
-        Array(4096*2).join('x'),
-        Array(4096*4).join('x'),
-        Array(4096*8).join('x'),
-        Array(Math.pow(2,18)).join('x'),
+        Array(Math.pow(2,1)).join('x'),
+        Array(Math.pow(2,2)).join('x'),
+        Array(Math.pow(2,4)).join('x'),
+        Array(Math.pow(2,8)).join('x'),
+        Array(Math.pow(2,16)).join('x'),
+        Array(Math.pow(2,17)).join('x'),
         Array(Math.pow(2,18)).join('x'),
     ]
     return echo_factory_factory(protocol, messages)
@@ -148,7 +148,10 @@ batch_factory_factory = (protocol, messages) ->
             if counter is messages.length
                 r.close()
         r.onclose = (e) ->
-            ok(true)
+            if counter isnt messages.length
+                ok(false, "Transport closed prematurely. " + e)
+            else
+                ok(true)
             start()
 
 factor_batch_large = (protocol) ->

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list