Skip to content

Commit

Permalink
test(spgroup#31): add DefaultConstructor test
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Nov 18, 2021
1 parent a2b7355 commit a50793b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ private void exportResults(Set<Conflict> conflicts) throws Exception {
}

@Test
public void StringArraySample() {
public void defaultConstructorTest() {
String sampleClassPath = "br.unb.cic.analysis.samples.ioa.DefaultConstructorConflictSample";
AbstractMergeConflictDefinition definition = DefinitionFactory
.definition(sampleClassPath, new int[]{12}, new int[]{14});
InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition);
configureTest(analysis);
Assert.assertEquals(1, analysis.getConflicts().size());
}

@Test
public void StringArrayTest() {
String sampleClassPath = "br.unb.cic.analysis.samples.ioa.StringArraySample";
AbstractMergeConflictDefinition definition = DefinitionFactory
.definition(sampleClassPath, new int[]{14}, new int[]{25});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package br.unb.cic.analysis.samples.ioa;

public class DefaultConstructorConflictSample {
private static int x;

public DefaultConstructorConflictSample() {

}

public void m() {
DefaultConstructorConflictSample defaultConstructorConflictSample = new DefaultConstructorConflictSample();
int y = 2;
defaultConstructorConflictSample.x = 1;
}
}

0 comments on commit a50793b

Please sign in to comment.