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
7a7be050
Commit
7a7be050
authored
Mar 22, 2004
by
Jon Griffiths
Committed by
Alexandre Julliard
Mar 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test SHSearchMapInt.
parent
ad1190e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
.cvsignore
dlls/shlwapi/tests/.cvsignore
+1
-0
Makefile.in
dlls/shlwapi/tests/Makefile.in
+1
-0
ordinal.c
dlls/shlwapi/tests/ordinal.c
+91
-0
No files found.
dlls/shlwapi/tests/.cvsignore
View file @
7a7be050
...
...
@@ -2,6 +2,7 @@ Makefile
clist.ok
clsid.ok
generated.ok
ordinal.ok
path.ok
shreg.ok
string.ok
...
...
dlls/shlwapi/tests/Makefile.in
View file @
7a7be050
...
...
@@ -9,6 +9,7 @@ CTESTS = \
clist.c
\
clsid.c
\
generated.c
\
ordinal.c
\
path.c
\
shreg.c
\
string.c
...
...
dlls/shlwapi/tests/ordinal.c
0 → 100644
View file @
7a7be050
/* Unit test suite for SHLWAPI ordinal functions
*
* Copyright 2004 Jon Griffiths
*
* 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 <stdlib.h>
#include <stdio.h>
#include "wine/test.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#define NO_SHLWAPI_REG
#define NO_SHLWAPI_PATH
#define NO_SHLWAPI_GDI
#define NO_SHLWAPI_STREAM
#include "shlwapi.h"
/* Function ptrs for ordinal calls */
static
HMODULE
hShlwapi
;
static
int
(
WINAPI
*
pSHSearchMapInt
)(
const
int
*
,
const
int
*
,
int
,
int
);
static
void
test_SHSearchMapInt
(
void
)
{
int
keys
[
8
],
values
[
8
];
int
i
=
0
;
if
(
!
pSHSearchMapInt
)
return
;
memset
(
keys
,
0
,
sizeof
(
keys
));
memset
(
values
,
0
,
sizeof
(
values
));
keys
[
0
]
=
99
;
values
[
0
]
=
101
;
/* NULL key/value lists crash native, so skip testing them */
/* 1 element */
i
=
pSHSearchMapInt
(
keys
,
values
,
1
,
keys
[
0
]);
ok
(
i
==
values
[
0
],
"Len 1, expected %d, got %d
\n
"
,
values
[
0
],
i
);
/* Key doesn't exist */
i
=
pSHSearchMapInt
(
keys
,
values
,
1
,
100
);
ok
(
i
==
-
1
,
"Len 1 - bad key, expected -1, got %d
\n
"
,
i
);
/* Len = 0 => not found */
i
=
pSHSearchMapInt
(
keys
,
values
,
0
,
keys
[
0
]);
ok
(
i
==
-
1
,
"Len 1 - passed len 0, expected -1, got %d
\n
"
,
i
);
/* 2 elements, len = 1 */
keys
[
1
]
=
98
;
values
[
1
]
=
102
;
i
=
pSHSearchMapInt
(
keys
,
values
,
1
,
keys
[
1
]);
ok
(
i
==
-
1
,
"Len 1 - array len 2, expected -1, got %d
\n
"
,
i
);
/* 2 elements, len = 2 */
i
=
pSHSearchMapInt
(
keys
,
values
,
2
,
keys
[
1
]);
ok
(
i
==
values
[
1
],
"Len 2, expected %d, got %d
\n
"
,
values
[
1
],
i
);
/* Searches forward */
keys
[
2
]
=
99
;
values
[
2
]
=
103
;
i
=
pSHSearchMapInt
(
keys
,
values
,
3
,
keys
[
0
]);
ok
(
i
==
values
[
0
],
"Len 3, expected %d, got %d
\n
"
,
values
[
0
],
i
);
}
START_TEST
(
ordinal
)
{
hShlwapi
=
LoadLibraryA
(
"shlwapi.dll"
);
ok
(
hShlwapi
!=
0
,
"LoadLibraryA failed
\n
"
);
if
(
!
hShlwapi
)
return
;
pSHSearchMapInt
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
198
);
test_SHSearchMapInt
();
FreeLibrary
(
hShlwapi
);
}
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