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
159dfb21
Commit
159dfb21
authored
Jan 04, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Fix the printf pointer formatting tests on 64-bit.
parent
fcd2ff97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
21 deletions
+54
-21
printf.c
dlls/msvcrt/tests/printf.c
+54
-21
No files found.
dlls/msvcrt/tests/printf.c
View file @
159dfb21
...
...
@@ -277,20 +277,50 @@ static void test_sprintf( void )
ok
(
!
strcmp
(
buffer
,
"1 "
),
"Character zero-padded and/or not left-adjusted
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
4
,
"return count wrong
\n
"
);
format
=
"%p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"00000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
format
=
"%#012p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
" 0X00000039"
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
12
,
"return count wrong
\n
"
);
format
=
"%Fp"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"00000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
if
(
sizeof
(
void
*
)
==
8
)
{
format
=
"%p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0000000000000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
16
,
"return count wrong
\n
"
);
format
=
"%#020p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
" 0X0000000000000039"
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
20
,
"return count wrong
\n
"
);
format
=
"%Fp"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0000000000000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
16
,
"return count wrong
\n
"
);
format
=
"%#-020p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0X0000000000000039 "
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
20
,
"return count wrong
\n
"
);
}
else
{
format
=
"%p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"00000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
format
=
"%#012p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
" 0X00000039"
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
12
,
"return count wrong
\n
"
);
format
=
"%Fp"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"00000039"
),
"Pointer formatted incorrectly
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
format
=
"%#-012p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0X00000039 "
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
12
,
"return count wrong
\n
"
);
}
format
=
"%04s"
;
r
=
sprintf
(
buffer
,
format
,
"foo"
);
...
...
@@ -312,11 +342,6 @@ static void test_sprintf( void )
ok
(
!
strcmp
(
buffer
,
"foo "
),
"Negative field width ignored
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
5
,
"return count wrong
\n
"
);
format
=
"%#-012p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0X00000039 "
),
"Pointer formatted incorrectly
\n
"
);
ok
(
r
==
12
,
"return count wrong
\n
"
);
format
=
"hello"
;
r
=
sprintf
(
buffer
,
format
);
ok
(
!
strcmp
(
buffer
,
"hello"
),
"failed
\n
"
);
...
...
@@ -455,8 +480,16 @@ static void test_sprintf( void )
format
=
"%p"
;
r
=
sprintf
(
buffer
,
format
,
0
);
ok
(
!
strcmp
(
buffer
,
"00000000"
),
"failed
\n
"
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
if
(
sizeof
(
void
*
)
==
8
)
{
ok
(
!
strcmp
(
buffer
,
"0000000000000000"
),
"failed
\n
"
);
ok
(
r
==
16
,
"return count wrong
\n
"
);
}
else
{
ok
(
!
strcmp
(
buffer
,
"00000000"
),
"failed
\n
"
);
ok
(
r
==
8
,
"return count wrong
\n
"
);
}
format
=
"%s"
;
r
=
sprintf
(
buffer
,
format
,
0
);
...
...
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