Package edu.cmu.cs.fusion.test

Examples of edu.cmu.cs.fusion.test.EqualityOnlyTypeHierarchy


   
    StubMethodCallInstruction instr = new StubMethodCallInstruction("mName", new StubVariable(), params, new StubMethodBinding(rBinding, vBindings), new StubVariable())
   
    EndOfMethodOp op = new EndOfMethodOp(null, null, null, null, null, false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);

    assertTrue(map == null);
  }
View Full Code Here


 
    Pair<ReturnInstruction, Method> pair = getRetAndMethod(var, params, new StubVariable());
   
    EndOfMethodOp op = new EndOfMethodOp(null, null, null, null, null, false);

    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), pair.snd(), pair.fst());
   
    assertTrue(map != null);
    assertEquals(1, map.size());
    assertTrue(map.contains(new Binding(Constraint.RECEIVER, var)));
 
View Full Code Here

 
    Pair<ReturnInstruction, Method> pair = getRetAndMethod(new StubVariable(), params, var);
   
    EndOfMethodOp op = new EndOfMethodOp(null, null, null, null, "Foo", true);

    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), pair.snd(), pair.fst());
   
    assertTrue(map != null);
    assertEquals(1, map.size());
    assertTrue(map.contains(new Binding(Constraint.RESULT, var)));
 
View Full Code Here

 
    Pair<ReturnInstruction, Method> pair = getRetAndMethod(var, params, retVar);
   
    EndOfMethodOp op = new EndOfMethodOp(null, null, null, null, "Foo", false);

    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), pair.snd(), pair.fst());
   
    assertTrue(map != null);
    assertEquals(2, map.size());
    assertTrue(map.contains(new Binding(Constraint.RESULT, retVar)));
    assertTrue(map.contains(new Binding(Constraint.RECEIVER, var)));
View Full Code Here

   
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);

    assertTrue(map == null);
  }
View Full Code Here

  public void testMatchWrongType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());
   
    ConstructorOp op = new ConstructorOp("Baz", new SpecVar[] {utils.getVar(1)}, new String[] {"Bar"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
  }
View Full Code Here

  public void testMatchWrongParamType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());

    ConstructorOp op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(1)}, new String[] {"Baz"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null)
  }
View Full Code Here

    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
   
 
View Full Code Here

    NewObjectInstruction instr = getNOI(target, param);
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, target)));
    assertTrue(list.contains(new Binding(utils.getVar(0), param)));
   
View Full Code Here

    NewObjectInstruction instr = getNOI(target, target);
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, target)));
    assertTrue(list.contains(new Binding(utils.getVar(0), target)));
   
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.test.EqualityOnlyTypeHierarchy

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.