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
5528d728
Commit
5528d728
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 Log.
parent
b193c844
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
global.c
dlls/vbscript/global.c
+11
-2
api.vbs
dlls/vbscript/tests/api.vbs
+30
-0
No files found.
dlls/vbscript/global.c
View file @
5528d728
...
...
@@ -723,8 +723,17 @@ static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static
HRESULT
Global_Log
(
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
,
log
(
d
));
}
static
HRESULT
Global_Sqr
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
5528d728
...
...
@@ -1207,4 +1207,34 @@ Call ok(getVT(Exp(True)) = "VT_R8", "getVT(Exp(True)) = " & getVT(Exp(True)))
Call
ok
(
Approch
(
Exp
(
CByte
(
2
)),
7.389
),
"Exp(CByte(2)) = "
&
Exp
(
CByte
(
2
)))
Call
ok
(
getVT
(
Exp
(
CByte
(
2
)))
=
"VT_R8"
,
"getVT(Exp(CByte(2))) = "
&
getVT
(
Exp
(
CByte
(
2
))))
Sub
testLogError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
Log
(
strings
)
Call
ok
(
Err
.
number
=
error_num1
,
"Err.number1 = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
Log
(
strings
)
Call
ok
(
Err
.
number
=
error_num2
,
"Err.number2 = "
&
Err
.
number
)
End
Sub
Call
testLogError
(
0
,
5
,
5
)
Call
testLogError
(
-
2
,
5
,
5
)
Call
testLogError
(
False
,
5
,
5
)
Call
testLogError
(
True
,
5
,
5
)
Call
ok
(
Approch
(
Log
(
1
),
0
),
"Log(1) = "
&
Log
(
1
))
Call
ok
(
getVT
(
Log
(
1
))
=
"VT_R8"
,
"getVT(Log(1)) = "
&
getVT
(
Log
(
1
)))
Call
ok
(
Approch
(
Log
(
CCur
(
0.5
)),
-
0.6931
),
"Log(CCur(0.5)) = "
&
Log
(
CCur
(
0.5
)))
Call
ok
(
getVT
(
Log
(
CCur
(
0.5
)))
=
"VT_R8"
,
"getVT(Log(CCur(0.5))) = "
&
getVT
(
Log
(
CCur
(
0.5
))))
Call
ok
(
Approch
(
Log
(
CSng
(
2.7182
)),
1
),
"Log(CSng(2.7182)) = "
&
Log
(
CSng
(
2.7182
)))
Call
ok
(
getVT
(
Log
(
CSng
(
2.7182
)))
=
"VT_R8"
,
"getVT(Log(CSng(PI))) = "
&
getVT
(
Log
(
CSng
(
PI
))))
Call
ok
(
Approch
(
Log
(
32768
),
10.3972
),
"Log(32768) = "
&
Log
(
32768
))
Call
ok
(
getVT
(
Log
(
32768
))
=
"VT_R8"
,
"getVT(Log(32768)) = "
&
getVT
(
Log
(
32768
)))
Call
ok
(
Approch
(
Log
(
"10"
),
2.3025
),
"Log(
""
10
""
) = "
&
Log
(
"10"
))
Call
ok
(
getVT
(
Log
(
"10"
))
=
"VT_R8"
,
"getVT(Log(
""
10
""
)) = "
&
getVT
(
Log
(
"10"
)))
Call
ok
(
Approch
(
Log
(
CByte
(
2
)),
0.6931
),
"Log(CByte(2)) = "
&
Log
(
CByte
(
2
)))
Call
ok
(
getVT
(
Log
(
CByte
(
2
)))
=
"VT_R8"
,
"getVT(Log(CByte(2))) = "
&
getVT
(
Log
(
CByte
(
2
))))
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