diff options
author | Marc-Andre Laperle | 2011-03-13 06:32:17 +0000 |
---|---|---|
committer | Marc-Andre Laperle | 2011-03-13 06:32:17 +0000 |
commit | cbd551eeef1c95ccc99cecebea77a32f58409d13 (patch) | |
tree | bd3a662f34f372b552c19af0de916ad3f047c5cb /codan | |
parent | d9f24fae675d3362e5c74ac77828f46774e056bc (diff) | |
download | org.eclipse.cdt-cbd551eeef1c95ccc99cecebea77a32f58409d13.tar.gz org.eclipse.cdt-cbd551eeef1c95ccc99cecebea77a32f58409d13.tar.xz org.eclipse.cdt-cbd551eeef1c95ccc99cecebea77a32f58409d13.zip |
Add CreateLocalVariableQuickFix test to automated tests suite, fix the test. Minor clean up.
Diffstat (limited to 'codan')
3 files changed, 26 insertions, 8 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java index 173c85c6641..ef4cc85d37a 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java @@ -14,7 +14,6 @@ import org.eclipse.cdt.codan.core.test.CheckerTestCase; import org.eclipse.cdt.codan.internal.checkers.ProblemBindingChecker; public class ProblemBindingCheckerTest extends CheckerTestCase { - // @Override @Override public boolean isCpp() { return true; diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/AutomatedIntegrationSuite.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/AutomatedIntegrationSuite.java index 1070b82d7cb..3ed319422d7 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/AutomatedIntegrationSuite.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/AutomatedIntegrationSuite.java @@ -26,6 +26,7 @@ import org.eclipse.cdt.codan.core.internal.checkers.ReturnStyleCheckerTest; import org.eclipse.cdt.codan.core.internal.checkers.StatementHasNoEffectCheckerTest; import org.eclipse.cdt.codan.core.internal.checkers.SuggestedParenthesisCheckerTest; import org.eclipse.cdt.codan.core.internal.checkers.SuspiciousSemicolonCheckerTest; +import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CreateLocalVariableQuickFixTest; import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.SuggestedParenthesisQuickFixTest; public class AutomatedIntegrationSuite extends TestSuite { @@ -62,6 +63,7 @@ public class AutomatedIntegrationSuite extends TestSuite { suite.addTest(CodanFastTestSuite.suite()); // quick fixes suite.addTestSuite(SuggestedParenthesisQuickFixTest.class); + suite.addTestSuite(CreateLocalVariableQuickFixTest.class); return suite; } } diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CreateLocalVariableQuickFixTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CreateLocalVariableQuickFixTest.java index 7f48b731b67..d1eb6a0b7d8 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CreateLocalVariableQuickFixTest.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CreateLocalVariableQuickFixTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Tomasz Wesolowski and others + * Copyright (c) 2010, 2011 Tomasz Wesolowski and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.codan.internal.checkers.ui.quickfix; +import org.eclipse.cdt.codan.internal.checkers.ProblemBindingChecker; import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution; /** @@ -22,14 +23,30 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase { return new QuickFixCreateLocalVariable(); } + @Override + public boolean isCpp() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.cdt.codan.core.test.CodanTestCase#setUp() + */ + @Override + public void setUp() throws Exception { + super.setUp(); + enableProblems(ProblemBindingChecker.ERR_ID_FieldResolutionProblem, ProblemBindingChecker.ERR_ID_MethodResolutionProblem, + ProblemBindingChecker.ERR_ID_VariableResolutionProblem); + } + // void func() { // aChar = 'a'; // } - @SuppressWarnings("restriction") public void testChar() { loadcode(getAboveComment()); String result = runQuickFixOneFile(); - assertContainedIn("char aChar;", result); + assertContainedIn("char aChar;", result); //$NON-NLS-1$ } // void func() { @@ -38,7 +55,7 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase { public void testDouble() { loadcode(getAboveComment()); String result = runQuickFixOneFile(); - assertContainedIn("double aDouble;", result); + assertContainedIn("double aDouble;", result); //$NON-NLS-1$ } // void func() { @@ -47,7 +64,7 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase { public void testString() { loadcode(getAboveComment()); String result = runQuickFixOneFile(); - assertContainedIn("const char *aString;", result); + assertContainedIn("const char *aString;", result); //$NON-NLS-1$ } // void func() { @@ -56,7 +73,7 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase { public void testWString() { loadcode(getAboveComment()); String result = runQuickFixOneFile(); - assertContainedIn("const wchar_t *aWString;", result); + assertContainedIn("const wchar_t *aWString;", result); //$NON-NLS-1$ } // void func() { @@ -65,6 +82,6 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase { public void testFuncPtr() { loadcode(getAboveComment()); String result = runQuickFixOneFile(); - assertContainedIn("void (*aFuncPtr)();", result); + assertContainedIn("void (*aFuncPtr)();", result); //$NON-NLS-1$ } } |