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
85dfafa3
Commit
85dfafa3
authored
Aug 18, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
Aug 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented Sqr.
parent
9f06f24f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
global.c
dlls/vbscript/global.c
+11
-2
api.vbs
dlls/vbscript/tests/api.vbs
+35
-0
No files found.
dlls/vbscript/global.c
View file @
85dfafa3
...
...
@@ -699,8 +699,17 @@ static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static
HRESULT
Global_Sqr
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
HRESULT
hres
;
double
d
;
hres
=
to_double
(
arg
,
&
d
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
d
<
0
)
return
MAKE_VBSERROR
(
VBSE_ILLEGAL_FUNC_CALL
);
else
return
return_double
(
res
,
sqrt
(
d
));
}
static
HRESULT
Global_Randomize
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
85dfafa3
...
...
@@ -1043,4 +1043,39 @@ 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
)))
Sub
testSqrError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
Sqr
(
strings
)
Call
ok
(
Err
.
number
=
error_num1
,
"Err.number1 = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
Sqr
(
strings
)
Call
ok
(
Err
.
number
=
error_num2
,
"Err.number2 = "
&
Err
.
number
)
End
Sub
Call
testSqrError
(
-
2
,
5
,
5
)
Call
testSqrError
(
True
,
5
,
5
)
Call
ok
(
Sqr
(
Empty
)
=
0
,
"Sqr(Empty) = "
&
Sqr
(
Empty
))
Call
ok
(
getVT
(
Sqr
(
Empty
))
=
"VT_R8"
,
"getVT(Sqr(Empty)) = "
&
getVT
(
Sqr
(
Empty
)))
Call
ok
(
Sqr
(
0
)
=
0
,
"Sqr(0) = "
&
Sqr
(
0
))
Call
ok
(
getVT
(
Sqr
(
0
))
=
"VT_R8"
,
"getVT(Sqr(0)) = "
&
getVT
(
Sqr
(
0
)))
Call
ok
(
Sqr
(
1
)
=
1
,
"Sqr(1) = "
&
Sqr
(
1
))
Call
ok
(
getVT
(
Sqr
(
1
))
=
"VT_R8"
,
"getVT(Sqr(1)) = "
&
getVT
(
Sqr
(
1
)))
Call
ok
(
Sqr
(
CSng
(
121
))
=
11
,
"Sqr(CSng(121)) = "
&
Sqr
(
CSng
(
121
)))
Call
ok
(
getVT
(
Sqr
(
CSng
(
121
)))
=
"VT_R8"
,
"getVT(Sqr(CSng(121))) = "
&
getVT
(
Sqr
(
CSng
(
121
))))
Call
ok
(
Sqr
(
36100
)
=
190
,
"Sqr(36100) = "
&
Sqr
(
36100
))
Call
ok
(
getVT
(
Sqr
(
36100
))
=
"VT_R8"
,
"getVT(Sqr(36100)) = "
&
getVT
(
Sqr
(
36100
)))
Call
ok
(
Sqr
(
CCur
(
0.0625
))
=
0.25
,
"Sqr(CCur(0.0625)) = "
&
Sqr
(
CCur
(
0.0625
)))
Call
ok
(
getVT
(
Sqr
(
CCur
(
0.0625
)))
=
"VT_R8"
,
"getVT(Sqr(CCur(0.0625))) = "
&
getVT
(
Sqr
(
CCur
(
0.0625
))))
Call
ok
(
Sqr
(
"100000000"
)
=
10000
,
"Sqr(
""
100000000
""
) = "
&
Sqr
(
"100000000"
))
Call
ok
(
getVT
(
Sqr
(
"100000000"
))
=
"VT_R8"
,
"getVT(Sqr(
""
100000000
""
)) = "
&
getVT
(
Sqr
(
"100000000"
)))
Call
ok
(
Sqr
(
False
)
=
0
,
"Sqr(False) = "
&
Sqr
(
False
))
Call
ok
(
getVT
(
Sqr
(
False
))
=
"VT_R8"
,
"getVT(Sqr(False)) = "
&
getVT
(
Sqr
(
False
)))
Call
ok
(
Sqr
(
CByte
(
225
))
=
15
,
"Sqr(CByte(225)) = "
&
Sqr
(
CByte
(
225
)))
Call
ok
(
getVT
(
Sqr
(
CByte
(
225
)))
=
"VT_R8"
,
"getVT(Sqr(CByte(225))) = "
&
getVT
(
Sqr
(
CByte
(
225
))))
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