Skip to content

Commit

Permalink
test(spgroup#31): add concat matheods test case
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Jan 20, 2021
1 parent a579687 commit 3395bba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ public void objectFieldNotConflict() {
Assert.assertEquals(0, analysis.getConflicts().size());
}

@Test
public void concatMethodsConflict() {
String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentConcatMethodsConflictInterProceduralSample";
AbstractMergeConflictDefinition definition = DefinitionFactory
.definition(sampleClassPath, new int[]{7}, new int[]{8});
InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition);
configureTest(analysis);
Assert.assertEquals(1, analysis.getConflicts().size());
}

//@Ignore
@Test
public void ifBranchConflict() {
String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentIfBranchConflictInterProceduralSample";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package br.unb.cic.analysis.samples;

// Conflict: [left, m():7] --> [right, foo():8]
public class OverridingAssignmentConcatMethodsConflictInterProceduralSample {

public void m() {
int x = foo() + bar(); // LEFT
x = x + qux(); // RIGHT
System.out.println(x);
}

private int foo() {
return 1;
}

private int bar() {
return 2;
}

private int qux() {
return 3;
}
}

0 comments on commit 3395bba

Please sign in to comment.