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
a3fe7269
Commit
a3fe7269
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 Fix.
parent
336ba30d
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 @
a3fe7269
...
...
@@ -1277,8 +1277,23 @@ static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static
HRESULT
Global_Fix
(
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
=
VarFix
(
arg
,
&
dst
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
res
)
*
res
=
dst
;
else
VariantClear
(
&
dst
);
return
S_OK
;
}
static
HRESULT
Global_Int
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
a3fe7269
...
...
@@ -993,4 +993,29 @@ Call ok(getVT(ScriptEngineMajorVersion) = "VT_I4", "getVT(ScriptEngineMajorVersi
Call
ok
(
getVT
(
ScriptEngineMinorVersion
)
=
"VT_I4"
,
"getVT(ScriptEngineMinorVersion) = "
&
getVT
(
ScriptEngineMinorVersion
))
Call
ok
(
Fix
(
Empty
)
=
0
,
"Fix(Empty) = "
&
Fix
(
Empty
))
Call
ok
(
getVT
(
Fix
(
Empty
))
=
"VT_I2"
,
"getVT(Fix(Empty)) = "
&
getVT
(
Fix
(
Empty
)))
Call
ok
(
Fix
(
CCur
(
-
0.99
))
=
0
,
"Fix(CCur(-0.99)) = "
&
Fix
(
CCur
(
-
0.99
)))
Call
ok
(
getVT
(
Fix
(
CCur
(
-
0.99
)))
=
"VT_CY"
,
"getVT(Fix(CCur(-0.99))) = "
&
getVT
(
Fix
(
CCur
(
-
0.99
))))
Call
ok
(
Fix
(
1.99
)
=
1
,
"Fix(1.99) = "
&
Fix
(
1.99
))
Call
ok
(
getVT
(
Fix
(
1.99
))
=
"VT_R8"
,
"getVT(Fix(1.99)) = "
&
getVT
(
Fix
(
1.99
)))
Call
ok
(
Fix
(
-
1.99
)
=
-
1
,
"Fix(-1.99) = "
&
Fix
(
-
1.99
))
Call
ok
(
getVT
(
Fix
(
-
1.99
))
=
"VT_R8"
,
"getVT(Fix(-1.99)) = "
&
getVT
(
Fix
(
-
1.99
)))
If
isEnglishLang
Then
Call
ok
(
Fix
(
"1.99"
)
=
1
,
"Fix(
""
1.99
""
) = "
&
Fix
(
"1.99"
))
Call
ok
(
getVT
(
Fix
(
"1.99"
))
=
"VT_R8"
,
"getVT(Fix(
""
1.99
""
)) = "
&
getVT
(
Fix
(
"1.99"
)))
Call
ok
(
Fix
(
"-1.99"
)
=
-
1
,
"Fix(
""
-1.99
""
) = "
&
Fix
(
"-1.99"
))
Call
ok
(
getVT
(
Fix
(
"-1.99"
))
=
"VT_R8"
,
"getVT(Fix(
""
-1.99
""
)) = "
&
getVT
(
Fix
(
"-1.99"
)))
End
If
Call
ok
(
Fix
(
True
)
=
-
1
,
"Fix(True) = "
&
Fix
(
True
))
Call
ok
(
getVT
(
Fix
(
True
))
=
"VT_I2"
,
"getVT(Fix(True)) = "
&
getVT
(
Fix
(
True
)))
Call
ok
(
Fix
(
False
)
=
0
,
"Fix(False) = "
&
Fix
(
False
))
Call
ok
(
getVT
(
Fix
(
False
))
=
"VT_I2"
,
"getVT(Fix(False)) = "
&
getVT
(
Fix
(
False
)))
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
)))
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
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