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
287d419e
Commit
287d419e
authored
Apr 02, 2015
by
Shuai Meng
Committed by
Alexandre Julliard
Apr 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fixed Hex.
parent
7f977e5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
global.c
dlls/vbscript/global.c
+7
-8
api.vbs
dlls/vbscript/tests/api.vbs
+21
-0
No files found.
dlls/vbscript/global.c
View file @
287d419e
...
...
@@ -544,6 +544,8 @@ static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
{
WCHAR
buf
[
17
],
*
ptr
;
DWORD
n
;
HRESULT
hres
;
int
ret
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
...
...
@@ -551,19 +553,16 @@ static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
case
VT_I2
:
n
=
(
WORD
)
V_I2
(
arg
);
break
;
case
VT_I4
:
n
=
V_I4
(
arg
);
break
;
case
VT_EMPTY
:
n
=
0
;
break
;
case
VT_NULL
:
if
(
res
)
V_VT
(
res
)
=
VT_NULL
;
return
S_OK
;
default:
FIXME
(
"unsupported type %s
\n
"
,
debugstr_variant
(
arg
));
return
E_NOTIMPL
;
hres
=
to_int
(
arg
,
&
ret
);
if
(
FAILED
(
hres
))
return
hres
;
else
n
=
ret
;
}
buf
[
16
]
=
0
;
...
...
dlls/vbscript/tests/api.vbs
View file @
287d419e
...
...
@@ -233,10 +233,31 @@ TestHex -1, "FFFF"
TestHex
-
16
,
"FFF0"
TestHex
-
934859845
,
"C8472BBB"
TestHex
empty
,
"0"
TestHex
"17"
,
"11"
TestHex
228.5
,
"E4"
TestHex
-
32767
,
"8001"
TestHex
-
32768
,
"FFFF8000"
TestHex
2147483647.49
,
"7FFFFFFF"
TestHex
-
2147483647.5
,
"80000000"
newObject
.
myval
=
30.5
TestHex
newObject
,
"1E"
newObject
.
myval
=
"27"
TestHex
newObject
,
"1B"
Call
ok
(
getVT
(
hex
(
null
))
=
"VT_NULL"
,
"getVT(hex(null)) = "
&
getVT
(
hex
(
null
)))
Call
ok
(
getVT
(
hex
(
empty
))
=
"VT_BSTR"
,
"getVT(hex(empty)) = "
&
getVT
(
hex
(
empty
)))
Sub
TestHexError
(
num
,
err_num
)
On
Error
Resume
Next
Call
Hex
(
num
)
Call
ok
(
Err
.
number
=
err_num
,
"Hex("
&
num
&
") returns error number "
&
Err
.
number
&
" expected "
&
err_num
)
End
Sub
TestHexError
2147483647.5
,
6
TestHexError
2147483648.51
,
6
TestHexError
"test"
,
13
Sub
TestOct
(
x
,
ex
,
res_type
)
Call
ok
(
Oct
(
x
)
=
ex
,
"Oct("
&
x
&
") = "
&
Oct
(
x
)
&
" expected "
&
ex
)
Call
ok
(
getVT
(
Oct
(
x
))
=
res_type
,
"getVT(Oct("
&
x
&
")) = "
&
getVT
(
Oct
(
x
))
&
"expected "
&
res_type
)
...
...
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