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
78754341
Commit
78754341
authored
Oct 10, 2003
by
Uwe Bonnes
Committed by
Alexandre Julliard
Oct 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for %n.
parent
242beda8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
scanf.c
dlls/msvcrt/tests/scanf.c
+12
-3
No files found.
dlls/msvcrt/tests/scanf.c
View file @
78754341
...
...
@@ -29,8 +29,10 @@ static void test_sscanf( void )
int
result
,
ret
;
float
res1
=
-
82
.
6267
f
,
res2
=
27
.
76
f
,
res11
,
res12
;
char
pname
[]
=
" St. Petersburg, Florida
\n
"
;
int
hour
=
21
,
min
=
59
,
sec
=
20
;
int
number
,
number_so_far
;
/* check EOF */
strcpy
(
buffer
,
""
);
ret
=
sscanf
(
buffer
,
"%d"
,
&
result
);
...
...
@@ -61,9 +63,16 @@ static void test_sscanf( void )
ok
(
(
res11
==
res1
)
&&
(
res12
==
res2
),
"Error reading floats"
);
ret
=
sprintf
(
buffer
,
" %s"
,
pname
);
ret
=
sscanf
(
buffer
,
"%*c%[^
\n
]"
,
buffer1
);
ok
(
ret
=
1
,
"Error with format
\"
%s
\"
"
,
"%*c%[^
\n
]"
);
ok
(
ret
=
=
1
,
"Error with format
\"
%s
\"
"
,
"%*c%[^
\n
]"
);
ok
(
strncmp
(
pname
,
buffer1
,
strlen
(
buffer1
))
==
0
,
"Error with
\"
%s
\"
\"
%s
\"
"
,
pname
,
buffer1
);
ret
=
sprintf
(
buffer
,
"%d:%d:%d"
,
hour
,
min
,
sec
);
ret
=
sscanf
(
buffer
,
"%d%n"
,
&
number
,
&
number_so_far
);
ok
(
ret
==
1
,
"problem with format arg
\"
%%d%%n
\"
"
);
ok
(
number
==
hour
,
"Read wrong arg %d instead of %d"
,
number
,
hour
);
ok
(
number_so_far
==
2
,
"Read wrong arg for
\"
%%n
\"
%d instead of 2"
,
number_so_far
);
ret
=
sscanf
(
buffer
+
2
,
"%*c%n"
,
&
number_so_far
);
ok
(
ret
==
0
,
"problem with format arg
\"
%%*c%%n
\"
"
);
ok
(
number_so_far
==
1
,
"Read wrong arg for
\"
%%n
\"
%d instead of 2"
,
number_so_far
);
}
...
...
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