about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-08-16 21:51:38 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-08-16 21:51:38 +0000
commite58982f645d65d9ad63759970150ffe28aa30883 (patch)
treed1ca254b6642eec6dccd26f27f19884bcfcb350b /test
parentd53e945f458ce5ad54706fbff40d096aeb975985 (diff)
downloadunicorn-e58982f645d65d9ad63759970150ffe28aa30883.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@331 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test')
-rw-r--r--test/test_http11.rb17
1 files changed, 4 insertions, 13 deletions
diff --git a/test/test_http11.rb b/test/test_http11.rb
index a633ce8..00fecf2 100644
--- a/test/test_http11.rb
+++ b/test/test_http11.rb
@@ -60,9 +60,9 @@ class HttpParserTest < Test::Unit::TestCase
     res = count.to_s + "/"
     
     if readable
-      res << Digest::SHA1.hexdigest(rand(count * 1000).to_s) * (count / 40)
+      res << Digest::SHA1.hexdigest(rand(count * 100).to_s) * (count / 40)
     else
-      res << Digest::SHA1.digest(rand(count * 1000).to_s) * (count / 20)
+      res << Digest::SHA1.digest(rand(count * 100).to_s) * (count / 20)
     end
 
     return res
@@ -72,17 +72,8 @@ class HttpParserTest < Test::Unit::TestCase
   def test_horrible_queries
     parser = HttpParser.new
 
-    # first verify that large random get requests fail
-    100.times do |c|
-      get = "GET /#{rand_data(1024, 1024+(c*1024))} HTTP/1.1\r\n"
-      assert_raises Mongrel::HttpParserError do
-        parser.execute({}, get, 0)
-        parser.reset
-      end
-    end
-
     # then that large header names are caught
-    100.times do |c|
+    10.times do |c|
       get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-#{rand_data(1024, 1024+(c*1024))}: Test\r\n\r\n"
       assert_raises Mongrel::HttpParserError do
         parser.execute({}, get, 0)
@@ -91,7 +82,7 @@ class HttpParserTest < Test::Unit::TestCase
     end
 
     # then that large mangled field values are caught
-    100.times do |c|
+    10.times do |c|
       get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-Test: #{rand_data(1024, 1024+(c*1024), false)}\r\n\r\n"
       assert_raises Mongrel::HttpParserError do
         parser.execute({}, get, 0)