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
f45db432
Commit
f45db432
authored
Aug 04, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucrtbase: Add initial __std_type_info tests.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4ba09e11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
cpp.c
dlls/ucrtbase/tests/cpp.c
+61
-0
No files found.
dlls/ucrtbase/tests/cpp.c
View file @
f45db432
...
...
@@ -33,8 +33,25 @@ typedef struct {
MSVCRT_bool
dofree
;
}
__std_exception_data
;
typedef
struct
{
char
*
name
;
char
mangled
[
32
];
}
type_info140
;
typedef
struct
_type_info_list
{
SLIST_ENTRY
entry
;
char
name
[
1
];
}
type_info_list
;
static
void
*
(
CDECL
*
p_malloc
)(
size_t
);
static
void
(
CDECL
*
p___std_exception_copy
)(
const
__std_exception_data
*
,
__std_exception_data
*
);
static
void
(
CDECL
*
p___std_exception_destroy
)(
__std_exception_data
*
);
static
int
(
CDECL
*
p___std_type_info_compare
)(
const
type_info140
*
,
const
type_info140
*
);
static
const
char
*
(
CDECL
*
p___std_type_info_name
)(
type_info140
*
,
SLIST_HEADER
*
);
static
void
(
CDECL
*
p___std_type_info_destroy_list
)(
SLIST_HEADER
*
);
static
BOOL
init
(
void
)
{
...
...
@@ -47,8 +64,12 @@ static BOOL init(void)
return
FALSE
;
}
p_malloc
=
(
void
*
)
GetProcAddress
(
module
,
"malloc"
);
p___std_exception_copy
=
(
void
*
)
GetProcAddress
(
module
,
"__std_exception_copy"
);
p___std_exception_destroy
=
(
void
*
)
GetProcAddress
(
module
,
"__std_exception_destroy"
);
p___std_type_info_compare
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_compare"
);
p___std_type_info_name
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_name"
);
p___std_type_info_destroy_list
=
(
void
*
)
GetProcAddress
(
module
,
"__std_type_info_destroy_list"
);
return
TRUE
;
}
...
...
@@ -96,8 +117,48 @@ static void test___std_exception(void)
ok
(
!
dst
.
dofree
,
"dst.dofree != FALSE
\n
"
);
}
static
void
test___std_type_info
(
void
)
{
type_info140
ti1
=
{
NULL
,
".?AVa@@"
};
type_info140
ti2
=
{
NULL
,
".?AVb@@"
};
type_info140
ti3
=
ti1
;
SLIST_HEADER
header
;
type_info_list
*
elem
;
const
char
*
ret
;
int
eq
;
InitializeSListHead
(
&
header
);
p___std_type_info_destroy_list
(
&
header
);
elem
=
p_malloc
(
sizeof
(
*
elem
));
memset
(
elem
,
0
,
sizeof
(
*
elem
));
InterlockedPushEntrySList
(
&
header
,
&
elem
->
entry
);
p___std_type_info_destroy_list
(
&
header
);
ok
(
!
InterlockedPopEntrySList
(
&
header
),
"list is not empty
\n
"
);
ret
=
p___std_type_info_name
(
&
ti1
,
&
header
);
ok
(
!
strcmp
(
ret
,
"class a"
),
"__std_type_info_name(&ti1) = %s
\n
"
,
ret
);
ok
(
ti1
.
name
==
ret
,
"ti1.name = %p, ret = %p
\n
"
,
ti1
.
name
,
ret
);
p___std_type_info_destroy_list
(
&
header
);
ok
(
!
InterlockedPopEntrySList
(
&
header
),
"list is not empty
\n
"
);
ok
(
ti1
.
name
==
ret
,
"ti1.name = %p, ret = %p
\n
"
,
ti1
.
name
,
ret
);
ti1
.
name
=
NULL
;
eq
=
p___std_type_info_compare
(
&
ti1
,
&
ti1
);
ok
(
eq
==
0
,
"__std_type_info_compare(&ti1, &ti1) = %d
\n
"
,
eq
);
eq
=
p___std_type_info_compare
(
&
ti1
,
&
ti2
);
ok
(
eq
==
-
1
,
"__std_type_info_compare(&ti1, &ti2) = %d
\n
"
,
eq
);
eq
=
p___std_type_info_compare
(
&
ti1
,
&
ti3
);
ok
(
eq
==
0
,
"__std_type_info_compare(&ti1, &ti3) = %d
\n
"
,
eq
);
}
START_TEST
(
cpp
)
{
if
(
!
init
())
return
;
test___std_exception
();
test___std_type_info
();
}
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