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
c18b84cf
Commit
c18b84cf
authored
Mar 26, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added decoding tests.
parent
f7a86505
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
4 deletions
+79
-4
run.c
dlls/jscript/tests/run.c
+79
-4
No files found.
dlls/jscript/tests/run.c
View file @
c18b84cf
...
...
@@ -29,6 +29,8 @@
static
const
CLSID
CLSID_JScript
=
{
0xf414c260
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
static
const
CLSID
CLSID_JScriptEncode
=
{
0xf414c262
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
...
...
@@ -97,6 +99,8 @@ DEFINE_EXPECT(DeleteMemberByDispID);
#define DISPID_TESTOBJ_PROP 0x2000
#define DISPID_TESTOBJ_ONLYDISPID 0x2001
#define JS_E_INVALID_CHAR 0x800a03f6
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
static
const
CHAR
testA
[]
=
"test"
;
static
const
WCHAR
test_valW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'V'
,
'a'
,
'l'
,
0
};
...
...
@@ -107,6 +111,7 @@ static const char *test_name = "(null)";
static
IDispatch
*
script_disp
;
static
int
invoke_version
;
static
IActiveScriptError
*
script_error
;
static
const
CLSID
*
engine_clsid
=
&
CLSID_JScript
;
/* Returns true if the user interface is in English. Note that this does not
* presume of the formatting of dates, numbers, etc.
...
...
@@ -1016,7 +1021,7 @@ static IActiveScript *create_script(void)
VARIANT
v
;
HRESULT
hres
;
hres
=
CoCreateInstance
(
&
CLSID_JScript
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
hres
=
CoCreateInstance
(
engine_clsid
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IActiveScript
,
(
void
**
)
&
script
);
ok
(
hres
==
S_OK
,
"CoCreateInstance failed: %08x
\n
"
,
hres
);
...
...
@@ -1440,7 +1445,7 @@ static void test_isvisible(BOOL global_members)
IUnknown_Release
(
parser
);
}
static
void
run_tests
(
void
)
static
BOOL
run_tests
(
void
)
{
HRESULT
hres
;
...
...
@@ -1450,7 +1455,7 @@ static void run_tests(void)
script
=
create_script
();
if
(
!
script
)
{
win_skip
(
"Could not create script
\n
"
);
return
;
return
FALSE
;
}
IActiveScript_Release
(
script
);
}
...
...
@@ -1648,6 +1653,73 @@ static void run_tests(void)
"Microsoft JScript runtime error"
,
"Object expected"
,
NULL
);
return
TRUE
;
}
static
void
run_encoded_tests
(
void
)
{
BSTR
src
;
HRESULT
hres
;
engine_clsid
=
&
CLSID_JScriptEncode
;
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
/* |reportSuccess(); | */
parse_script_a
(
"#@~^EAAAAA==.
\x7f
wGMYUEm1+kd`*iAQYAAA==^#~@"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_a
(
"reportSuccess();"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
/* |Success | */
parse_script_a
(
"report#@~^BwAAAA==j!m^
\x7f
/k2QIAAA==^#~@();"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
/* |\r\n\treportSuccess();\r\n | */
parse_script_a
(
"#@~^GQAAAA==@#@&d.
\x7f
wKDYUE1^+k/c#p@#@&OAYAAA==^#~@"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
/* v */
src
=
a2bstr
(
"#@~^EAA*AA==.
\x7f
wGMYUEm1+kd`*iAQYAAA==^#~@"
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
SysFreeString
(
src
);
ok
(
hres
==
JS_E_INVALID_CHAR
,
"parse_script failed %08x
\n
"
,
hres
);
/* vv */
src
=
a2bstr
(
"#@~^EAAAAAAA==.
\x7f
wGMYUEm1+kd`*iAQYAAA==^#~@"
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
SysFreeString
(
src
);
ok
(
hres
==
JS_E_INVALID_CHAR
,
"parse_script failed %08x
\n
"
,
hres
);
/* v */
src
=
a2bstr
(
"#@~^EAAAAA^=.
\x7f
wGMYUEm1+kd`*iAQYAAA==^#~@"
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
SysFreeString
(
src
);
ok
(
hres
==
JS_E_INVALID_CHAR
,
"parse_script failed %08x
\n
"
,
hres
);
/* v */
src
=
a2bstr
(
"#@~^EAAAAA==.
\x7f
wGMYUEm1ekd`*iAQYAAA==^#~@"
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
SysFreeString
(
src
);
ok
(
hres
==
JS_E_INVALID_CHAR
,
"parse_script failed %08x
\n
"
,
hres
);
/* vv */
src
=
a2bstr
(
"#@~^EAAAAA==.
\x7f
wGMYUEm1+kd`*iAQYAAA==^~#@"
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
SysFreeString
(
src
);
ok
(
hres
==
JS_E_INVALID_CHAR
,
"parse_script failed %08x
\n
"
,
hres
);
}
static
BOOL
check_jscript
(
void
)
...
...
@@ -1690,7 +1762,10 @@ START_TEST(run)
trace
(
"invoke version 2
\n
"
);
invoke_version
=
2
;
run_tests
();
if
(
run_tests
())
{
trace
(
"JSctipt.Encode tests...
\n
"
);
run_encoded_tests
();
}
}
CoUninitialize
();
...
...
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