public void testRowOrder(){
  boolean[] values=new boolean[2];
  int row=0;
  IndexedParent x=new IndexedParent(1,2);
  IndexedParent y=new IndexedParent(2,1);
  IndexedParent[] twoParents=new IndexedParent[]{x,y};
  BooleanFunction function=new BooleanFunction(twoParents);
  values[0]=true;
  values[1]=true;
  row=function.getRow(values);
  function.setValue(row,true);
  values[0]=true;
  values[1]=false;
  row=function.getRow(values);
  function.setValue(row,false);
  values[0]=false;
  values[1]=true;
  row=function.getRow(values);
  function.setValue(row,false);
  values[0]=false;
  values[1]=false;
  row=function.getRow(values);
  function.setValue(row,false);
  assertEquals(true,function.getValue(0));
  assertEquals(false,function.getValue(1));
  assertEquals(false,function.getValue(2));
  assertEquals(false,function.getValue(3));
}

public void testRowOrder ( ) { boolean [ ] values = new boolean [ 2 ] ; int row = 0 ; IndexedParent x = new IndexedParent ( 1 , 2 ) ; IndexedParent y = new IndexedParent ( 2 , 1 ) ; IndexedParent [ ] twoParents = new IndexedParent [ ] { x , y } ; BooleanFunction function = new BooleanFunction ( twoParents ) ; values [ 0 ] = true ; values [ 1 ] = true ; row = function . getRow ( values ) ; function . setValue ( row , true ) ; values [ 0 ] = true ; values [ 1 ] = false ; row = function . getRow ( values ) ; function . setValue ( row , false ) ; values [ 0 ] = false ; values [ 1 ] = true ; row = function . getRow ( values ) ; function . setValue ( row , false ) ; values [ 0 ] = false ; values [ 1 ] = false ; row = function . getRow ( values ) ; function . setValue ( row , false ) ; assertEquals ( true , function . getValue ( 0 ) ) ; assertEquals ( false , function . getValue ( 1 ) ) ; assertEquals ( false , function . getValue ( 2 ) ) ; assertEquals ( false , function . getValue ( 3 ) ) ; }
tests whether rows are stored in the correct order .
