Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorAlena Laskavaia2010-05-24 11:08:18 -0400
committerAlena Laskavaia2010-05-24 11:08:18 -0400
commitba99f3a2d56296d8476e652c4e539de38e1d567d (patch)
treee5695d29afa0d2075ec908ab6528f0377b590adc /codan
parent5a6ecb2fb8b2f1a170f3c9ae6b6d6420d5de9213 (diff)
downloadorg.eclipse.cdt-ba99f3a2d56296d8476e652c4e539de38e1d567d.tar.gz
org.eclipse.cdt-ba99f3a2d56296d8476e652c4e539de38e1d567d.tar.xz
org.eclipse.cdt-ba99f3a2d56296d8476e652c4e539de38e1d567d.zip
Test for macro parameters
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
index 707420d829..4f063fcc38 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
@@ -13,10 +13,7 @@ package org.eclipse.cdt.codan.core.internal.checkers;
import java.io.File;
import java.io.IOException;
-import org.eclipse.cdt.codan.core.CodanRuntime;
-import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.param.IProblemPreference;
-import org.eclipse.cdt.codan.core.param.MapProblemPreference;
import org.eclipse.cdt.codan.core.test.CheckerTestCase;
import org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectChecker;
@@ -147,7 +144,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// }
@SuppressWarnings("restriction")
public void testInMacro() {
- IProblemPreference macro = getMapPreference(
+ IProblemPreference macro = getPreference(
StatementHasNoEffectChecker.ER_ID,
StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.TRUE);
@@ -162,25 +159,11 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// }
@SuppressWarnings("restriction")
public void testInMacroParamOff() {
- IProblemPreference macro = getMapPreference(
+ IProblemPreference macro = getPreference(
StatementHasNoEffectChecker.ER_ID,
StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.FALSE);
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
-
- /**
- * @param problemId
- * @param paramId
- * @return
- */
- protected IProblemPreference getMapPreference(String problemId,
- String paramId) {
- IProblem problem = CodanRuntime.getInstance().getChechersRegistry()
- .getWorkspaceProfile().findProblem(problemId);
- IProblemPreference pref = ((MapProblemPreference) problem
- .getPreference()).getChildDescriptor(paramId);
- return pref;
- }
}

Back to the top