Author: gedmurphy
Date: Fri Jun 20 06:20:26 2008
New Revision: 34034
URL:
http://svn.reactos.org/svn/reactos?rev=34034&view=rev
Log:
Save the select test info on close.
The browse dialog now lists all winetest dlls and allows selection of either all tests in
all dlls, all tests within a dll, or the option to choose individual tests. (rewuires a
modified winetest framework)
Modified:
trunk/rostests/winetests/GUI/browsewnd.c
trunk/rostests/winetests/GUI/lang/en-US.rc
trunk/rostests/winetests/GUI/misc.c
trunk/rostests/winetests/GUI/precomp.h
Modified: trunk/rostests/winetests/GUI/browsewnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/browsewnd.c…
==============================================================================
--- trunk/rostests/winetests/GUI/browsewnd.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/browsewnd.c [iso-8859-1] Fri Jun 20 06:20:26 2008
@@ -88,8 +88,6 @@
{
if (!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
- //MessageBoxW(NULL, findFileData.cFileName, NULL, 0);
-
/* set the path */
wcscpy(ptr, szDllPath);
@@ -124,11 +122,9 @@
HTREEITEM hItem)
{
TV_ITEM tvItem;
- WCHAR buf[256];
tvItem.hItem = hItem;
- tvItem.mask = TVIF_PARAM | TVIF_TEXT;
- tvItem.pszText = buf;
+ tvItem.mask = TVIF_PARAM;
(void)TreeView_GetItem(pInfo->hBrowseTV, &tvItem);
@@ -217,8 +213,10 @@
sizeof(TEST_ITEM));
if (pItem)
{
- wcsncpy(pItem->szSelectedDll, lpDll, MAX_PATH);
- wcsncpy(pItem->szRunString, lpRun, MAX_RUN_CMD);
+ if (lpDll)
+ wcsncpy(pItem->szSelectedDll, lpDll, MAX_PATH);
+ if (lpRun)
+ wcsncpy(pItem->szRunString, lpRun, MAX_RUN_CMD);
}
return pItem;
@@ -229,6 +227,7 @@
{
HTREEITEM hRoot;
HIMAGELIST hImgList;
+ PTEST_ITEM pTestItem;
DLLNAME GetTestName;
MODULES GetModulesInTest;
HMODULE hDll;
@@ -250,11 +249,13 @@
hImgList,
TVSIL_NORMAL);
+ pTestItem = BuildTestItemData(L"", L"Full");
+
/* insert the root item into the tree */
hRoot = InsertIntoTreeView(pInfo->hBrowseTV,
NULL,
L"Full",
- 0,
+ pTestItem,
IL_MAIN,
HAS_CHILD);
@@ -272,7 +273,6 @@
LPSTR lpModules, ptr;
LPWSTR lpModW;
INT numMods;
- PTEST_ITEM pTestItem;
lpTestName = GetTestName();
@@ -383,14 +383,43 @@
case WM_COMMAND:
{
- if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
+ switch (LOWORD(wParam))
{
- HeapFree(GetProcessHeap(), 0, pInfo->lpDllList);
- pInfo->lpDllList = NULL;
-
- EndDialog(hDlg,
- LOWORD(wParam));
- return TRUE;
+ case IDOK:
+ {
+ TV_ITEM tvItem;
+
+ tvItem.hItem = TreeView_GetSelection(pInfo->hBrowseTV);
+ tvItem.mask = TVIF_PARAM;
+
+ if (TreeView_GetItem(pInfo->hBrowseTV, &tvItem))
+ {
+ PTEST_ITEM pItem;
+
+ pItem = (PTEST_ITEM)tvItem.lParam;
+ if (pItem)
+ CopyMemory(&pInfo->SelectedTest, pItem,
sizeof(TEST_ITEM));
+
+ EndDialog(hDlg,
+ LOWORD(wParam));
+ }
+ else
+ {
+ DisplayMessage(L"Please select an item");
+ }
+
+ break;
+ }
+
+ case IDCANCEL:
+ {
+ HeapFree(GetProcessHeap(), 0, pInfo->lpDllList);
+ pInfo->lpDllList = NULL;
+
+ EndDialog(hDlg,
+ LOWORD(wParam));
+ return TRUE;
+ }
}
break;
Modified: trunk/rostests/winetests/GUI/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/lang/en-US.…
==============================================================================
--- trunk/rostests/winetests/GUI/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/lang/en-US.rc [iso-8859-1] Fri Jun 20 06:20:26 2008
@@ -29,7 +29,7 @@
CAPTION "Test hierarchy"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- PUSHBUTTON "Select", IDC_SELECT, 202, 7, 50, 14
+ PUSHBUTTON "Select", IDOK, 202, 7, 50, 14
+ PUSHBUTTON "Close", IDCANCEL, 202, 34, 50, 14
CONTROL "", IDC_TREEVIEW, "SysTreeView32", WS_BORDER |
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT, 7, 7, 189, 236
- PUSHBUTTON "Close", IDOK, 202, 34, 50, 14
END
Modified: trunk/rostests/winetests/GUI/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/misc.c?rev=…
==============================================================================
--- trunk/rostests/winetests/GUI/misc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/misc.c [iso-8859-1] Fri Jun 20 06:20:26 2008
@@ -208,7 +208,7 @@
LocalFree(lpMsgBuf);
}
-VOID DisplayString(LPWSTR lpMsg)
+VOID DisplayMessage(LPWSTR lpMsg)
{
MessageBoxW(NULL, lpMsg, L"Note!", MB_ICONEXCLAMATION|MB_OK);
}
Modified: trunk/rostests/winetests/GUI/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/precomp.h?r…
==============================================================================
--- trunk/rostests/winetests/GUI/precomp.h [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/precomp.h [iso-8859-1] Fri Jun 20 06:20:26 2008
@@ -32,7 +32,7 @@
LPWSTR lpDllList;
INT numDlls;
- PTEST_ITEM SelectedTest;
+ TEST_ITEM SelectedTest;
} MAIN_WND_INFO, *PMAIN_WND_INFO;
@@ -46,7 +46,7 @@
/* misc.c */
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height);
-VOID DisplayString(LPWSTR lpMsg);
+VOID DisplayMessage(LPWSTR lpMsg);
VOID DisplayError(INT err);
DWORD AnsiToUnicode(LPCSTR lpSrcStr, LPWSTR *lpDstStr);