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
40d74488
Commit
40d74488
authored
Oct 17, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Replace RegDeleteTreeW to run the tests again.
parent
78c75e20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
33 deletions
+26
-33
assoc.c
dlls/shlwapi/tests/assoc.c
+26
-33
No files found.
dlls/shlwapi/tests/assoc.c
View file @
40d74488
...
@@ -32,19 +32,6 @@ static const WCHAR dotBad[] = { '.','b','a','d',0 };
...
@@ -32,19 +32,6 @@ static const WCHAR dotBad[] = { '.','b','a','d',0 };
static
const
WCHAR
open
[]
=
{
'o'
,
'p'
,
'e'
,
'n'
,
0
};
static
const
WCHAR
open
[]
=
{
'o'
,
'p'
,
'e'
,
'n'
,
0
};
static
const
WCHAR
invalid
[]
=
{
'i'
,
'n'
,
'v'
,
'a'
,
'l'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
invalid
[]
=
{
'i'
,
'n'
,
'v'
,
'a'
,
'l'
,
'i'
,
'd'
,
0
};
/* copied from libs/wine/string.c */
WCHAR
*
strstrW
(
const
WCHAR
*
str
,
const
WCHAR
*
sub
)
{
while
(
*
str
)
{
const
WCHAR
*
p1
=
str
,
*
p2
=
sub
;
while
(
*
p1
&&
*
p2
&&
*
p1
==
*
p2
)
{
p1
++
;
p2
++
;
}
if
(
!*
p2
)
return
(
WCHAR
*
)
str
;
str
++
;
}
return
NULL
;
}
static
void
test_getstring_bad
(
void
)
static
void
test_getstring_bad
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -145,57 +132,63 @@ static void test_getstring_no_extra(void)
...
@@ -145,57 +132,63 @@ static void test_getstring_no_extra(void)
LONG
ret
;
LONG
ret
;
HKEY
hkey
;
HKEY
hkey
;
HRESULT
hr
;
HRESULT
hr
;
static
const
W
CHAR
dotWinetest
[]
=
{
static
const
CHAR
dotWinetest
[]
=
{
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
};
static
const
W
CHAR
winetestfile
[]
=
{
static
const
CHAR
winetestfile
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
0
};
};
static
const
W
CHAR
winetestfileAction
[]
=
{
static
const
CHAR
winetestfileAction
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'f'
,
'i'
,
'l'
,
'e'
,
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'\\'
,
'f'
,
'o'
,
'o'
,
'\\'
,
'f'
,
'o'
,
'o'
,
'\\'
,
'c'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
0
'\\'
,
'c'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
0
};
};
static
const
W
CHAR
action
[]
=
{
static
const
CHAR
action
[]
=
{
'n'
,
'o'
,
't'
,
'e'
,
'p'
,
'a'
,
'd'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
'n'
,
'o'
,
't'
,
'e'
,
'p'
,
'a'
,
'd'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
};
W
CHAR
buf
[
MAX_PATH
];
CHAR
buf
[
MAX_PATH
];
DWORD
len
=
MAX_PATH
;
DWORD
len
=
MAX_PATH
;
ret
=
RegCreateKeyW
(
HKEY_CLASSES_ROOT
,
dotWinetest
,
&
hkey
);
buf
[
0
]
=
'\0'
;
if
(
ret
!=
ERROR_SUCCESS
)
ret
=
RegCreateKeyA
(
HKEY_CLASSES_ROOT
,
dotWinetest
,
&
hkey
);
if
(
ret
!=
ERROR_SUCCESS
)
{
skip
(
"failed to create dotWinetest key
\n
"
);
skip
(
"failed to create dotWinetest key
\n
"
);
ret
=
RegSetValueW
(
hkey
,
NULL
,
REG_SZ
,
winetestfile
,
return
;
lstrlenW
(
winetestfile
));
}
ret
=
RegSetValueA
(
hkey
,
NULL
,
REG_SZ
,
winetestfile
,
lstrlenA
(
winetestfile
));
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
if
(
ret
!=
ERROR_SUCCESS
)
if
(
ret
!=
ERROR_SUCCESS
)
{
{
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
dotWinetest
);
skip
(
"failed to set dotWinetest key
\n
"
);
skip
(
"failed to set dotWinetest key
\n
"
);
goto
cleanup
;
}
}
ret
=
RegCreateKey
W
(
HKEY_CLASSES_ROOT
,
winetestfileAction
,
&
hkey
);
ret
=
RegCreateKey
A
(
HKEY_CLASSES_ROOT
,
winetestfileAction
,
&
hkey
);
if
(
ret
!=
ERROR_SUCCESS
)
if
(
ret
!=
ERROR_SUCCESS
)
{
{
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
dotWinetest
);
skip
(
"failed to create winetestfileAction key
\n
"
);
skip
(
"failed to create winetestfileAction key
\n
"
);
goto
cleanup
;
}
}
ret
=
RegSetValueW
(
hkey
,
NULL
,
REG_SZ
,
action
,
lstrlenW
(
action
));
ret
=
RegSetValueA
(
hkey
,
NULL
,
REG_SZ
,
action
,
lstrlenA
(
action
));
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
if
(
ret
!=
ERROR_SUCCESS
)
if
(
ret
!=
ERROR_SUCCESS
)
{
{
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
dotWinetest
);
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
winetestfile
);
skip
(
"failed to set winetestfileAction key
\n
"
);
skip
(
"failed to set winetestfileAction key
\n
"
);
goto
cleanup
;
}
}
hr
=
AssocQueryStringW
(
0
,
ASSOCSTR_EXECUTABLE
,
dotWinetest
,
NULL
,
hr
=
AssocQueryStringA
(
0
,
ASSOCSTR_EXECUTABLE
,
dotWinetest
,
NULL
,
buf
,
&
len
);
buf
,
&
len
);
expect_hr
(
S_OK
,
hr
);
expect_hr
(
S_OK
,
hr
);
ok
(
strstrW
(
buf
,
action
)
!=
NULL
,
"exe path does not contain notepad
\n
"
);
ok
(
strstr
(
buf
,
action
)
!=
NULL
,
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
dotWinetest
);
"got '%s' (Expected result to include 'notepad.exe')
\n
"
,
buf
);
RegDeleteTreeW
(
HKEY_CLASSES_ROOT
,
winetestfile
);
cleanup:
SHDeleteKeyA
(
HKEY_CLASSES_ROOT
,
dotWinetest
);
SHDeleteKeyA
(
HKEY_CLASSES_ROOT
,
winetestfile
);
}
}
START_TEST
(
assoc
)
START_TEST
(
assoc
)
...
...
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