Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9879f78c
Commit
9879f78c
authored
Mar 22, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Added some tests for FindResource.
parent
856af1b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
Makefile.in
dlls/kernel32/tests/Makefile.in
+2
-0
resource.c
dlls/kernel32/tests/resource.c
+37
-0
resource.rc
dlls/kernel32/tests/resource.rc
+26
-0
No files found.
dlls/kernel32/tests/Makefile.in
View file @
9879f78c
...
...
@@ -39,6 +39,8 @@ CTESTS = \
virtual.c
\
volume.c
RC_SRCS
=
resource.rc
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/kernel32/tests/resource.c
View file @
9879f78c
...
...
@@ -263,6 +263,42 @@ end:
CloseHandle
(
file
);
}
static
void
test_find_resource
(
void
)
{
HRSRC
rsrc
;
rsrc
=
FindResourceW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
(
LPCWSTR
)
RT_MENU
);
ok
(
rsrc
!=
0
,
"resource not found
\n
"
);
rsrc
=
FindResourceExW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
RT_MENU
,
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
));
ok
(
rsrc
!=
0
,
"resource not found
\n
"
);
rsrc
=
FindResourceExW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
RT_MENU
,
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_DEFAULT
));
ok
(
rsrc
!=
0
,
"resource not found
\n
"
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
(
LPCWSTR
)
RT_DIALOG
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
MAKEINTRESOURCE
(
2
),
(
LPCWSTR
)
RT_MENU
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_NAME_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceExW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
RT_MENU
,
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
)
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceExW
(
GetModuleHandle
(
0
),
(
LPCWSTR
)
RT_MENU
,
(
LPCWSTR
)
MAKEINTRESOURCE
(
1
),
MAKELANGID
(
LANG_FRENCH
,
SUBLANG_DEFAULT
)
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
}
START_TEST
(
resource
)
{
DeleteFile
(
filename
);
...
...
@@ -283,4 +319,5 @@ START_TEST(resource)
update_resources_version
();
check_exe
(
check_not_empty
);
DeleteFile
(
filename
);
test_find_resource
();
}
dlls/kernel32/tests/resource.rc
0 → 100644
View file @
9879f78c
/*
* Resources for kernel test suite.
*
* Copyright 2008 Alexandre Julliard
*
* 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 St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
1 MENU LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
{
MENUITEM "foo", 1
}
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