From 45897e29ba44d4c9660e1eb0cfbaff8cf21e0000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edijs=20Kolesnikovi=C4=8Ds?= Date: Sun, 9 Sep 2012 18:12:48 +0000 Subject: [PATCH] [AHK_Window_title_space] Move to 'AHK' dir, add few more checks. Tested and works fine in win2k3 sp2. svn path=/trunk/ahk_tests/; revision=1626 --- Window title space/Space.ahk | 56 +++++++++++++++++++ .../zz_window_title_space_test.ahk | 39 +++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 Window title space/Space.ahk create mode 100644 Window title space/zz_window_title_space_test.ahk diff --git a/Window title space/Space.ahk b/Window title space/Space.ahk new file mode 100644 index 0000000..610be00 --- /dev/null +++ b/Window title space/Space.ahk @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 Edijs Kolesnikovics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +ModuleExe = %A_WorkingDir%\Apps\HelloWorldSpace.exe +TestName = 1.Space + +; Terminate application +TestsTotal++ +SplitPath, ModuleExe, ProcessExe +Process, Close, %ProcessExe% +Process, WaitClose, %ProcessExe%, 4 +if ErrorLevel + TestsFailed("Unable to terminate '" ProcessExe "' process.") +else + TestsOK("") + + +TestsTotal++ +if bContinue +{ + IfNotExist, %ModuleExe% + TestsFailed("Can NOT find '" ModuleExe "'.") + else + { + Run, %ModuleExe% + WndCaption := "Hello, World " + SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match. + WinWaitActive, %WndCaption%,,5 + if ErrorLevel + TestsFailed("OS removed the space from the end of the window caption.") + else + { + Process, Close, %ProcessExe% + Process, WaitClose, %ProcessExe%, 4 + if ErrorLevel + TestsFailed("Unable to terminate '" ProcessExe "' process after running it.") + else + TestsOK("OS did not remove the space from the end of the window title.") + } + } +} diff --git a/Window title space/zz_window_title_space_test.ahk b/Window title space/zz_window_title_space_test.ahk new file mode 100644 index 0000000..a0d00bd --- /dev/null +++ b/Window title space/zz_window_title_space_test.ahk @@ -0,0 +1,39 @@ +/* + * Designed for Thunderbird 2.0.0.18 + * Copyright (C) 2012 Edijs Kolesnikovics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#Include ..\helper_functions.ahk +InitalizeCounters() + +params = +( + + 1.space + +) + +if CheckParam() +{ + ; Those brackets are required! + if 1 = 1.space + { + #include space.ahk + } +} + +ShowTestResults()