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
dd7230d1
Commit
dd7230d1
authored
Oct 24, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add a test for qsort() stability.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed24889d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
string.c
dlls/ntdll/tests/string.c
+30
-0
No files found.
dlls/ntdll/tests/string.c
View file @
dd7230d1
...
...
@@ -1189,6 +1189,16 @@ static int __cdecl strcomparefunc(const void *a, const void *b)
return
lstrcmpA
(
*
p
,
*
q
);
}
static
int
__cdecl
istrcomparefunc
(
const
void
*
a
,
const
void
*
b
)
{
const
char
*
const
*
p
=
a
;
const
char
*
const
*
q
=
b
;
ok
(
a
!=
b
,
"must never get the same pointer
\n
"
);
return
lstrcmpiA
(
*
p
,
*
q
);
}
static
void
test_qsort
(
void
)
{
int
arr
[
5
]
=
{
23
,
42
,
8
,
4
,
16
};
...
...
@@ -1202,6 +1212,15 @@ static void test_qsort(void)
"Sorted"
,
"."
};
const
char
*
strarr2
[
7
]
=
{
"Hello"
,
"Wine"
,
"World"
,
"!"
,
"wine"
,
"Sorted"
,
"WINE"
};
p_qsort
((
void
*
)
arr
,
0
,
sizeof
(
int
),
intcomparefunc
);
ok
(
arr
[
0
]
==
23
,
"badly sorted, nmemb=0, arr[0] is %d
\n
"
,
arr
[
0
]);
...
...
@@ -1246,6 +1265,17 @@ static void test_qsort(void)
ok
(
!
strcmp
(
strarr
[
4
],
"Sorted"
),
"badly sorted, strarr[4] is %s
\n
"
,
strarr
[
4
]);
ok
(
!
strcmp
(
strarr
[
5
],
"Wine"
),
"badly sorted, strarr[5] is %s
\n
"
,
strarr
[
5
]);
ok
(
!
strcmp
(
strarr
[
6
],
"World"
),
"badly sorted, strarr[6] is %s
\n
"
,
strarr
[
6
]);
p_qsort
((
void
*
)
strarr2
,
7
,
sizeof
(
char
*
),
istrcomparefunc
);
ok
(
!
strcmp
(
strarr2
[
0
],
"!"
),
"badly sorted, strar2r[0] is %s
\n
"
,
strarr2
[
0
]);
ok
(
!
strcmp
(
strarr2
[
1
],
"Hello"
),
"badly sorted, strarr2[1] is %s
\n
"
,
strarr2
[
1
]);
ok
(
!
strcmp
(
strarr2
[
2
],
"Sorted"
),
"badly sorted, strarr2[2] is %s
\n
"
,
strarr2
[
2
]);
todo_wine
{
ok
(
!
strcmp
(
strarr2
[
3
],
"wine"
),
"badly sorted, strarr2[3] is %s
\n
"
,
strarr2
[
3
]);
ok
(
!
strcmp
(
strarr2
[
4
],
"WINE"
),
"badly sorted, strarr2[4] is %s
\n
"
,
strarr2
[
4
]);
ok
(
!
strcmp
(
strarr2
[
5
],
"Wine"
),
"badly sorted, strarr2[5] is %s
\n
"
,
strarr2
[
5
]);
}
ok
(
!
strcmp
(
strarr2
[
6
],
"World"
),
"badly sorted, strarr2[6] is %s
\n
"
,
strarr2
[
6
]);
}
static
void
test_bsearch
(
void
)
...
...
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