If you do 'nsv_unset myarray', all the keys in the array are removed,
but the array itself is left behind (which is wrong).  Also, no test
checked that behavior.  Fixing the test is easy, I did that here:

  
https://bitbucket.org/apiskors/naviserver/commits/02e64d5e1a5c181b2668c1cf24f7321dc70baed9

The (failing) test output is below.

The bug is probably in NsTclNsvUnsetObjCmd().  The old AOLserver
4.0.10 version included special code to handle the "nsv_unset foo"
objc == 2 case, but Naviserver's re-write in 2008 seems to have left
that out.

Also, why do both Unset() and Ns_VarUnset() exist?  Ns_VarUnset() is a
wrapper around Unset(), but it is never actually used, instead other
code calls Unset() directly.


$ make test TCLTESTARGS='-file ns_nsv.test'
==== ns_nsv-3.5 nsv_unset array FAILED
==== Contents of test case:

    nsv_unset a
    list [nsv_exists a k1] [nsv_exists a k2] [nsv_exists a k3] [nsv_array 
exists a]

---- Result was:
0 0 0 1
---- Result should have been (exact matching):
0 0 0 0
==== ns_nsv-3.5 FAILED

-- 
Andrew Piskorski <a...@piskorski.com>

------------------------------------------------------------------------------
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to