Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2011-03-13 01:32:17 -0500
committerMarc-Andre Laperle2011-03-13 01:32:17 -0500
commitcbd551eeef1c95ccc99cecebea77a32f58409d13 (patch)
treebd3a662f34f372b552c19af0de916ad3f047c5cb
parentd9f24fae675d3362e5c74ac77828f46774e056bc (diff)
downloadorg.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.
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java1
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/AutomatedIntegrationSuite.java2
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CreateLocalVariableQuickFixTest.java31
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 173c85c664..ef4cc85d37 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 1070b82d7c..3ed319422d 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 7f48b731b6..d1eb6a0b7d 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$
}
}

Back to the top