Package edu.cmu.cs.fusion.constraint.operations

Examples of edu.cmu.cs.fusion.constraint.operations.EndOfMethodOp


    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a EOM, but is " + op.getClass().getCanonicalName(), op instanceof EndOfMethodOp);
   
    EndOfMethodOp invoke = (EndOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 0, vars.size());   
  }
View Full Code Here


    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a EOM, but is " + op.getClass().getCanonicalName(), op instanceof EndOfMethodOp);
   
    EndOfMethodOp invoke = (EndOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 2, vars.size());   
    Assert.assertEquals("Wrong type", "Foo", vars.getType(Constraint.RECEIVER));   
    Assert.assertEquals("Wrong type", "Baz", vars.getType(Constraint.RESULT));   
  }
View Full Code Here

    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a EOM, but is " + op.getClass().getCanonicalName(), op instanceof EndOfMethodOp);
   
    EndOfMethodOp invoke = (EndOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 1, vars.size());     
    Assert.assertEquals("Wrong type", "Baz", vars.getType(Constraint.RESULT));   
  }
View Full Code Here

    utils = new TestUtils();
  }

  @Test
  public void testFreeVars() {
    EndOfMethodOp construct = new EndOfMethodOp(null, null, null, null, null, false);
    FreeVars fv = construct.getFreeVariables();
   
    assertEquals(1, fv.size());
  }
View Full Code Here

    assertEquals(1, fv.size());
  }
 
  @Test
  public void testFreeVarsStaticReturn() {
    EndOfMethodOp construct = new EndOfMethodOp(null, null, null, null, "Bar", true);
    FreeVars fv = construct.getFreeVariables();
   
    assertEquals(1, fv.size());
  }
View Full Code Here

   
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
   
    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

    params.add(new StubVariable());
    StubVariable var = new StubVariable();
 
    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

    params.add(new StubVariable());
    StubVariable var = new StubVariable("A", "Foo");
 
    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

    StubVariable var = new StubVariable();
    StubVariable retVar = new StubVariable("A" , "Foo");
 
    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

TOP

Related Classes of edu.cmu.cs.fusion.constraint.operations.EndOfMethodOp

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.