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
db42703d
Commit
db42703d
authored
May 14, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
May 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented CByte.
parent
c0247ab2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
2 deletions
+65
-2
global.c
dlls/vbscript/global.c
+19
-2
api.vbs
dlls/vbscript/tests/api.vbs
+44
-0
run.c
dlls/vbscript/tests/run.c
+2
-0
No files found.
dlls/vbscript/global.c
View file @
db42703d
...
...
@@ -424,8 +424,25 @@ static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
static
HRESULT
Global_CByte
(
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
,
VARIANT_LOCALBOOL
,
VT_UI1
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
res
)
{
VariantClear
(
&
v
);
return
DISP_E_BADVARTYPE
;
}
*
res
=
v
;
return
S_OK
;
}
static
HRESULT
Global_CDate
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
db42703d
...
...
@@ -533,4 +533,48 @@ MyObject.myval = 0
Call
ok
(
CBool
(
MyObject
)
=
False
,
"CBool(MyObject) = "
&
CBool
(
MyObject
))
Call
ok
(
getVT
(
CBool
(
MyObject
))
=
"VT_BOOL"
,
"getVT(CBool(MyObject)) = "
&
getVT
(
CBool
(
MyObject
)))
Sub
testCByteError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
CByte
(
strings
)
Call
ok
(
Err
.
number
=
error_num1
,
"Err.number = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
CByte
(
strings
)
Call
ok
(
Err
.
number
=
error_num2
,
"Err.number = "
&
Err
.
number
)
End
Sub
Call
ok
(
CByte
(
Empty
)
=
0
,
"CByte(Empty) = "
&
CByte
(
Empty
))
Call
ok
(
getVT
(
CByte
(
Empty
))
=
"VT_UI1"
,
"getVT(CByte(Empty)) = "
&
getVT
(
CByte
(
Empty
)))
Call
ok
(
CByte
(
255
)
=
255
,
"CByte(255) = "
&
CByte
(
255
))
Call
ok
(
getVT
(
CByte
(
255
))
=
"VT_UI1"
,
"getVT(CByte(255)) = "
&
getVT
(
CByte
(
255
)))
Call
ok
(
CByte
(
255.49
)
=
255
,
"CByte(255.49) = "
&
CByte
(
255.49
))
Call
ok
(
getVT
(
CByte
(
255.49
))
=
"VT_UI1"
,
"getVT(CByte(255.49)) = "
&
getVT
(
CByte
(
255.49
)))
Call
testCByteError
(
1
,
0
,
458
)
Call
testCByteError
(
""
,
13
,
13
)
Call
testCByteError
(
"-1"
,
6
,
6
)
Call
testCByteError
(
"258"
,
6
,
6
)
Call
testCByteError
(
"TRUE"
,
13
,
13
)
Call
testCByteError
(
"FALSE"
,
13
,
13
)
Call
testCByteError
(
"#TRue#"
,
13
,
13
)
Call
testCByteError
(
"#fAlSE#"
,
13
,
13
)
If
isEnglishLang
Then
Call
ok
(
CByte
(
"-0.5"
)
=
0
,
"CByte(
""
-0.5
""
) = "
&
CByte
(
"-0.5"
))
Call
ok
(
getVT
(
CByte
(
"-0.5"
))
=
"VT_UI1"
,
"getVT(CByte(
""
-0.5
""
)) = "
&
getVT
(
CByte
(
"-0.5"
)))
End
If
Call
ok
(
CByte
(
True
)
=
255
,
"CByte(True) = "
&
CByte
(
True
))
Call
ok
(
getVT
(
CByte
(
True
))
=
"VT_UI1"
,
"getVT(CByte(True)) = "
&
getVT
(
CByte
(
True
)))
Call
ok
(
CByte
(
False
)
=
0
,
"CByte(False) = "
&
CByte
(
False
))
Call
ok
(
getVT
(
CByte
(
False
))
=
"VT_UI1"
,
"getVT(CByte(False)) = "
&
getVT
(
CByte
(
False
)))
Call
ok
(
CByte
(
MyObject
)
=
0
,
"CByte(MyObject) = "
&
CByte
(
MyObject
))
Call
ok
(
getVT
(
CByte
(
MyObject
))
=
"VT_UI1"
,
"getVT(CByte(MyObject)) = "
&
getVT
(
CByte
(
MyObject
)))
MyObject
.
myval
=
1
Call
ok
(
CByte
(
MyObject
)
=
1
,
"CByte(MyObject) = "
&
CByte
(
MyObject
))
Call
ok
(
getVT
(
CByte
(
MyObject
))
=
"VT_UI1"
,
"getVT(CByte(MyObject)) = "
&
getVT
(
CByte
(
MyObject
)))
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
)))
Call
reportSuccess
()
dlls/vbscript/tests/run.c
View file @
db42703d
...
...
@@ -181,6 +181,8 @@ static const char *vt2a(VARIANT *v)
return
"VT_ARRAY|VT_VARIANT"
;
case
VT_ARRAY
|
VT_BYREF
|
VT_VARIANT
:
return
"VT_ARRAY|VT_BYREF|VT_VARIANT"
;
case
VT_UI1
:
return
"VT_UI1"
;
default:
ok
(
0
,
"unknown vt %d
\n
"
,
V_VT
(
v
));
return
NULL
;
...
...
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