Debian Codegraph @

rhino/testsrc/tests/ecma_2/Statements/dowhile-007.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = 'dowhile-007.js';
7
8 /**
9 * File Name: dowhile-007
10 * ECMA Section:
11 * Description: do...while statements
12 *
13 * A general do...while test.
14 *
15 * Author: [email protected]
16 * Date: 26 August 1998
17 */
18 var SECTION = "dowhile-007";
19 var VERSION = "ECMA_2";
20 var TITLE = "do...while";
21
22 startTest();
23 writeHeaderToLog( SECTION + " "+ TITLE);
24
25 DoWhile( new DoWhileObject( false, false, false, false ));
26 DoWhile( new DoWhileObject( true, false, false, false ));
27 DoWhile( new DoWhileObject( true, true, false, false ));
28 DoWhile( new DoWhileObject( true, true, true, false ));
29 DoWhile( new DoWhileObject( true, true, true, true ));
30 DoWhile( new DoWhileObject( false, false, false, true ));
31 DoWhile( new DoWhileObject( false, false, true, true ));
32 DoWhile( new DoWhileObject( false, true, true, true ));
33 DoWhile( new DoWhileObject( false, false, true, false ));
34
35 test();
36
37 function DoWhileObject( out1, out2, out3, in1 ) {
38 this.breakOutOne = out1;
39 this.breakOutTwo = out2;
40 this.breakOutThree = out3;
41 this.breakIn = in1;
42 }
43 function DoWhile( object ) {
44 result1 = false;
45 result2 = false;
46 result3 = false;
47 result4 = false;
48
49 outie:
50 do {
51 if ( object.breakOutOne ) {
52 break outie;
53 }
54 result1 = true;
55
56 innie:
57 do {
58 if ( object.breakOutTwo ) {
59 break outie;
60 }
61 result2 = true;
62
63 if ( object.breakIn ) {
64 break innie;
65 }
66 result3 = true;
67
68 } while ( false );
69 if ( object.breakOutThree ) {
70 break outie;
71 }
72 result4 = true;
73 } while ( false );
74
75 new TestCase(
76 SECTION,
77 "break one: ",
78 (object.breakOutOne) ? false : true,
79 result1 );
80
81 new TestCase(
82 SECTION,
83 "break two: ",
84 (object.breakOutOne||object.breakOutTwo) ? false : true,
85 result2 );
86
87 new TestCase(
88 SECTION,
89 "break three: ",
90 (object.breakOutOne||object.breakOutTwo||object.breakIn) ? false : true,
91 result3 );
92
93 new TestCase(
94 SECTION,
95 "break four: ",
96 (object.breakOutOne||object.breakOutTwo||object.breakOutThree) ? false: true,
97 result4 );
98 }