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
10b1a7ed
Commit
10b1a7ed
authored
Dec 28, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added conditional compilation tests.
parent
45e33ec2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
0 deletions
+97
-0
api.js
dlls/jscript/tests/api.js
+4
-0
cc.js
dlls/jscript/tests/cc.js
+75
-0
rsrc.rc
dlls/jscript/tests/rsrc.rc
+3
-0
run.c
dlls/jscript/tests/run.c
+15
-0
No files found.
dlls/jscript/tests/api.js
View file @
10b1a7ed
...
...
@@ -1899,6 +1899,7 @@ var exception_array = {
E_RBRACKET
:
{
type
:
"SyntaxError"
,
number
:
-
2146827282
},
E_SEMICOLON
:
{
type
:
"SyntaxError"
,
number
:
-
2146827284
},
E_UNTERMINATED_STR
:
{
type
:
"SyntaxError"
,
number
:
-
2146827273
},
E_DISABLED_CC
:
{
type
:
"SyntaxError"
,
number
:
-
2146827258
},
E_ILLEGAL_ASSIGN
:
{
type
:
"ReferenceError"
,
number
:
-
2146823280
},
...
...
@@ -1986,6 +1987,9 @@ testSyntaxError("while(", "E_SYNTAX_ERROR");
testSyntaxError
(
"if("
,
"E_SYNTAX_ERROR"
);
testSyntaxError
(
"'unterminated"
,
"E_UNTERMINATED_STR"
);
testSyntaxError
(
"*"
,
"E_SYNTAX_ERROR"
);
testSyntaxError
(
"@_jscript_version"
,
"E_DISABLED_CC"
);
testSyntaxError
(
"@a"
,
"E_DISABLED_CC"
);
testSyntaxError
(
"/* @cc_on @*/ @_jscript_version"
,
"E_DISABLED_CC"
);
// ReferenceError tests
testException
(
function
()
{
test
=
function
()
{}},
"E_ILLEGAL_ASSIGN"
);
...
...
dlls/jscript/tests/cc.js
0 → 100644
View file @
10b1a7ed
/*
* Copyright 2010 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
*/
eval
(
"@_jscript_version"
);
var
tmp
;
/*@ */
//@cc_on @*/
@
_jscript_version
;
@
cc_on
@
*
/
// Standard predefined variabled
if
(
isWin64
)
{
ok
(@
_win64
===
true
,
"@_win64 = "
+
@
_win64
);
ok
(@
_amd64
===
true
,
"@_amd64 = "
+
@
_amd64
);
ok
(
isNaN
(@
_win32
),
"@_win32 = "
+
@
_win32
);
ok
(
isNaN
(@
_x86
),
"@_x86 = "
+
@
_x86
);
}
else
{
ok
(@
_win32
===
true
,
"@_win32 = "
+
@
_win32
);
ok
(@
_x86
===
true
,
"@_x86 = "
+
@
_x86
);
ok
(
isNaN
(@
_win64
),
"@_win64 = "
+
@
_win64
);
ok
(
isNaN
(@
_amd64
),
"@_amd64 = "
+
@
_amd64
);
}
ok
(@
_jscript
===
true
,
"@_jscript = "
+
@
_jscript
);
ok
(@
_jscript_build
===
ScriptEngineBuildVersion
(),
"@_jscript_build = "
+
@
_jscript_build
+
" expected "
+
ScriptEngineBuildVersion
());
tmp
=
ScriptEngineMajorVersion
()
+
ScriptEngineMinorVersion
()
/
10
;
ok
(@
_jscript_version
===
tmp
,
"@_jscript_version = "
+
@
_jscript_version
+
" expected "
+
tmp
);
ok
(
isNaN
(@
_win16
),
"@_win16 = "
+
@
_win16
);
ok
(
isNaN
(@
_mac
),
"@_mac = "
+
@
_mac
);
ok
(
isNaN
(@
_alpha
),
"@_alpha = "
+
@
_alpha
);
ok
(
isNaN
(@
_mc680x0
),
"@_mc680x0 = "
+
@
_mc680x0
);
ok
(
isNaN
(@
_PowerPC
),
"@_PowerPC = "
+
@
_PowerPC
);
// Undefined variable
ok
(
isNaN
(@
xxx
),
"@xxx = "
+
@
xxx
);
ok
(
isNaN
(@
x
$_xx
),
"@x$_xx = "
+
@
x
$_xx
);
tmp
=
false
;
try
{
eval
(
"/*@cc_on */"
);
}
catch
(
e
)
{
tmp
=
true
;
}
ok
(
tmp
,
"expected syntax exception"
);
tmp
=
false
;
try
{
eval
(
"/*@_jscript_version */"
);
}
catch
(
e
)
{
tmp
=
true
;
}
ok
(
tmp
,
"expected syntax exception"
);
reportSuccess
();
dlls/jscript/tests/rsrc.rc
View file @
10b1a7ed
...
...
@@ -19,6 +19,9 @@
/* @makedep: api.js */
api.js 40 "api.js"
/* @makedep: cc.js */
cc.js 40 "cc.js"
/* @makedep: lang.js */
lang.js 40 "lang.js"
...
...
dlls/jscript/tests/run.c
View file @
10b1a7ed
...
...
@@ -87,6 +87,7 @@ DEFINE_EXPECT(invoke_func);
#define DISPID_GLOBAL_CREATEARRAY 0x100c
#define DISPID_GLOBAL_PROPGETFUNC 0x100d
#define DISPID_GLOBAL_OBJECT_FLAG 0x100e
#define DISPID_GLOBAL_ISWIN64 0x100f
#define DISPID_TESTOBJ_PROP 0x2000
...
...
@@ -387,6 +388,12 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"isWin64"
))
{
test_grfdex
(
grfdex
,
fdexNameCaseSensitive
);
*
pid
=
DISPID_GLOBAL_ISWIN64
;
return
S_OK
;
}
if
(
strict_dispid_check
)
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -543,6 +550,13 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
}
return
S_OK
;
case
DISPID_GLOBAL_ISWIN64
:
if
(
pvarRes
)
{
V_VT
(
pvarRes
)
=
VT_BOOL
;
V_BSTR
(
pvarRes
)
=
sizeof
(
void
*
)
==
8
?
VARIANT_TRUE
:
VARIANT_FALSE
;
}
return
S_OK
;
case
DISPID_GLOBAL_NULL_DISP
:
ok
(
wFlags
==
INVOKE_PROPERTYGET
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
...
...
@@ -1420,6 +1434,7 @@ static void run_tests(void)
run_from_res
(
"lang.js"
);
run_from_res
(
"api.js"
);
run_from_res
(
"regexp.js"
);
run_from_res
(
"cc.js"
);
test_isvisible
(
FALSE
);
test_isvisible
(
TRUE
);
...
...
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