Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a74e2871
Commit
a74e2871
authored
Jul 27, 2021
by
Francois Gouget
Committed by
Alexandre Julliard
Jul 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Add more VarParseNumFromStr() hexadecimal/octal tests.
Signed-off-by:
Francois Gouget
<
fgouget@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fd0a55ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
1 deletion
+48
-1
vartest.c
dlls/oleaut32/tests/vartest.c
+48
-1
No files found.
dlls/oleaut32/tests/vartest.c
View file @
a74e2871
...
...
@@ -1495,7 +1495,7 @@ static void test_VarParseNumFromStrEn(void)
EXPECTFAIL
;
EXPECTRGB
(
0
,
FAILDIG
);
/*
Octal
*/
/*
A leading 0 does not an octal number make
*/
CONVERT
(
"0100"
,
NUMPRS_HEX_OCT
);
EXPECT
(
1
,
NUMPRS_HEX_OCT
,
0
,
4
,
0
,
2
);
EXPECTRGB
(
0
,
1
);
...
...
@@ -1546,6 +1546,20 @@ static void test_VarParseNumFromStrEn(void)
EXPECTRGB
(
1
,
2
);
EXPECTRGB
(
3
,
FAILDIG
);
/* Only integers are allowed when using an alternative radix */
CONVERT
(
"&ha.2"
,
NUMPRS_HEX_OCT
|
NUMPRS_DECIMAL
);
if
(
broken
(
1
))
/* FIXME Reenable once Wine is less broken */
EXPECT
(
1
,
NUMPRS_HEX_OCT
|
NUMPRS_DECIMAL
,
NUMPRS_HEX_OCT
,
3
,
4
,
0
);
todo_wine
ok
(
np
.
dwOutFlags
==
NUMPRS_HEX_OCT
,
"Got dwOutFlags=%08x
\n
"
,
np
.
dwOutFlags
);
EXPECTRGB
(
0
,
10
);
todo_wine
EXPECTRGB
(
1
,
FAILDIG
);
/* Except if it looks like a plain decimal number */
CONVERT
(
"01.2"
,
NUMPRS_HEX_OCT
|
NUMPRS_DECIMAL
);
EXPECT
(
2
,
NUMPRS_HEX_OCT
|
NUMPRS_DECIMAL
,
NUMPRS_DECIMAL
,
4
,
0
,
-
1
);
EXPECT2
(
1
,
2
);
EXPECTRGB
(
3
,
FAILDIG
);
/** NUMPRS_PARENS **/
/* Empty parens = error */
...
...
@@ -1584,6 +1598,14 @@ static void test_VarParseNumFromStrEn(void)
*/
EXPECTRGB
(
4
,
FAILDIG
);
/* With flag, thousands sep. and following digits consumed */
CONVERT
(
"&h1,000"
,
NUMPRS_HEX_OCT
|
NUMPRS_THOUSANDS
);
if
(
broken
(
1
))
/* FIXME Reenable once Wine is less broken */
EXPECT
(
1
,
NUMPRS_HEX_OCT
|
NUMPRS_THOUSANDS
,
NUMPRS_HEX_OCT
,
3
,
4
,
0
);
todo_wine
ok
(
np
.
dwOutFlags
==
NUMPRS_HEX_OCT
,
"Got dwOutFlags=%08x
\n
"
,
np
.
dwOutFlags
);
EXPECTRGB
(
0
,
1
);
todo_wine
EXPECTRGB
(
1
,
FAILDIG
);
/* With flag and decimal point, thousands sep. but not decimals consumed */
CONVERT
(
"1,001.0"
,
NUMPRS_THOUSANDS
);
EXPECT
(
4
,
NUMPRS_THOUSANDS
,
NUMPRS_THOUSANDS
,
5
,
0
,
0
);
...
...
@@ -1636,6 +1658,17 @@ static void test_VarParseNumFromStrEn(void)
EXPECT2
(
1
,
1
);
EXPECTRGB
(
2
,
FAILDIG
);
/* With flag, currency amounts cannot be in hexadecimal */
CONVERT
(
"$&ha"
,
NUMPRS_HEX_OCT
|
NUMPRS_CURRENCY
);
todo_wine
EXPECTFAIL
;
CONVERT
(
"&ha$"
,
NUMPRS_HEX_OCT
|
NUMPRS_CURRENCY
);
if
(
broken
(
1
))
/* FIXME Reenable once Wine is less broken */
EXPECT
(
1
,
NUMPRS_HEX_OCT
|
NUMPRS_CURRENCY
,
NUMPRS_HEX_OCT
,
3
,
4
,
0
);
todo_wine
ok
(
np
.
dwOutFlags
==
NUMPRS_HEX_OCT
,
"Got dwOutFlags=%08x
\n
"
,
np
.
dwOutFlags
);
EXPECTRGB
(
0
,
10
);
EXPECTRGB
(
1
,
FAILDIG
);
/* With flag, the sign cannot be repeated before the amount */
CONVERT
(
"$$11"
,
NUMPRS_CURRENCY
);
EXPECTFAIL
;
...
...
@@ -1768,6 +1801,20 @@ static void test_VarParseNumFromStrEn(void)
EXPECT
(
1
,
NUMPRS_EXPONENT
,
NUMPRS_EXPONENT
,
3
,
0
,
1
);
EXPECT2
(
1
,
FAILDIG
);
/* With flag, incompatible with NUMPRS_HEX_OCT */
CONVERT
(
"&o1e1"
,
NUMPRS_HEX_OCT
|
NUMPRS_EXPONENT
);
if
(
broken
(
1
))
/* FIXME Reenable once Wine is less broken */
EXPECT
(
1
,
NUMPRS_HEX_OCT
|
NUMPRS_EXPONENT
,
NUMPRS_HEX_OCT
,
3
,
3
,
0
);
todo_wine
ok
(
np
.
dwOutFlags
==
NUMPRS_HEX_OCT
,
"Got dwOutFlags=%08x
\n
"
,
np
.
dwOutFlags
);
EXPECT2
(
1
,
FAILDIG
);
/* With flag, even if it sort of looks like an exponent */
CONVERT
(
"&h1e2"
,
NUMPRS_HEX_OCT
|
NUMPRS_EXPONENT
);
EXPECT
(
3
,
NUMPRS_HEX_OCT
|
NUMPRS_EXPONENT
,
NUMPRS_HEX_OCT
,
5
,
4
,
0
);
EXPECT2
(
1
,
0xe
);
EXPECTRGB
(
2
,
2
);
EXPECTRGB
(
3
,
FAILDIG
);
/* Negative exponents are accepted without flags */
CONVERT
(
"1e-1"
,
NUMPRS_EXPONENT
);
EXPECT
(
1
,
NUMPRS_EXPONENT
,
NUMPRS_EXPONENT
,
4
,
0
,
-
1
);
...
...
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