Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1c6f813b
Commit
1c6f813b
authored
Nov 27, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Nov 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Fix test failures on Vista and higher.
parent
98fef79f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
5 deletions
+48
-5
progman_dde.c
dlls/shell32/tests/progman_dde.c
+48
-5
No files found.
dlls/shell32/tests/progman_dde.c
View file @
1c6f813b
...
...
@@ -96,13 +96,20 @@ static void init_strings(void)
if
(
pSHGetSpecialFolderPathA
)
{
/* FIXME: On Vista+ we should only use CSIDL_PROGRAMS */
pSHGetSpecialFolderPathA
(
NULL
,
Programs
,
CSIDL_PROGRAMS
,
FALSE
);
if
(
!
pSHGetSpecialFolderPathA
(
NULL
,
CommonPrograms
,
CSIDL_COMMON_PROGRAMS
,
FALSE
))
{
/* Win9x */
lstrcpyA
(
CommonPrograms
,
Programs
);
}
if
(
GetProcAddress
(
GetModuleHandleA
(
"shell32.dll"
),
"SHGetKnownFolderPath"
))
{
/* Vista and higher use CSIDL_PROGRAMS for these tests.
* Wine doesn't have SHGetKnownFolderPath yet but should most likely follow
* this new ProgMan DDE behavior once implemented.
*/
lstrcpyA
(
CommonPrograms
,
Programs
);
}
pSHGetSpecialFolderPathA
(
NULL
,
startup
,
CSIDL_STARTUP
,
FALSE
);
lstrcpyA
(
Startup
,
(
strrchr
(
startup
,
'\\'
)
+
1
));
}
...
...
@@ -542,12 +549,25 @@ static void CompoundCommandTest(DWORD instance, HCONV hConv, const char *command
}
}
static
void
CreateAddItemText
(
char
*
itemtext
,
const
char
*
cmdline
,
const
char
*
name
)
{
lstrcpyA
(
itemtext
,
"[AddItem("
);
lstrcatA
(
itemtext
,
cmdline
);
lstrcatA
(
itemtext
,
","
);
lstrcatA
(
itemtext
,
name
);
lstrcatA
(
itemtext
,
")]"
);
}
/* 1st set of tests */
static
int
DdeTestProgman
(
DWORD
instance
,
HCONV
hConv
)
{
HDDEDATA
hData
;
UINT
error
;
int
testnum
;
char
temppath
[
MAX_PATH
];
char
f1g1
[
MAX_PATH
],
f2g1
[
MAX_PATH
],
f3g1
[
MAX_PATH
],
f1g3
[
MAX_PATH
],
f2g3
[
MAX_PATH
];
char
itemtext
[
MAX_PATH
+
20
];
char
comptext
[
2
*
(
MAX_PATH
+
20
)
+
21
];
testnum
=
1
;
/* Invalid Command */
...
...
@@ -555,12 +575,23 @@ static int DdeTestProgman(DWORD instance, HCONV hConv)
ok
(
error
==
DMLERR_NOTPROCESSED
,
"InvalidCommand(), expected error %s, received %s.
\n
"
,
GetStringFromError
(
DMLERR_NOTPROCESSED
),
GetStringFromError
(
error
));
/* On Vista+ the files have to exist when adding a link */
GetTempPathA
(
MAX_PATH
,
temppath
);
GetTempFileNameA
(
temppath
,
"dde"
,
0
,
f1g1
);
GetTempFileNameA
(
temppath
,
"dde"
,
0
,
f2g1
);
GetTempFileNameA
(
temppath
,
"dde"
,
0
,
f3g1
);
GetTempFileNameA
(
temppath
,
"dde"
,
0
,
f1g3
);
GetTempFileNameA
(
temppath
,
"dde"
,
0
,
f2g3
);
/* CreateGroup Tests (including AddItem, DeleteItem) */
CreateGroupTest
(
instance
,
hConv
,
"[CreateGroup(Group1)]"
,
DMLERR_NO_ERROR
,
"Group1"
,
Group1Title
,
DDE_TEST_COMMON
|
DDE_TEST_CREATEGROUP
|
testnum
++
);
AddItemTest
(
instance
,
hConv
,
"[AddItem(c:
\\
f1g1,f1g1Name)]"
,
DMLERR_NO_ERROR
,
"f1g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
AddItemTest
(
instance
,
hConv
,
"[AddItem(c:
\\
f2g1,f2g1Name)]"
,
DMLERR_NO_ERROR
,
"f2g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
CreateAddItemText
(
itemtext
,
f1g1
,
"f1g1Name"
);
AddItemTest
(
instance
,
hConv
,
itemtext
,
DMLERR_NO_ERROR
,
"f1g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
CreateAddItemText
(
itemtext
,
f2g1
,
"f2g1Name"
);
AddItemTest
(
instance
,
hConv
,
itemtext
,
DMLERR_NO_ERROR
,
"f2g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
DeleteItemTest
(
instance
,
hConv
,
"[DeleteItem(f2g1Name)]"
,
DMLERR_NO_ERROR
,
"f2g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_DELETEITEM
|
testnum
++
);
AddItemTest
(
instance
,
hConv
,
"[AddItem(c:
\\
f3g1,f3g1Name)]"
,
DMLERR_NO_ERROR
,
"f3g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
CreateAddItemText
(
itemtext
,
f3g1
,
"f3g1Name"
);
AddItemTest
(
instance
,
hConv
,
itemtext
,
DMLERR_NO_ERROR
,
"f3g1Name.lnk"
,
"Group1"
,
DDE_TEST_COMMON
|
DDE_TEST_ADDITEM
|
testnum
++
);
CreateGroupTest
(
instance
,
hConv
,
"[CreateGroup(Group2)]"
,
DMLERR_NO_ERROR
,
"Group2"
,
Group2Title
,
DDE_TEST_COMMON
|
DDE_TEST_CREATEGROUP
|
testnum
++
);
/* Create Group that already exists - same instance */
CreateGroupTest
(
instance
,
hConv
,
"[CreateGroup(Group1)]"
,
DMLERR_NO_ERROR
,
"Group1"
,
Group1Title
,
DDE_TEST_COMMON
|
DDE_TEST_CREATEGROUP
|
testnum
++
);
...
...
@@ -575,12 +606,24 @@ static int DdeTestProgman(DWORD instance, HCONV hConv)
DeleteGroupTest
(
instance
,
hConv
,
"[DeleteGroup(Group1)]"
,
DMLERR_NO_ERROR
,
"Group1"
,
DDE_TEST_DELETEGROUP
|
testnum
++
);
/* Compound Execute String Command */
CompoundCommandTest
(
instance
,
hConv
,
"[CreateGroup(Group3)][AddItem(c:
\\
f1g3,f1g3Name)][AddItem(c:
\\
f2g3,f2g3Name)]"
,
DMLERR_NO_ERROR
,
"Group3"
,
Group3Title
,
"f1g3Name.lnk"
,
"f2g3Name.lnk"
,
DDE_TEST_COMMON
|
DDE_TEST_COMPOUND
|
testnum
++
);
lstrcpyA
(
comptext
,
"[CreateGroup(Group3)]"
);
CreateAddItemText
(
itemtext
,
f1g3
,
"f1g3Name"
);
lstrcatA
(
comptext
,
itemtext
);
CreateAddItemText
(
itemtext
,
f2g3
,
"f2g3Name"
);
lstrcatA
(
comptext
,
itemtext
);
CompoundCommandTest
(
instance
,
hConv
,
comptext
,
DMLERR_NO_ERROR
,
"Group3"
,
Group3Title
,
"f1g3Name.lnk"
,
"f2g3Name.lnk"
,
DDE_TEST_COMMON
|
DDE_TEST_COMPOUND
|
testnum
++
);
DeleteGroupTest
(
instance
,
hConv
,
"[DeleteGroup(Group3)]"
,
DMLERR_NO_ERROR
,
"Group3"
,
DDE_TEST_DELETEGROUP
|
testnum
++
);
/* Full Parameters of Add Item */
/* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */
DeleteFileA
(
f1g1
);
DeleteFileA
(
f2g1
);
DeleteFileA
(
f3g1
);
DeleteFileA
(
f1g3
);
DeleteFileA
(
f2g3
);
return
testnum
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment