You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2014/04/14 00:41:31 UTC

svn commit: r1587117 - in /tcl/rivet/trunk: ChangeLog src/rivetcmds/rivetCore.c tests/checkfails.tcl tests/failtest.tcl tests/failtest.test

Author: mxmanghi
Date: Sun Apr 13 22:41:31 2014
New Revision: 1587117

URL: http://svn.apache.org/r1587117
Log:
    * src/rivetcmds/rivetCore.c: misplaced check on request_rec in Rivet_InspectCmd 
    * tests/failtest.tcl,failtest.test,checkfail.tcl: adding tests for ::rivet::inspect


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/src/rivetcmds/rivetCore.c
    tcl/rivet/trunk/tests/checkfails.tcl
    tcl/rivet/trunk/tests/failtest.tcl
    tcl/rivet/trunk/tests/failtest.test

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1587117&r1=1587116&r2=1587117&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Sun Apr 13 22:41:31 2014
@@ -1,3 +1,7 @@
+2014-04-11 Massimo Manghi <mx...@apache.org>
+    * src/rivetcmds/rivetCore.c: misplaced check on request_rec in Rivet_InspectCmd
+    * tests/failtest.tcl,failtest.test,checkfail.tcl: adding tests for ::rivet::inspect
+
 2014-04-07 Massimo Manghi <mx...@apache.org>
     * tests/failtest.[test|tcl],failcheck.tcl: implementing test for consistent error
     handling by commands that are supposed to refuse execution outside of a request processing

Modified: tcl/rivet/trunk/src/rivetcmds/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/rivetcmds/rivetCore.c?rev=1587117&r1=1587116&r2=1587117&view=diff
==============================================================================
--- tcl/rivet/trunk/src/rivetcmds/rivetCore.c (original)
+++ tcl/rivet/trunk/src/rivetcmds/rivetCore.c Sun Apr 13 22:41:31 2014
@@ -1368,12 +1368,12 @@ TCL_CMD_HEADER( Rivet_InspectCmd )
         Tcl_Obj* par_name = objv[1];
         char*    cmd_arg  = Tcl_GetStringFromObj(par_name,NULL);
 
-        CHECK_REQUEST_REC(globals->r,"::rivet::inspect <conf_parameter>");
         Tcl_IncrRefCount(par_name);
         if (STRNEQU(cmd_arg,"-all"))
         {
             Tcl_Obj* dictObj;
             
+            CHECK_REQUEST_REC(globals->r,"::rivet::inspect -all");
             rsc = Rivet_GetConf(globals->r); 
             dictObj = Rivet_CurrentConfDict(interp,rsc);
             Tcl_IncrRefCount(dictObj);

Modified: tcl/rivet/trunk/tests/checkfails.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/checkfails.tcl?rev=1587117&r1=1587116&r2=1587117&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/checkfails.tcl (original)
+++ tcl/rivet/trunk/tests/checkfails.tcl Sun Apr 13 22:41:31 2014
@@ -1,9 +1,27 @@
 
+# -- check_inspect 
+#
+# tests ::rivet::inspect in its different forms
+#
+
+proc check_inspect { cmd_form args } {
+
+    set ::failtest(inspect${cmd_form}) 0
+    
+    set cmdeval [list ::rivet::inspect {*}$args]
+    if {[catch {eval $cmdeval}]} { set ::failtest(inspect${cmd_form}) 1 }
+
+}
+
+# -- check_fail
+#
+# general purpose test function for commands having a single form 
+#
+
 proc check_fail {cmd args} {
     set ::failtest($cmd) 0
 
     set cmdeval [list $cmd {*}$args]
-    
     if {[catch {eval $cmdeval}]} { set ::failtest($cmd) 1 }
 }
 
@@ -23,4 +41,9 @@ check_fail raw_post
 check_fail var all
 check_fail no_body
 check_fail virtual_filename unkn
-check_fail inspect 
+check_inspect 0 
+check_inspect 1 ChildInitScript
+check_inspect 2 -all
+check_inspect 3 server
+check_inspect 4 script
+

Modified: tcl/rivet/trunk/tests/failtest.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/failtest.tcl?rev=1587117&r1=1587116&r2=1587117&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/failtest.tcl (original)
+++ tcl/rivet/trunk/tests/failtest.tcl Sun Apr 13 22:41:31 2014
@@ -1,3 +1,10 @@
+#
+# invoked from failtest.test
+#
+# performs a sorted dump of the ::failtest array built
+# in the ChildInitScript procedure (source checkfail.tcl)
+# 
+#
 foreach cmd [lsort [array names ::failtest]] {
     puts "$cmd->$::failtest($cmd)"
 }

Modified: tcl/rivet/trunk/tests/failtest.test
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/failtest.test?rev=1587117&r1=1587116&r2=1587117&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/failtest.test (original)
+++ tcl/rivet/trunk/tests/failtest.test Sun Apr 13 22:41:31 2014
@@ -1,4 +1,6 @@
 # This test is for those commands that must not run outside of a request processing
+# Also command ::rivet::inspect is tested in either forms, those that allow a call from
+# outside request processing and those that must denied it.
 
 ::tcltest::test failtest-1.1 {commands that must refuse to run in child init or exit} {
     apachetest::start { 
@@ -15,7 +17,11 @@
 env->1
 headers->1
 include->1
-inspect->1
+inspect0->1
+inspect1->1
+inspect2->1
+inspect3->0
+inspect4->0
 load_env->1
 load_headers->1
 makeurl->1



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org