Index: tests/object-system.test =================================================================== diff -u -N -r2152f4606b7c4e81fd18018c7c43bf29961a9d1b -rfbd7f24c6111a5328c15bb7c47e9a45c9928357f --- tests/object-system.test (.../object-system.test) (revision 2152f4606b7c4e81fd18018c7c43bf29961a9d1b) +++ tests/object-system.test (.../object-system.test) (revision fbd7f24c6111a5328c15bb7c47e9a45c9928357f) @@ -317,16 +317,36 @@ # -# Test instances of diamond class structure. Leave class structure -# around until exit to test handling of pot. duplicated entries +# Test protection against (most likely unintended) deletion of base +# classes. # +? {catch {nx::Object destroy}} 1 +? {::nsf::object::exists nx::Object} 1 +? {catch {nx::Object create nx::Object}} 1 +? {::nsf::object::exists nx::Object} 1 +? {catch {nx::Object create nx::Class}} 1 +? {::nsf::object::exists nx::Class} 1 +? {catch {nx::Class create nx::Object}} 1 +? {catch {nx::Class create nx::Class}} 1 +? {catch {rename nx::Object ""}} 1 +? {::nsf::object::exists nx::Object} 1 +? {catch {rename nx::Object ""}} 1 +? {::nsf::object::exists nx::Object} 1 +? {catch {rename nx::Class ""}} 1 +? {::nsf::object::exists nx::Class} 1 + +# +# Test instances of diamond class structure. +# +# Leave class structure around until exit to test handling of +# potentially duplicated entries during final cleanup +# nx::Class create A nx::Class create B1 -superclass A nx::Class create B2 -superclass A nx::Class create C -superclass {B1 B2} ? {C create c1} ::c1 ? {A info instances -closure} ::c1 - puts stderr ===EXIT ::nsf::configure dtrace off