From a579687645f22cce63fda697a1ed613506817663 Mon Sep 17 00:00:00 2001 From: Barbosa Date: Tue, 22 Dec 2020 17:40:46 -0300 Subject: [PATCH] test(#31): add if branch test case --- ...nterproceduralOverridingAssignmentAnalysisTest.java | 10 ++++++++++ ...signmentIfBranchConflictInterProceduralSample.java} | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) rename src/test/java/br/unb/cic/analysis/samples/{OverridingAssignmentBranchConflictInterProceduralSample.java => OverridingAssignmentIfBranchConflictInterProceduralSample.java} (81%) diff --git a/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java index 24c4eac8..270b5511 100644 --- a/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java +++ b/src/test/java/br/unb/cic/analysis/ioa/InterproceduralOverridingAssignmentAnalysisTest.java @@ -125,5 +125,15 @@ public void objectFieldNotConflict() { Assert.assertEquals(0, analysis.getConflicts().size()); } + @Test + public void ifBranchConflict() { + String sampleClassPath = "br.unb.cic.analysis.samples.OverridingAssignmentIfBranchConflictInterProceduralSample"; + AbstractMergeConflictDefinition definition = DefinitionFactory + .definition(sampleClassPath, new int[]{8}, new int[]{9}); + InterproceduralOverrideAssignment analysis = new InterproceduralOverrideAssignment(definition); + configureTest(analysis); + Assert.assertEquals(1, analysis.getConflicts().size()); + } + } diff --git a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentBranchConflictInterProceduralSample.java b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentIfBranchConflictInterProceduralSample.java similarity index 81% rename from src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentBranchConflictInterProceduralSample.java rename to src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentIfBranchConflictInterProceduralSample.java index f66a959d..eb4e9244 100644 --- a/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentBranchConflictInterProceduralSample.java +++ b/src/test/java/br/unb/cic/analysis/samples/OverridingAssignmentIfBranchConflictInterProceduralSample.java @@ -1,7 +1,7 @@ package br.unb.cic.analysis.samples; // Conflict: [left, m():8] --> [right, foo():14] -public class OverridingAssignmentBranchConflictInterProceduralSample { +public class OverridingAssignmentIfBranchConflictInterProceduralSample { private int x; public void m() {