summaryrefslogtreecommitdiffstats
path: root/tests/registry.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
commit86ca5531ac0818f99726ba9ad478e277cd5d6e94 (patch)
treecb78904bbef94025a4f19257afc9211ee618e8ce /tests/registry.test
parentd4070e928ea23c067c492b5e594d206a76d9b3d5 (diff)
downloadtcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.zip
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.gz
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.bz2
Use test constraints properly instead of looking in tcl_platform
Consistent method of calling test constraints, and (try to) move constraint setup to the top of the test file
Diffstat (limited to 'tests/registry.test')
-rw-r--r--tests/registry.test21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/registry.test b/tests/registry.test
index 9d475e7..28027d5 100644
--- a/tests/registry.test
+++ b/tests/registry.test
@@ -10,34 +10,32 @@
# Copyright (c) 1997 by Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
-# RCS: @(#) $Id: registry.test,v 1.18 2004/10/27 20:53:37 davygrvy Exp $
+# RCS: @(#) $Id: registry.test,v 1.19 2006/03/21 11:12:29 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
namespace import -force ::tcltest::*
}
-if {$tcl_platform(platform) == "windows"} {
- if [catch {
+testConstraint reg 0
+if {[testConstraint win]} {
+ catch {
# Is the registry extension already static to this shell?
if [catch {load {} Registry; set ::reglib {}}] {
# try the location given to use on the commandline to tcltest
::tcltest::loadTestedCommands
load $::reglib Registry
}
- ::tcltest::testConstraint reg 1
- }] {
- ::tcltest::testConstraint reg 0
+ testConstraint reg 1
}
}
# determine the current locale
-testConstraint english [expr {[llength [info commands testlocale]]
- && [string match "English*" [testlocale all ""]]
+testConstraint english [expr {
+ [llength [info commands testlocale]]
+ && [string match "English*" [testlocale all ""]]
}]
-set hostname [info hostname]
-
test registry-1.1 {argument parsing for registry command} {win reg} {
list [catch {registry} msg] $msg
} {1 {wrong # args: should be "registry option ?arg arg ...?"}}
@@ -202,6 +200,7 @@ test registry-4.2 {GetKeyNames} {win reg} {
set result
} {baz}
test registry-4.3 {GetKeyNames: remote key} {win reg nonPortable english} {
+ set hostname [info hostname]
registry set \\\\$hostname\\HKEY_CLASSES_ROOT\\TclFoobar\\baz
set result [registry keys \\\\gaspode\\HKEY_CLASSES_ROOT\\TclFoobar]
registry delete \\\\$hostname\\HKEY_CLASSES_ROOT\\TclFoobar
@@ -471,6 +470,7 @@ test registry-7.3 {GetValueNames} {win reg} {
set result
} {{} baz blat}
test registry-7.4 {GetValueNames: remote key} {win reg nonPortable english} {
+ set hostname [info hostname]
registry set \\\\$hostname\\HKEY_CLASSES_ROOT\\TclFoobar baz blat
set result [registry values \\\\$hostname\\HKEY_CLASSES_ROOT\\TclFoobar]
registry delete \\\\$hostname\\HKEY_CLASSES_ROOT\\TclFoobar
@@ -598,6 +598,5 @@ test registry-12.5 {BroadcastValue} {win reg} {
} {0 {1 0}}
# cleanup
-unset hostname
::tcltest::cleanupTests
return