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
cde73e3a
Commit
cde73e3a
authored
Jun 02, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
Jun 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented CDbl.
parent
48e41c4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
global.c
dlls/vbscript/global.c
+18
-2
api.vbs
dlls/vbscript/tests/api.vbs
+48
-0
No files found.
dlls/vbscript/global.c
View file @
cde73e3a
...
...
@@ -470,8 +470,24 @@ static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
static
HRESULT
Global_CDbl
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
VARIANT
v
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
assert
(
args_cnt
==
1
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
VariantChangeType
(
&
v
,
arg
,
0
,
VT_R8
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
res
)
return
DISP_E_BADVARTYPE
;
else
{
*
res
=
v
;
return
S_OK
;
}
}
static
HRESULT
Global_CSng
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
cde73e3a
...
...
@@ -634,4 +634,52 @@ MyObject.myval = 0
Call
ok
(
CCur
(
MyObject
)
=
0
,
"CCur(MyObject) = "
&
CCur
(
MyObject
))
Call
ok
(
getVT
(
CCur
(
MyObject
))
=
"VT_CY"
,
"getVT(CCur(MyObject)) = "
&
getVT
(
CCur
(
MyObject
)))
Sub
testCDblError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
CDbl
(
strings
)
Call
ok
(
Err
.
number
=
error_num1
,
"Err.number = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
CDbl
(
strings
)
Call
ok
(
Err
.
number
=
error_num2
,
"Err.number = "
&
Err
.
number
)
End
Sub
Call
ok
(
CDbl
(
Empty
)
=
0
,
"CDbl(Empty) = "
&
CDbl
(
Empty
))
Call
ok
(
getVT
(
CDbl
(
Empty
))
=
"VT_R8"
,
"getVT(CDbl(Empty)) = "
&
getVT
(
CDbl
(
Empty
)))
Call
ok
(
CDbl
(
CByte
(
0
))
=
0
,
"CDbl(CByte(0)) = "
&
CDbl
(
CByte
(
0
)))
Call
ok
(
getVT
(
CDbl
(
CCur
(
0
)))
=
"VT_R8"
,
"getVT(CDbl(CCur(0))) = "
&
getVT
(
CDbl
(
CCur
(
0
))))
Call
ok
(
CDbl
(
CCur
(
0
))
=
0
,
"CDbl(CCur(0)) = "
&
CDbl
(
CCur
(
0
)))
Call
ok
(
getVT
(
CDbl
(
CCur
(
0
)))
=
"VT_R8"
,
"getVT(CDbl(CCur(0))) = "
&
getVT
(
CDbl
(
CCur
(
0
))))
Call
ok
(
CDbl
(
0
)
=
0
,
"CDbl(0) = "
&
CDbl
(
0
))
Call
ok
(
getVT
(
CDbl
(
0
))
=
"VT_R8"
,
"getVT(CDbl(0)) = "
&
getVT
(
CDbl
(
0
)))
Call
ok
(
CDbl
(
32768
)
=
32768
,
"CDbl(32768) = "
&
CDbl
(
32768
))
Call
ok
(
getVT
(
CDbl
(
32768
))
=
"VT_R8"
,
"getVT(CDbl(32768)) = "
&
getVT
(
CDbl
(
32768
)))
Call
ok
(
CDbl
(
0.001
*
0.001
)
=
0.000001
,
"CDbl(0.001 * 0.001) = "
&
CDbl
(
0.001
*
0.001
))
Call
ok
(
getVT
(
CDbl
(
0.001
*
0.001
))
=
"VT_R8"
,
"getVT(CDbl(0.001 * 0.001)) = "
&
getVT
(
CDbl
(
0.001
*
0.001
)))
Call
ok
(
CDbl
(
"-1"
)
=
-
1
,
"CDbl(
""
-1
""
) = "
&
CDbl
(
"-1"
))
Call
ok
(
getVT
(
CDbl
(
"-1"
))
=
"VT_R8"
,
"getVT(CDbl(
""
-1
""
)) = "
&
getVT
(
CDbl
(
"-1"
)))
If
isEnglishLang
Then
Call
ok
(
CDbl
(
"-0.5"
)
=
-
0.5
,
"CDbl(
""
-0.5
""
) = "
&
CDbl
(
"-0.5"
))
Call
ok
(
getVT
(
CDbl
(
"-0.5"
))
=
"VT_R8"
,
"getVT(CDbl(
""
-0.5
""
)) = "
&
getVT
(
CDbl
(
"-0.5"
)))
End
If
Call
testCDblError
(
""
,
13
,
13
)
Call
testCDblError
(
"TRUE"
,
13
,
13
)
Call
testCDblError
(
"FALSE"
,
13
,
13
)
Call
testCDblError
(
"#TRue#"
,
13
,
13
)
Call
testCDblError
(
"#fAlSE#"
,
13
,
13
)
Call
testCDblError
(
1
,
0
,
458
)
Call
ok
(
CDbl
(
True
)
=
-
1
,
"CDbl(True) = "
&
CDbl
(
True
))
Call
ok
(
getVT
(
CDbl
(
True
))
=
"VT_R8"
,
"getVT(CDbl(True)) = "
&
getVT
(
CDbl
(
True
)))
Call
ok
(
CDbl
(
False
)
=
0
,
"CDbl(False) = "
&
CDbl
(
False
))
Call
ok
(
getVT
(
CDbl
(
False
))
=
"VT_R8"
,
"getVT(CDbl(False)) = "
&
getVT
(
CDbl
(
False
)))
MyObject
.
myval
=
0.1
Call
ok
(
CDbl
(
MyObject
)
=
0.1
,
"CDbl(MyObject) = "
&
CDbl
(
MyObject
))
Call
ok
(
getVT
(
CDbl
(
MyObject
))
=
"VT_R8"
,
"getVT(CDbl(MyObject)) = "
&
getVT
(
CDbl
(
MyObject
)))
MyObject
.
myval
=
0
Call
ok
(
CDbl
(
MyObject
)
=
0
,
"CDbl(MyObject) = "
&
CDbl
(
MyObject
))
Call
ok
(
getVT
(
CDbl
(
MyObject
))
=
"VT_R8"
,
"getVT(CDbl(MyObject)) = "
&
getVT
(
CDbl
(
MyObject
)))
Call
reportSuccess
()
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