use of org.abs_models.frontend.analyser.SemanticConditionList in project abstools by abstools.
the class ParFnAppTest method tooManyArgsForFuncParam.
@Test
public void tooManyArgsForFuncParam() {
Model m = parse("apply(tooFew)(0);", applyFunction(), "def Int tooFew() = 0;");
m.expandPartialFunctions();
SemanticConditionList conditions = m.typeCheck();
assertTrue(conditions.containsErrors());
}
use of org.abs_models.frontend.analyser.SemanticConditionList in project abstools by abstools.
the class ProductLineTypeAnalysisTest method wellFormedProductLine2.
@Test
public void wellFormedProductLine2() {
Model model = assertParse("module M;" + "delta D1;" + "delta D2;" + "productline PL;" + "features A;" + "delta D1 after D2;" + "delta D2;");
ProductLine pl = model.getProductLine();
SemanticConditionList errors = new SemanticConditionList();
/*
* All OK
*/
assertTrue(ProductLineAnalysisHelper.wellFormedProductLine(pl, errors));
assertEquals(0, errors.getErrorCount());
}
use of org.abs_models.frontend.analyser.SemanticConditionList in project abstools by abstools.
the class ProductLineTypeAnalysisTest method stronglyUnambiguousProductLine2.
@Test
public void stronglyUnambiguousProductLine2() {
Model model = assertParse("module M;" + "delta D1; uses M; modifies class C { adds Unit foo() {} }" + "delta D2; uses M; modifies class C { adds Unit bar() {} }" + "productline PL;" + "features A;" + "delta D1;" + "delta D2;");
ProductLine pl = model.getProductLine();
SemanticConditionList errors = new SemanticConditionList();
/*
* Both deltas are in same partition (no order specified)
* They modify class C in different ways, by adding different methods
*/
assertTrue(ProductLineAnalysisHelper.isStronglyUnambiguous(pl, errors));
assertEquals(0, errors.getErrorCount());
}
use of org.abs_models.frontend.analyser.SemanticConditionList in project abstools by abstools.
the class ProductLineTypeAnalysisTest method stronglyUnambiguousProductLine3.
@Test
public void stronglyUnambiguousProductLine3() {
Model model = assertParse("module M;" + "productline PL;" + "features A;");
ProductLine pl = model.getProductLine();
SemanticConditionList errors = new SemanticConditionList();
/*
* No deltas, no worries
*/
assertTrue(ProductLineAnalysisHelper.isStronglyUnambiguous(pl, errors));
assertEquals(0, errors.getErrorCount());
List<Set<String>> partition = pl.getDeltaPartition();
assertEquals(partition.size(), 0);
}
use of org.abs_models.frontend.analyser.SemanticConditionList in project abstools by abstools.
the class ProductLineTypeAnalysisTest method stronglyUnambiguousProductLine4.
@Test
public void stronglyUnambiguousProductLine4() {
Model model = assertParse("module M;" + "delta D1; uses M; modifies class C { adds Unit foo() {} }" + "delta D2; uses M; modifies class C { adds Unit foo() {} }" + "productline PL;" + "features A;" + "delta D1;" + "delta D2;");
ProductLine pl = model.getProductLine();
SemanticConditionList errors = new SemanticConditionList();
/* Both deltas are in same partition (no order specified)
* Both deltas modify the same method C.foo
*/
assertFalse(ProductLineAnalysisHelper.isStronglyUnambiguous(pl, errors));
assertEquals(1, errors.getErrorCount());
}
Aggregations