Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b6089835
Commit
b6089835
authored
Sep 09, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added infrastructure for test scripts.
parent
a16f2053
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
5 deletions
+129
-5
Makefile.in
dlls/jscript/tests/Makefile.in
+2
-0
lang.js
dlls/jscript/tests/lang.js
+21
-0
rsrc.rc
dlls/jscript/tests/rsrc.rc
+20
-0
run.c
dlls/jscript/tests/run.c
+86
-5
No files found.
dlls/jscript/tests/Makefile.in
View file @
b6089835
...
...
@@ -9,6 +9,8 @@ CTESTS = \
jscript.c
\
run.c
RC_SRCS
=
rsrc.rc
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/jscript/tests/lang.js
0 → 100644
View file @
b6089835
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
ok
(
true
,
"true is not true?"
);
reportSuccess
();
dlls/jscript/tests/rsrc.rc
0 → 100644
View file @
b6089835
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @makedep: lang.js */
lang.js 40 "lang.js"
dlls/jscript/tests/run.c
View file @
b6089835
...
...
@@ -67,9 +67,14 @@ DEFINE_EXPECT(global_success_i);
#define DISPID_GLOBAL_TESTPROPGET 0x1000
#define DISPID_GLOBAL_TESTPROPPUT 0x1001
#define DISPID_GLOBAL_REPORTSUCCESS 0x1002
#define DISPID_GLOBAL_TRACE 0x1003
#define DISPID_GLOBAL_OK 0x1004
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
static
BOOL
strict_dispid_check
;
static
const
char
*
test_name
=
"(null)"
;
static
const
char
*
debugstr_w
(
LPCWSTR
str
)
{
static
char
buf
[
1024
];
...
...
@@ -191,6 +196,16 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown
static
HRESULT
WINAPI
Global_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
if
(
!
strcmp_wa
(
bstrName
,
"ok"
))
{
ok
(
grfdex
==
fdexNameCaseSensitive
,
"grfdex = %x
\n
"
,
grfdex
);
*
pid
=
DISPID_GLOBAL_OK
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"trace"
))
{
ok
(
grfdex
==
fdexNameCaseSensitive
,
"grfdex = %x
\n
"
,
grfdex
);
*
pid
=
DISPID_GLOBAL_TRACE
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"reportSuccess"
))
{
CHECK_EXPECT
(
global_success_d
);
ok
(
grfdex
==
fdexNameCaseSensitive
,
"grfdex = %x
\n
"
,
grfdex
);
...
...
@@ -210,16 +225,49 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
debugstr_w
(
bstrName
));
if
(
strict_dispid_check
)
ok
(
0
,
"unexpected call %s
\n
"
,
debugstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
}
static
HRESULT
WINAPI
Global_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
switch
(
id
)
{
case
DISPID_GLOBAL_REPORTSUCCESS
:
CHECK_EXPECT
(
global_success_i
);
switch
(
id
)
{
case
DISPID_GLOBAL_OK
:
ok
(
wFlags
==
INVOKE_FUNC
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg == NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
pdp
->
cArgs
==
2
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
)
==
VT_BSTR
,
"V_VT(psp->rgvargs) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
ok
(
V_VT
(
pdp
->
rgvarg
+
1
)
==
VT_BOOL
,
"V_VT(psp->rgvargs+1) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
ok
(
V_BOOL
(
pdp
->
rgvarg
+
1
),
"%s: %s
\n
"
,
test_name
,
debugstr_w
(
V_BSTR
(
pdp
->
rgvarg
)));
return
S_OK
;
case
DISPID_GLOBAL_TRACE
:
ok
(
wFlags
==
INVOKE_FUNC
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg == NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
pdp
->
cArgs
==
1
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
)
==
VT_BSTR
,
"V_VT(psp->rgvargs) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
if
(
V_VT
(
pdp
->
rgvarg
)
==
VT_BSTR
)
trace
(
"%s: %s
\n
"
,
test_name
,
debugstr_w
(
V_BSTR
(
pdp
->
rgvarg
)));
return
S_OK
;
case
DISPID_GLOBAL_REPORTSUCCESS
:
CHECK_EXPECT
(
global_success_i
);
ok
(
wFlags
==
INVOKE_FUNC
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
...
...
@@ -266,7 +314,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
return
S_OK
;
}
ok
(
0
,
"unexpected call %x
\n
"
,
id
);
ok
(
0
,
"unexpected call %x
\n
"
,
id
);
return
DISP_E_MEMBERNOTFOUND
;
}
...
...
@@ -433,8 +481,39 @@ static void parse_script_a(const char *src)
SysFreeString
(
tmp
);
}
static
void
run_from_res
(
const
char
*
name
)
{
const
char
*
data
;
DWORD
size
,
len
;
BSTR
str
;
HRSRC
src
;
strict_dispid_check
=
FALSE
;
test_name
=
name
;
src
=
FindResourceA
(
NULL
,
name
,
(
LPCSTR
)
40
);
ok
(
src
!=
NULL
,
"Could not find resource %s
\n
"
,
name
);
size
=
SizeofResource
(
NULL
,
src
);
data
=
LoadResource
(
NULL
,
src
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
data
,
size
,
NULL
,
0
);
str
=
SysAllocStringLen
(
NULL
,
len
-
1
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
data
,
size
,
str
,
len
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script
(
str
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SysFreeString
(
str
);
}
static
void
run_tests
(
void
)
{
strict_dispid_check
=
TRUE
;
parse_script_a
(
""
);
parse_script_a
(
"/* empty */ ;"
);
...
...
@@ -455,6 +534,8 @@ static void run_tests(void)
parse_script_a
(
"reportSuccess();"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
run_from_res
(
"lang.js"
);
}
START_TEST
(
run
)
...
...
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