summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-11-13 21:32:20 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-11-13 21:32:20 (GMT)
commit78719bde32acd127de584529bc9dab776ad56c1d (patch)
treea88fc25f8f47cabec4b04b5c4d4703e82b89c980
parent9ce1c91223f7eddccf9b4590dac636908f221614 (diff)
parentefee4d5fc9d93a3da7decfba9d738b894bbeaf7b (diff)
downloadtk-78719bde32acd127de584529bc9dab776ad56c1d.zip
tk-78719bde32acd127de584529bc9dab776ad56c1d.tar.gz
tk-78719bde32acd127de584529bc9dab776ad56c1d.tar.bz2
merge trunk
-rw-r--r--ChangeLog5
-rw-r--r--tests/winDialog.test44
-rw-r--r--win/tkWinTest.c8
3 files changed, 43 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index dcaa26a..ec4e237 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinTest.c: [Bug 3585396]: winDialog.test requires user
+ * tests/winDialog.test: interaction.
+
2012-11-07 Donal K. Fellows <dkf@users.sf.net>
* generic/tkFocus.c (TkSetFocusWin): [Bug 3574708]: Move window
diff --git a/tests/winDialog.test b/tests/winDialog.test
index 3285a4c..8aa9ac3 100644
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -236,24 +236,36 @@ test winDialog-5.7 {GetFileName: extension begins with .} -constraints {
# }
start {set x [tk_getSaveFile -defaultextension .foo -title Save]}
+ set msg {}
then {
- SetText 0x480 bar
- Click ok
+ if {[catch {SetText 0x47C bar} msg]} {
+ Click cancel
+ } else {
+ Click ok
+ }
}
- string totitle $x
+ string totitle $x$msg
+} -cleanup {
+ unset msg
} -result [string totitle [file join [pwd] bar.foo]]
test winDialog-5.8 {GetFileName: extension doesn't begin with .} -constraints {
- nt testwinevent knownBug
+ nt testwinevent
} -body {
start {set x [tk_getSaveFile -defaultextension foo -title Save]}
+ set msg {}
then {
- SetText 0x480 bar
- Click ok
+ if {[catch {SetText 0x47C bar} msg]} {
+ Click cancel
+ } else {
+ Click ok
+ }
}
- string totitle $x
+ string totitle $x$msg
+} -cleanup {
+ unset msg
} -result [string totitle [file join [pwd] bar.foo]]
test winDialog-5.9 {GetFileName: file types} -constraints {
- nt testwinevent knownBug
+ nt testwinevent
} -body {
# case FILE_TYPES:
@@ -409,15 +421,21 @@ test winDialog-5.22 {GetFileName: call GetSaveFileName} -constraints {
} -result {&Save}
if {[info exists ::env(TEMP)]} {
test winDialog-5.23 {GetFileName: convert \ to /} -constraints {
- nt testwinevent knownBug
+ nt testwinevent
} -body {
+ set msg {}
start {set x [tk_getSaveFile -title Back]}
then {
- SetText 0x480 [file nativename \
- [file join [file normalize $::env(TEMP)] "12x 457"]]
- Click ok
+ if {[catch {SetText 0x47C [file nativename \
+ [file join [file normalize $::env(TEMP)] "12x 457"]]} msg]} {
+ Click cancel
+ } else {
+ Click ok
+ }
}
- return $x
+ return $x$msg
+} -cleanup {
+ unset msg
} -result [file join [file normalize $::env(TEMP)] "12x 457"]
}
test winDialog-5.24 {GetFileName: file types: MakeFilter() succeeds} -constraints {
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index d7d4d0f..3dd7d7a 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -335,10 +335,16 @@ TestwineventCmd(
}
case WM_SETTEXT: {
Tcl_DString ds;
+ BOOL result;
Tcl_UtfToExternalDString(NULL, argv[4], -1, &ds);
- SetDlgItemTextA(hwnd, id, Tcl_DStringValue(&ds));
+ result = SetDlgItemTextA(hwnd, id, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
+ if (result == 0) {
+ Tcl_SetResult(interp, "failed to send text to dialog: ", TCL_STATIC);
+ AppendSystemError(interp, GetLastError());
+ return TCL_ERROR;
+ }
break;
}
case WM_COMMAND: {