Package org.allspice.structured.expr

Examples of org.allspice.structured.expr.FieldVarExpr


  }
  public static interface CharSetFieldTest {
    public void meth(FieldTestClass arg0,char arg1) ;
  }
  public void test3() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"char_field",null),ARG1,null),null) ;
    CharSetFieldTest obj = makeObject(CharSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, (char)45) ;
    assertEquals(o2.char_field,(char)45) ;
  }
View Full Code Here


  }
  public static interface IntSetFieldTest {
    public void meth(FieldTestClass arg0,int arg1) ;
  }
  public void test5() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"int_field",null),ARG1,null),null) ;
    IntSetFieldTest obj = makeObject(IntSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5) ;
    assertEquals(o2.int_field,5) ;
  }
View Full Code Here

  }
  public static interface FloatSetFieldTest {
    public void meth(FieldTestClass arg0,float arg1) ;
  }
  public void test6() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"float_field",null),ARG1,null),null) ;
    FloatSetFieldTest obj = makeObject(FloatSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5F) ;
    assertTrue(o2.float_field == 5F) ;
  }
View Full Code Here

  }
  public static interface LongSetFieldTest {
    public void meth(FieldTestClass arg0,long arg1) ;
  }
  public void test7() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"long_field",null),ARG1,null),null) ;
    LongSetFieldTest obj = makeObject(LongSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5L) ;
    assertEquals(o2.long_field,5L) ;
  }
View Full Code Here

  }
  public static interface DoubleSetFieldTest {
    public void meth(FieldTestClass arg0,double arg1) ;
  }
  public void test8() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"double_field",null),ARG1,null),null) ;
    DoubleSetFieldTest obj = makeObject(DoubleSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, 5D) ;
    assertTrue(o2.double_field == 5D) ;
  }
View Full Code Here

  }
  public static interface ObjectSetFieldTest {
    public void meth(FieldTestClass arg0,Object arg1) ;
  }
  public void test9() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"obj_field",null),ARG1,null),null) ;
    ObjectSetFieldTest obj = makeObject(ObjectSetFieldTest.class,st,new ReturnStatement(null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, "abc") ;
    assertEquals(o2.obj_field,"abc") ;
  }
View Full Code Here

  }
  public static interface ArrSetFieldTest {
    public void meth(FieldTestClass arg0,Object[] arg1) ;
  }
  public void test10() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new FieldVarExpr(ARG0,"arr_field",null),ARG1,null),null) ;
    ObjectSetFieldTest obj = makeObject(ObjectSetFieldTest.class,st,new ReturnStatement(null)) ;
    Object[] arr = new Object[5] ;
    FieldTestClass o2 = new FieldTestClass() ;
    obj.meth(o2, arr) ;
    assertEquals(o2.arr_field,arr) ;
View Full Code Here

public class TestCallVirtual extends MyTestCase {
  public static interface CallVirtualTest {
    public int meth(CallVirtualTestClass arg0,int arg1) ;
  }
  public void test0() throws Exception {
    CallVirtualTest obj = makeObject(CallVirtualTest.class,new CallExpr(new FieldVarExpr(ARG0,"addone",null),
        new FIFO<Expr>(ARG1),null)) ;
    CallVirtualTestClass o2 = new CallVirtualTestClass() ;
    assertEquals(obj.meth(o2,5),6) ;
  }
View Full Code Here

public class TestGetField extends MyTestCase {
  public static interface BooleanGetFieldTest {
    public boolean meth(FieldTestClass arg0) ;
  }
  public void test0() throws Exception {
    BooleanGetFieldTest obj = makeObject(BooleanGetFieldTest.class,new FieldVarExpr(ARG0,"boolean_field",null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    o2.boolean_field = true ;
    assertEquals(obj.meth(o2),true) ;
    o2.boolean_field = false ;
    assertEquals(obj.meth(o2),false) ;
View Full Code Here

  }
  public static interface ByteGetFieldTest {
    public byte meth(FieldTestClass arg0) ;
  }
  public void test1() throws Exception {
    ByteGetFieldTest obj = makeObject(ByteGetFieldTest.class,new FieldVarExpr(ARG0,"byte_field",null)) ;
    FieldTestClass o2 = new FieldTestClass() ;
    o2.byte_field = 45 ;
    assertEquals(obj.meth(o2),(byte)45) ;
  }
View Full Code Here

TOP

Related Classes of org.allspice.structured.expr.FieldVarExpr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.