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
88bc1748
Commit
88bc1748
authored
Jan 09, 2004
by
Ferenc Wagner
Committed by
Alexandre Julliard
Jan 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pin down LoadStringA behaviour on different buffer lengths.
parent
2a2cd4db
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
0 deletions
+86
-0
.cvsignore
dlls/user/tests/.cvsignore
+2
-0
Makefile.in
dlls/user/tests/Makefile.in
+3
-0
resource.c
dlls/user/tests/resource.c
+59
-0
resource.rc
dlls/user/tests/resource.rc
+22
-0
No files found.
dlls/user/tests/.cvsignore
View file @
88bc1748
...
...
@@ -4,6 +4,8 @@ generated.ok
input.ok
listbox.ok
msg.ok
resource.ok
resource.res
sysparams.ok
testlist.c
user32_test.exe.spec.c
...
...
dlls/user/tests/Makefile.in
View file @
88bc1748
...
...
@@ -11,10 +11,13 @@ CTESTS = \
input.c
\
listbox.c
\
msg.c
\
resource.c
\
sysparams.c
\
win.c
\
wsprintf.c
RC_SRCS
=
resource.rc
@MAKE_TEST_RULES@
### Dependencies:
dlls/user/tests/resource.c
0 → 100644
View file @
88bc1748
/* Unit test suite for resources.
*
* Copyright 2004 Ferenc Wagner
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include <windows.h>
#include "wine/test.h"
void
test_LoadStringA
(
void
)
{
HINSTANCE
hInst
=
GetModuleHandle
(
NULL
);
const
char
str
[]
=
"String resource"
;
/* same in resource.rc */
char
buf
[
128
];
struct
string_test
{
int
bufsiz
;
int
expected
;
};
struct
string_test
tests
[]
=
{{
sizeof
buf
,
sizeof
str
-
1
},
{
sizeof
str
,
sizeof
str
-
1
},
{
sizeof
str
-
1
,
sizeof
str
-
2
}};
int
i
;
assert
(
sizeof
str
<
sizeof
buf
);
for
(
i
=
0
;
i
<
sizeof
tests
/
sizeof
tests
[
0
];
i
++
)
{
const
int
bufsiz
=
tests
[
i
].
bufsiz
;
const
int
expected
=
tests
[
i
].
expected
;
const
int
len
=
LoadStringA
(
hInst
,
0
,
buf
,
bufsiz
);
ok
(
len
==
expected
,
"bufsiz=%d: got %d, expected %d"
,
bufsiz
,
len
,
expected
);
ok
(
!
memcmp
(
buf
,
str
,
len
),
"bufsiz=%d: got '%s', expected '%.*s'"
,
bufsiz
,
buf
,
len
,
str
);
ok
(
buf
[
len
]
==
0
,
"bufsiz=%d: NUL termination missing"
,
bufsiz
);
}
}
START_TEST
(
resource
)
{
test_LoadStringA
();
}
dlls/user/tests/resource.rc
0 → 100644
View file @
88bc1748
/* Unit test suite for resources.
*
* Copyright 2004 Ferenc Wagner
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
STRINGTABLE {
0 "String resource"
}
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