23c7e04cdc982eaeb24e197a9271d0a171c3ccf3
[IRC.git] / Robust / src / Tests / mlp / tinyTest / test.java
1 public class Foo {
2   int f;
3   public Foo() {}
4 }
5
6
7 public class Test {
8
9   public static void main( String args[] ) {
10     
11     int x = Integer.parseInt( args[0] );
12     //int y = Integer.parseInt( args[1] );
13
14     doTheTest( x );
15
16     // just for testing root's ability to
17     // realize a single exit after all returns
18     // DOESN'T WORK!
19     //if( false ) {
20     //  return;
21     //}
22
23     
24     //Foo foo = new Foo();
25     //foo.f = x;
26     //setTo3( foo );
27   }
28
29   public static void doTheTest( int x ) {
30     
31     sese wrapper {
32
33       for( int i = 0; i < x; ++i ) {
34         sese calc {
35           int sum = 0;
36           for( int j = 0; j <= i; ++j ) {
37             sum = sum + j;
38           }
39         }
40         
41         sese prnt {
42           mightPrint( x, i, sum );
43         }
44       }
45       
46     }
47
48   }
49
50   public static void mightPrint( int x, int i, int sum ) {    
51     if( i == x - 1 ) {
52       sese output {
53         System.out.println( "sum of integers 0-"+i+" is "+sum );
54       }
55     }
56   }
57
58   /*
59   public static void setTo3( Foo foo ) {
60     sese func {
61       foo.f = 3;
62     }   
63   }
64   */
65 }