[svn:mod_parrot] r340 - mod_parrot/trunk/t/response/TestAPI

[email protected] Mon, 26 May 2008 11:12:49 -0700 (PDT)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Mon May 26 11:12:48 2008
New Revision: 340

Modified:
   mod_parrot/trunk/t/response/TestAPI/request_rec.pir

Log:
add get_basic_auth_pw test to set up environment for note_basic_auth_failure
this fixes a nasty segfault


Modified: mod_parrot/trunk/t/response/TestAPI/request_rec.pir
==============================================================================
--- mod_parrot/trunk/t/response/TestAPI/request_rec.pir	(original)
+++ mod_parrot/trunk/t/response/TestAPI/request_rec.pir	Mon May 26 11:12:48 2008
@@ -9,7 +9,7 @@
 
     ap_const = get_root_global [ 'Apache'; 'Constants' ], 'ap_constants'
 
-    r.'puts'("1..31\n")
+    r.'puts'("1..32\n")
 
   # XXX this should be fatal on failure
   START_1:
@@ -330,30 +330,41 @@
   OK_29:
     r.'puts'("ok 29 - is_initial_req()\n")
 
-  # NOTE: this test will emit authentication headers, but we don't return
-  # a 401 unauthorized status, so it shouldn't cause a problem
+  # this happens to set up auth environment for note_basic_auth_failure()
   START_30:
     push_eh NOT_OK_30
-    r.'note_basic_auth_failure'()
+    $P0 = r.'get_basic_auth_pw'()
     pop_eh
     goto OK_30
   NOT_OK_30:
     r.'puts'("not ")
   OK_30:
-    r.'puts'("ok 30 - note_basic_auth_failure()\n")
+    r.'puts'("ok 30 - get_basic_auth_pw()\n")
 
-  # XXX putc() "succeeds" but doesn't output the proper character
+  # NOTE: this test will emit authentication headers, but we don't return
+  # a 401 unauthorized status, so it shouldn't cause a problem
   START_31:
-  #  push_eh NOT_OK_31
+    push_eh NOT_OK_31
+    r.'note_basic_auth_failure'()
+    pop_eh
+    goto OK_31
+  NOT_OK_31:
+    r.'puts'("not ")
+  OK_31:
+    r.'puts'("ok 31 - note_basic_auth_failure()\n")
+
+  # XXX putc() "succeeds" but doesn't output the proper character
+  START_32:
+  #  push_eh NOT_OK_32
   #  r.'putc'('#')
   #  pop_eh
   #  r.'puts'("\n")
-  #  goto OK_31
-  #NOT_OK_31:
+  #  goto OK_32
+  #NOT_OK_32:
   #  r.'puts'("not ")
-  #OK_31:
-  #  r.'puts'("ok 31 - putc()\n")
-  r.'puts'("not ok 31 - putc() # TODO succeeds with incorrect output\n")
+  #OK_32:
+  #  r.'puts'("ok 32 - putc()\n")
+  r.'puts'("not ok 32 - putc() # TODO succeeds with incorrect output\n")
 
     # STILL TODO (not tested in original client-side tests)
     # assbackwards