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
622191f7
Commit
622191f7
authored
Aug 14, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
Aug 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented Int.
parent
a3fe7269
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
global.c
dlls/vbscript/global.c
+17
-2
api.vbs
dlls/vbscript/tests/api.vbs
+25
-0
No files found.
dlls/vbscript/global.c
View file @
622191f7
...
...
@@ -1298,8 +1298,23 @@ static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static
HRESULT
Global_Int
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
HRESULT
hres
;
VARIANT
dst
;
TRACE
(
"(%s)
\n
"
,
debugstr_variant
(
arg
));
assert
(
args_cnt
==
1
);
hres
=
VarInt
(
arg
,
&
dst
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
res
)
*
res
=
dst
;
else
VariantClear
(
&
dst
);
return
S_OK
;
}
static
HRESULT
Global_Sgn
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
622191f7
...
...
@@ -1018,4 +1018,29 @@ MyObject.myval = -2.5
Call
ok
(
Fix
(
MyObject
)
=
-
2
,
"Fix(MyObject) = "
&
Fix
(
MyObject
))
Call
ok
(
getVT
(
Fix
(
MyObject
))
=
"VT_R8"
,
"getVT(Fix(MyObject)) = "
&
getVT
(
Fix
(
MyObject
)))
Call
ok
(
Int
(
Empty
)
=
0
,
"Int(Empty) = "
&
Int
(
Empty
))
Call
ok
(
getVT
(
Int
(
Empty
))
=
"VT_I2"
,
"getVT(Int(Empty)) = "
&
getVT
(
Int
(
Empty
)))
Call
ok
(
Int
(
CCur
(
-
0.99
))
=
-
1
,
"Int(CCur(-0.99)) = "
&
Int
(
CCur
(
-
0.99
)))
Call
ok
(
getVT
(
Int
(
CCur
(
-
0.99
)))
=
"VT_CY"
,
"getVT(Int(CCur(-0.99))) = "
&
getVT
(
Int
(
CCur
(
-
0.99
))))
Call
ok
(
Int
(
1.99
)
=
1
,
"Int(1.99) = "
&
Int
(
1.99
))
Call
ok
(
getVT
(
Int
(
1.99
))
=
"VT_R8"
,
"getVT(Int(1.99)) = "
&
getVT
(
Int
(
1.99
)))
Call
ok
(
Int
(
-
1.99
)
=
-
2
,
"Int(-1.99) = "
&
Int
(
-
1.99
))
Call
ok
(
getVT
(
Int
(
-
1.99
))
=
"VT_R8"
,
"getVT(Int(-1.99)) = "
&
getVT
(
Int
(
-
1.99
)))
If
isEnglishLang
Then
Call
ok
(
Int
(
"1.99"
)
=
1
,
"Int(
""
1.99
""
) = "
&
Int
(
"1.99"
))
Call
ok
(
getVT
(
Int
(
"1.99"
))
=
"VT_R8"
,
"getVT(Int(
""
1.99
""
)) = "
&
getVT
(
Int
(
"1.99"
)))
Call
ok
(
Int
(
"-1.99"
)
=
-
2
,
"Int(
""
-1.99
""
) = "
&
Int
(
"-1.99"
))
Call
ok
(
getVT
(
Int
(
"-1.99"
))
=
"VT_R8"
,
"getVT(Int(
""
-1.99
""
)) = "
&
getVT
(
Int
(
"-1.99"
)))
End
If
Call
ok
(
Int
(
True
)
=
-
1
,
"Int(True) = "
&
Int
(
True
))
Call
ok
(
getVT
(
Int
(
True
))
=
"VT_I2"
,
"getVT(Int(True)) = "
&
getVT
(
Int
(
True
)))
Call
ok
(
Int
(
False
)
=
0
,
"Int(False) = "
&
Int
(
False
))
Call
ok
(
getVT
(
Int
(
False
))
=
"VT_I2"
,
"getVT(Int(False)) = "
&
getVT
(
Int
(
False
)))
MyObject
.
myval
=
2.5
Call
ok
(
Int
(
MyObject
)
=
2
,
"Int(MyObject) = "
&
Int
(
MyObject
))
Call
ok
(
getVT
(
Int
(
MyObject
))
=
"VT_R8"
,
"getVT(Int(MyObject)) = "
&
getVT
(
Int
(
MyObject
)))
MyObject
.
myval
=
-
2.5
Call
ok
(
Int
(
MyObject
)
=
-
3
,
"Int(MyObject) = "
&
Int
(
MyObject
))
Call
ok
(
getVT
(
Int
(
MyObject
))
=
"VT_R8"
,
"getVT(Int(MyObject)) = "
&
getVT
(
Int
(
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