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
14f68a98
Commit
14f68a98
authored
May 20, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
May 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented CCur.
parent
f82cb700
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
2 deletions
+68
-2
global.c
dlls/vbscript/global.c
+19
-2
api.vbs
dlls/vbscript/tests/api.vbs
+47
-0
run.c
dlls/vbscript/tests/run.c
+2
-0
No files found.
dlls/vbscript/global.c
View file @
14f68a98
...
...
@@ -375,8 +375,25 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, VARIANT *res)
static
HRESULT
Global_CCur
(
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_CY
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
res
)
{
VariantClear
(
&
v
);
return
DISP_E_BADVARTYPE
;
}
*
res
=
v
;
return
S_OK
;
}
static
HRESULT
Global_CInt
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
14f68a98
...
...
@@ -587,4 +587,51 @@ MyObject.myval = 0
Call
ok
(
CByte
(
MyObject
)
=
0
,
"CByte(MyObject) = "
&
CByte
(
MyObject
))
Call
ok
(
getVT
(
CByte
(
MyObject
))
=
"VT_UI1"
,
"getVT(CByte(MyObject)) = "
&
getVT
(
CByte
(
MyObject
)))
Sub
testCCurError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
CCur
(
strings
)
Call
ok
(
Err
.
number
=
error_num1
,
"Err.number = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
CCur
(
strings
)
Call
ok
(
Err
.
number
=
error_num2
,
"Err.number = "
&
Err
.
number
)
End
Sub
Call
ok
(
CCur
(
Empty
)
=
0
,
"CCur(Empty) = "
&
CCur
(
Empty
))
Call
ok
(
getVT
(
CCur
(
Empty
))
=
"VT_CY"
,
"getVT(CCur(Empty)) = "
&
getVT
(
CCur
(
Empty
)))
Call
ok
(
CCur
(
-
32768
)
=
-
32768
,
"CCur(-32768) = "
&
CCur
(
-
32768
))
Call
ok
(
getVT
(
CCur
(
-
32768
))
=
"VT_CY"
,
"getVT(CCur(-32768)) = "
&
getVT
(
CCur
(
-
32768
)))
Call
ok
(
CCur
(
32768
)
=
32768
,
"CCur(32768) = "
&
CCur
(
32768
))
Call
ok
(
getVT
(
CCur
(
32768
))
=
"VT_CY"
,
"getVT(CCur(32768)) = "
&
getVT
(
CCur
(
32768
)))
Call
ok
(
CCur
(
0.000149
)
=
0.0001
,
"CCur(0.000149) = "
&
CCur
(
0.000149
))
Call
ok
(
getVT
(
CCur
(
0.000149
))
=
"VT_CY"
,
"getVT(CCur(0.000149)) = "
&
getVT
(
CCur
(
0.000149
)))
Call
ok
(
CCur
(
2147483647.99
)
=
2147483647.99
,
"CCur(2147483647.99) = "
&
CCur
(
2147483647.99
))
Call
ok
(
getVT
(
CCur
(
2147483647.99
))
=
"VT_CY"
,
"getVT(CCur(2147483647.99)) = "
&
getVT
(
CCur
(
2147483647.99
)))
Call
ok
(
CCur
(
"-1"
)
=
-
1
,
"CCur(
""
-1
""
) = "
&
CCur
(
"-1"
))
Call
ok
(
getVT
(
CCur
(
"-1"
))
=
"VT_CY"
,
"getVT(CCur(
""
-1
""
)) = "
&
getVT
(
CCur
(
"-1"
)))
If
isEnglishLang
Then
Call
ok
(
CCur
(
"-0.5"
)
=
-
0.5
,
"CCur(
""
-0.5
""
) = "
&
CCur
(
"-0.5"
))
Call
ok
(
getVT
(
CCur
(
"-0.5"
))
=
"VT_CY"
,
"getVT(CCur(
""
-0.5
""
)) = "
&
getVT
(
CCur
(
"-0.5"
)))
End
If
Call
testCCurError
(
""
,
13
,
13
)
Call
testCCurError
(
"-1"
,
0
,
458
)
Call
testCCurError
(
"TRUE"
,
13
,
13
)
Call
testCCurError
(
"FALSE"
,
13
,
13
)
Call
testCCurError
(
"#TRue#"
,
13
,
13
)
Call
testCCurError
(
"#fAlSE#"
,
13
,
13
)
Call
testCCurError
(
1
,
0
,
458
)
Call
ok
(
CCur
(
True
)
=
-
1
,
"CCur(True) = "
&
CCur
(
True
))
Call
ok
(
getVT
(
CCur
(
True
))
=
"VT_CY"
,
"getVT(CCur(True)) = "
&
getVT
(
CCur
(
True
)))
Call
ok
(
CCur
(
False
)
=
0
,
"CCur(False) = "
&
CCur
(
False
))
Call
ok
(
getVT
(
CCur
(
False
))
=
"VT_CY"
,
"getVT(CCur(False)) = "
&
getVT
(
CCur
(
False
)))
MyObject
.
myval
=
0.1
Call
ok
(
CCur
(
MyObject
)
=
0.1
,
"CCur(MyObject) = "
&
CCur
(
MyObject
))
Call
ok
(
getVT
(
CCur
(
MyObject
))
=
"VT_CY"
,
"getVT(CCur(MyObject)) = "
&
getVT
(
CCur
(
MyObject
)))
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
)))
Call
reportSuccess
()
dlls/vbscript/tests/run.c
View file @
14f68a98
...
...
@@ -169,6 +169,8 @@ static const char *vt2a(VARIANT *v)
return
"VT_I4"
;
case
VT_R8
:
return
"VT_R8"
;
case
VT_CY
:
return
"VT_CY"
;
case
VT_DATE
:
return
"VT_DATE"
;
case
VT_BSTR
:
...
...
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