1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
24 ECMA Section: 11.4.2 the Void Operator
25 Description: always returns undefined (?)
26 Author: christine@netscape.com
30 var SECTION = "11.4.2";
31 var VERSION = "ECMA_1";
33 var TITLE = "The void operator";
35 writeHeaderToLog( SECTION + " "+ TITLE);
37 var testcases = getTestCases();
41 function getTestCases() {
42 var array = new Array();
45 array[item++] = new TestCase( SECTION, "void(new String('string object'))", void 0, void(new String( 'string object' )) );
46 array[item++] = new TestCase( SECTION, "void('string primitive')", void 0, void("string primitive") );
47 array[item++] = new TestCase( SECTION, "void(Number.NaN)", void 0, void(Number.NaN) );
48 array[item++] = new TestCase( SECTION, "void(Number.POSITIVE_INFINITY)", void 0, void(Number.POSITIVE_INFINITY) );
49 array[item++] = new TestCase( SECTION, "void(1)", void 0, void(1) );
50 array[item++] = new TestCase( SECTION, "void(0)", void 0, void(0) );
51 array[item++] = new TestCase( SECTION, "void(-1)", void 0, void(-1) );
52 array[item++] = new TestCase( SECTION, "void(Number.NEGATIVE_INFINITY)", void 0, void(Number.NEGATIVE_INFINITY) );
53 array[item++] = new TestCase( SECTION, "void(Math.PI)", void 0, void(Math.PI) );
54 array[item++] = new TestCase( SECTION, "void(true)", void 0, void(true) );
55 array[item++] = new TestCase( SECTION, "void(false)", void 0, void(false) );
56 array[item++] = new TestCase( SECTION, "void(null)", void 0, void(null) );
57 array[item++] = new TestCase( SECTION, "void new String('string object')", void 0, void new String( 'string object' ) );
58 array[item++] = new TestCase( SECTION, "void 'string primitive'", void 0, void "string primitive" );
59 array[item++] = new TestCase( SECTION, "void Number.NaN", void 0, void Number.NaN );
60 array[item++] = new TestCase( SECTION, "void Number.POSITIVE_INFINITY", void 0, void Number.POSITIVE_INFINITY );
61 array[item++] = new TestCase( SECTION, "void 1", void 0, void 1 );
62 array[item++] = new TestCase( SECTION, "void 0", void 0, void 0 );
63 array[item++] = new TestCase( SECTION, "void -1", void 0, void -1 );
64 array[item++] = new TestCase( SECTION, "void Number.NEGATIVE_INFINITY", void 0, void Number.NEGATIVE_INFINITY );
65 array[item++] = new TestCase( SECTION, "void Math.PI", void 0, void Math.PI );
66 array[item++] = new TestCase( SECTION, "void true", void 0, void true );
67 array[item++] = new TestCase( SECTION, "void false", void 0, void false );
68 array[item++] = new TestCase( SECTION, "void null", void 0, void null );
70 // array[item++] = new TestCase( SECTION, "void()", void 0, void() );
76 for ( i = 0; i < testcases.length; i++ ) {
77 testcases[i].passed = writeTestCaseResult(
80 testcases[i].description +" = "+ testcases[i].actual );
81 testcases[i].reason += ( testcases[i].passed ) ? "" : "wrong value "