Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs32
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java47
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentInConditionCheckerTest.java31
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentToItselfCheckerTest.java13
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java62
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CatchByReferenceTest.java27
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java72
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerLineTests.java10
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerNestedTests.java6
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/FormatStringCheckerTest.java39
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java24
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java14
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java58
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnStyleCheckerTest.java20
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java34
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuggestedParenthesisCheckerTest.java19
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java32
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java76
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/BasicProblemPreferenceTest.java22
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/ListProblemPreferenceTest.java58
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/MapProblemPreferenceTest.java34
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java8
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanTestCase.java20
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/AssignmentInConditionQuickFixTest.java1
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CaseBreakQuickFixTest.java1
25 files changed, 383 insertions, 377 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
index d4a78343113..0722042a86f 100644
--- a/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
+++ b/codan/org.eclipse.cdt.codan.core.test/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,13 @@
-#Wed Feb 23 19:43:55 EST 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
@@ -14,6 +22,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -21,12 +30,15 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
@@ -34,21 +46,34 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
@@ -58,14 +83,17 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.7
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
index a4d4c79553f..800708747f9 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
@@ -15,7 +15,6 @@ import org.eclipse.cdt.codan.internal.checkers.AbstractClassInstantiationChecker
/**
* Test for {@see AbstractClassInstantiationChecker} class
- *
*/
public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
@Override
@@ -35,7 +34,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// C c; // No errors.
// }
- public void testNotAbstractClassCreationOnStack() {
+ public void testNotAbstractClassCreationOnStack() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -46,7 +45,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// C* c = new C(); // No errors.
// }
- public void testNotAbstractClassCreationWithNew() {
+ public void testNotAbstractClassCreationWithNew() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -57,7 +56,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// C::C(); // No errors.
// }
- public void testNotAbstractClassCreationWithDirectConstructorCall() {
+ public void testNotAbstractClassCreationWithDirectConstructorCall() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -69,7 +68,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// C* c1; // No errors.
// C& c2; // No errors.
// }
- public void testAbstractClassPointerOrReverenceDeclaration() {
+ public void testAbstractClassPointerOrReverenceDeclaration() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -82,7 +81,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// C c; // 1 error for: C::f().
// typedefC tc; // 1 error for: C::f().
// }
- public void testAbstractClassCreationOnStack() {
+ public void testAbstractClassCreationOnStack() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6, 7);
}
@@ -95,7 +94,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// C *c1, c2, &c3; // 1 error for: C::f().
// typedefC *tc1, tc2, &tc3; // 1 error for: C::f().
// }
- public void testAbstractClassCreationOnStackWithRefAndPtr() {
+ public void testAbstractClassCreationOnStackWithRefAndPtr() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6, 7);
}
@@ -110,7 +109,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void test4 ( C ) {} // 1 error for: C::f().
// void test5 ( C* _c ) {} // No errors.
// void test6 ( typedefC& _c ) {} // No errors.
- public void testAbstractClassCreationAsFunctionParameter() {
+ public void testAbstractClassCreationAsFunctionParameter() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(5, 6, 7, 7, 8);
}
@@ -120,7 +119,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// };
// template <typename C> // No errors.
// void test () {}
- public void testAbstractClassCreationAsFunctionTemplateParameter() {
+ public void testAbstractClassCreationAsFunctionTemplateParameter() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -140,7 +139,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// C** x1 = new C*(); // No errors.
// typedefC** x2 = new typedefC*(); // No errors.
// }
- public void testAbstractClassCreationWithNew() {
+ public void testAbstractClassCreationWithNew() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6, 7, 8, 9, 10, 11, 12);
}
@@ -153,7 +152,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// C::C(); // 1 error for: C::f().
// typedefC::C(); // 1 error for: C::f().
// }
- public void testAbstractClassCreationWithDirectConstructorCall() {
+ public void testAbstractClassCreationWithDirectConstructorCall() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6, 7);
}
@@ -166,7 +165,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// N::C* c = new N::C(); // 1 error for: N::C::f().
// }
- public void testAbstractClassFromNamespace() {
+ public void testAbstractClassFromNamespace() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -178,7 +177,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// C* c = new C(); // 2 errors for: C::f(), C::g().
// }
- public void testAbstractClassWithAFewVirtualMethods() {
+ public void testAbstractClassWithAFewVirtualMethods() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6, 6);
}
@@ -191,7 +190,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// Derived* d = new Derived(); // 1 error for: Base::f().
// }
- public void testAbstractClassBecauseOfBaseClass() {
+ public void testAbstractClassBecauseOfBaseClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -206,7 +205,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// void scope () {
// Derived* c = new Derived(); // 2 errors for: Base::f(), Derived::g().
// }
- public void testAbstractClassWithVirtualRedefinition() {
+ public void testAbstractClassWithVirtualRedefinition() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(9, 9);
}
@@ -215,7 +214,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// virtual void f() = 0;
// };
// typedef C typedefC; // No errors.
- public void testAbstractClassTypedef() {
+ public void testAbstractClassTypedef() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -224,7 +223,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// virtual void f() = 0;
// };
// extern C typedefC; // 1 error for: C::f().
- public void testExternAbstractClassDeclaration() {
+ public void testExternAbstractClassDeclaration() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
@@ -240,7 +239,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// };
//
// B b;
- public void testPureVirtualDestructorOverride_1() {
+ public void testPureVirtualDestructorOverride_1() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -254,7 +253,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// };
//
// B b;
- public void testPureVirtualDestructorOverride_2() {
+ public void testPureVirtualDestructorOverride_2() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -272,7 +271,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// struct Multiple: public Empty, public Implementer {};
//
// static Multiple sharedMultiple;
- public void testDiamondInheritanceWithOneImplementor_bug351612a() {
+ public void testDiamondInheritanceWithOneImplementor_bug351612a() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -290,7 +289,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// struct Multiple: public Empty, public Implementer {};
//
// static Multiple sharedMultiple;
- public void testDiamondInheritanceWithOneImplementor_bug351612b() {
+ public void testDiamondInheritanceWithOneImplementor_bug351612b() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(13);
}
@@ -308,7 +307,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// struct Multiple: public Empty, public Implementer {};
//
// static Multiple sharedMultiple;
- public void testDiamondInheritanceWithOneImplementor_bug351612c() {
+ public void testDiamondInheritanceWithOneImplementor_bug351612c() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(13);
}
@@ -326,7 +325,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// struct Multiple: virtual public Implementer, virtual public Empty {};
//
// static Multiple sharedMultiple;
- public void testDiamondInheritanceWithOneImplementor_bug419938() {
+ public void testDiamondInheritanceWithOneImplementor_bug419938() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -345,7 +344,7 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
// int main() {
// B c;
// }
- public void testUsingDeclarationInDerivedClass_bug414279() {
+ public void testUsingDeclarationInDerivedClass_bug414279() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentInConditionCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentInConditionCheckerTest.java
index 09f79f81239..6f8a2bf82d6 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentInConditionCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentInConditionCheckerTest.java
@@ -16,15 +16,8 @@ import org.eclipse.core.resources.IMarker;
/**
* Test for {@see AssignmentInConditionChecker} class
- *
*/
-@SuppressWarnings("nls")
public class AssignmentInConditionCheckerTest extends CheckerTestCase {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.cdt.codan.core.test.CodanTestCase#setUp()
- */
@Override
public void setUp() throws Exception {
super.setUp();
@@ -35,7 +28,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if (a=b) b=4; // error here on line 3
// }
- public void test_basic() {
+ public void test_basic() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -45,7 +38,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
//
// if ((a=b)) b--; // no error
// }
- public void test_fixed() {
+ public void test_fixed() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -54,7 +47,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if ((a=b)!=0) b=4; // no error here on line 3
// }
- public void test3() {
+ public void test3() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -63,7 +56,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int i,a[10];
// if (a[i]=0) b=4; // no error here on line 3
// }
- public void test_array() {
+ public void test_array() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -73,7 +66,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// for (i = 0; i=b; i++) { // here
// }
// }
- public void test_for() {
+ public void test_for() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -83,7 +76,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// while (i=b) { // here
// }
// }
- public void test_while() {
+ public void test_while() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -92,7 +85,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int i,b=3;
// (i=b)?i++:b++; // here
// }
- public void test_tri() {
+ public void test_tri() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -101,7 +94,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if (a=b) b=4; // error here on line 3
// }
- public void test_basic_params() {
+ public void test_basic_params() throws Exception {
loadCodeAndRun(getAboveComment());
IMarker marker = checkErrorLine(3);
String arg = CodanProblemMarker.getProblemArgument(marker, 0);
@@ -113,7 +106,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// while (i=b()) { // @suppress("Assignment in condition")
// }
// }
- public void test_while2supp() {
+ public void test_while2supp() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -123,7 +116,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// while (i=b()) { /* @suppress("Assignment in condition") */
// }
// }
- public void test_while3supp() {
+ public void test_while3supp() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -133,7 +126,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int i;
// LOOP();
// }
- public void test_whileMacroSupp() {
+ public void test_whileMacroSupp() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4); // TODO: suppression does not work in macro body now
}
@@ -143,7 +136,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// int i;
// LOOP(); // err
// }
- public void test_whileMacro() {
+ public void test_whileMacro() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentToItselfCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentToItselfCheckerTest.java
index bbf1f05d4b1..e3c5968d7fc 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentToItselfCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AssignmentToItselfCheckerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Severin Gehwolf
+ * Copyright (c) 2010 Severin Gehwolf
* 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
@@ -14,14 +14,13 @@ import org.eclipse.cdt.codan.core.test.CheckerTestCase;
/**
* Test for {@see AssignmentToItselfChecker} class
- *
*/
public class AssignmentToItselfCheckerTest extends CheckerTestCase {
// void main() {
// int x = 0;
// x = 10;
// }
- public void testNoErrorConstants() {
+ public void testNoErrorConstants() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -31,7 +30,7 @@ public class AssignmentToItselfCheckerTest extends CheckerTestCase {
// int s = 10;
// x = s;
// }
- public void testNoErrorVariables() {
+ public void testNoErrorVariables() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -40,7 +39,7 @@ public class AssignmentToItselfCheckerTest extends CheckerTestCase {
// int x = 0;
// x = x;
// }
- public void testSimpleVariableSelfAssignmentError() {
+ public void testSimpleVariableSelfAssignmentError() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -50,7 +49,7 @@ public class AssignmentToItselfCheckerTest extends CheckerTestCase {
// int x = 10;
// str[i] = str[i];
// }
- public void testArraySelfAssignmentError() {
+ public void testArraySelfAssignmentError() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
@@ -60,7 +59,7 @@ public class AssignmentToItselfCheckerTest extends CheckerTestCase {
// int a;
// X;
// }
- public void testNoError_Bug321933() {
+ public void testNoError_Bug321933() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
index 68b0bdc939b..dd40b057efb 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
@@ -35,7 +35,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// case 1:
// }
// }
- public void testEmptyLastCaseBad() {
+ public void testEmptyLastCaseBad() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
@@ -46,7 +46,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// default:
// }
// }
- public void testEmptyLastCaseDefaultBad() {
+ public void testEmptyLastCaseDefaultBad() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
@@ -58,7 +58,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// b = 2;
// }
// }
- public void testLastCaseBad() {
+ public void testLastCaseBad() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(5);
}
@@ -72,7 +72,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testEmptyCaseBad() {
+ public void testEmptyCaseBad() throws Exception {
setEmpty(true);
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
@@ -85,7 +85,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testEmptyLastCaseOKbreak() {
+ public void testEmptyLastCaseOKbreak() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -97,7 +97,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// return;
// }
// }
- public void testEmptyLastCaseWithReturn() {
+ public void testEmptyLastCaseWithReturn() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -109,7 +109,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// continue;
// }
// }
- public void testEmptyLastCaseWithContinue() {
+ public void testEmptyLastCaseWithContinue() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -121,7 +121,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// throw 1;
// }
// }
- public void testEmptyLastCaseWithThrow() {
+ public void testEmptyLastCaseWithThrow() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -134,7 +134,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testLastCaseOKbreak() {
+ public void testLastCaseOKbreak() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -149,7 +149,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testEmptyCaseOKbreak() {
+ public void testEmptyCaseOKbreak() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -161,7 +161,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// /* no break */
// }
// }
- public void testEmptyLastCaseOKcomment() {
+ public void testEmptyLastCaseOKcomment() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -177,7 +177,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testEmptyLastCaseTwoSwitches() {
+ public void testEmptyLastCaseTwoSwitches() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -190,7 +190,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// /* no break */
// }
// }
- public void testLastCaseOKcomment() {
+ public void testLastCaseOKcomment() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -204,7 +204,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// b = 2;
// break;
// }
- public void testEmptyCaseOKcomment() {
+ public void testEmptyCaseOKcomment() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -218,7 +218,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// bye();
// }
// }
- public void testLastCaseBadCommentNotLast() {
+ public void testLastCaseBadCommentNotLast() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -249,7 +249,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// /* fallthrough */
// }
// }
- public void testDifferentComments() {
+ public void testDifferentComments() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(17,23);
}
@@ -307,7 +307,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// default: //err
// }
// }
- public void testGeneral1() {
+ public void testGeneral1() throws Exception {
setEmpty(true);
setLast(true);
loadCodeAndRun(getAboveComment());
@@ -339,7 +339,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// /* no break */
// }
// }
- public void testGeneralComments1() {
+ public void testGeneralComments1() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(9, 14);
}
@@ -375,7 +375,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// /* no break */
// }
// }
- public void testNestedSwitches() {
+ public void testNestedSwitches() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorComments();
}
@@ -387,7 +387,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// b = 2;
// }
// }
- public void testLastCaseIgnore() {
+ public void testLastCaseIgnore() throws Exception {
setLast(false);
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
@@ -406,7 +406,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testEmptyCaseIgnore() {
+ public void testEmptyCaseIgnore() throws Exception {
setEmpty(false);
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
@@ -418,7 +418,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// case 1:
// }
// }
- public void testEmptyLastCaseIgnore() {
+ public void testEmptyLastCaseIgnore() throws Exception {
String code = getAboveComment();
setLast(false);
loadCodeAndRun(code);
@@ -450,7 +450,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// } // err
// }
// }
- public void testEmptyCaseWithLoopBreak() {
+ public void testEmptyCaseWithLoopBreak() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorComments();
}
@@ -466,7 +466,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// }
// }
// }
- public void testCaseWithCurlyBrackets() {
+ public void testCaseWithCurlyBrackets() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrorsOfKind(ER_ID);
}
@@ -479,7 +479,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// case 1:
// }
// }
- public void testEmptyLastCaseError() {
+ public void testEmptyLastCaseError() throws Exception {
String code = getAboveComment();
setLast(true);
setEmpty(false);
@@ -501,7 +501,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testIf() {
+ public void testIf() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkNoErrorsOfKind(ER_ID);
@@ -518,7 +518,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testIfErr() {
+ public void testIfErr() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkErrorLine(7, ER_ID);
@@ -531,7 +531,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// DEFINE_BREAK // No warning here
// }
// }
- public void testBreakInBraces() {
+ public void testBreakInBraces() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkNoErrorsOfKind(ER_ID);
@@ -547,7 +547,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// MY_MACRO(1) // No warning here
// }
// }
- public void testInMacro() {
+ public void testInMacro() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkNoErrorsOfKind(ER_ID);
@@ -558,7 +558,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// default: {
// }
// }
- public void testEmptyCompoundStatement() {
+ public void testEmptyCompoundStatement() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkErrorLine(4, ER_ID);
@@ -572,7 +572,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// break;
// }
// }
- public void testDoubleSemicolon_bug441714() {
+ public void testDoubleSemicolon_bug441714() throws Exception {
String code = getAboveComment();
loadCodeAndRun(code);
checkNoErrorsOfKind(ER_ID);
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CatchByReferenceTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CatchByReferenceTest.java
index 48f047f58de..3a9f82c6e7d 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CatchByReferenceTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CatchByReferenceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 Alena Laskavaia
* 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
@@ -15,7 +15,6 @@ import org.eclipse.cdt.codan.internal.checkers.CatchByReference;
/**
* Test for {@see CatchByReference} class
- *
*/
public class CatchByReferenceTest extends CheckerTestCase {
@Override
@@ -35,43 +34,43 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (int e) {
// }
// }
- public void test_int() {
+ public void test_int() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
- // class C {};
+ // class C {};
// void main() {
// try {
// foo();
// } catch (C e) {
// }
// }
- public void test_class() {
+ public void test_class() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
- // class C {};
+ // class C {};
// void main() {
// try {
// foo();
// } catch (C & e) {
// }
// }
- public void test_class_ref() {
+ public void test_class_ref() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
- // class C {};
+ // class C {};
// void main() {
// try {
// foo();
// } catch (C * e) {
// }
// }
- public void test_class_point() {
+ public void test_class_point() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -83,7 +82,7 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (A e) {
// }
// }
- public void test_int_typedef() {
+ public void test_int_typedef() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -96,7 +95,7 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (B e) {
// }
// }
- public void test_int_typedef2() {
+ public void test_int_typedef2() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -107,7 +106,7 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (C e) {
// }
// }
- public void test_class_unknown() {
+ public void test_class_unknown() throws Exception {
setPreferenceValue(CatchByReference.ER_ID, CatchByReference.PARAM_UNKNOWN_TYPE, false);
loadCodeAndRun(getAboveComment());
checkNoErrors();
@@ -119,7 +118,7 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (C e) {
// }
// }
- public void test_class_unknown_on() {
+ public void test_class_unknown_on() throws Exception {
setPreferenceValue(CatchByReference.ER_ID, CatchByReference.PARAM_UNKNOWN_TYPE, true);
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
@@ -133,7 +132,7 @@ public class CatchByReferenceTest extends CheckerTestCase {
// } catch (B e) {
// }
// }
- public void test_class_typedef() {
+ public void test_class_typedef() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(6);
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
index 08af09e7558..3cc0437ab53 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ClassMembersInitializationCheckerTest.java
@@ -46,7 +46,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int m;
// C() : m(0) {} // No warnings.
// };
- public void testInitializationListShouldBeChecked() {
+ public void testInitializationListShouldBeChecked() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -55,7 +55,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int m;
// C() { m = 0; } // No warnings.
// };
- public void testAssignmentsInConstructorShouldBeChecked() {
+ public void testAssignmentsInConstructorShouldBeChecked() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -70,7 +70,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// long l;
// C() {} // 7 warnings for: m, ui, f, d, b, c, l.
// };
- public void testBasicTypesShouldBeInitialized() {
+ public void testBasicTypesShouldBeInitialized() throws Exception {
loadCodeAndRun(getAboveComment());
checkMultiErrorsOnLine(9, 7);
}
@@ -81,7 +81,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// Value* v;
// C() {} // 2 warnings for: i, v.
// }
- public void testPointersShouldBeInitialized() {
+ public void testPointersShouldBeInitialized() throws Exception {
loadCodeAndRun(getAboveComment());
checkMultiErrorsOnLine(5, 2);
}
@@ -92,7 +92,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// Value& v;
// C() {} // 2 warnings for: i, v.
// }
- public void testReferencesShouldBeInitialized() {
+ public void testReferencesShouldBeInitialized() throws Exception {
loadCodeAndRun(getAboveComment());
checkMultiErrorsOnLine(5, 2);
}
@@ -102,7 +102,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// Enum e;
// C() {} // 1 warning for: e.
// }
- public void testEnumsShouldBeInitialized() {
+ public void testEnumsShouldBeInitialized() throws Exception {
loadCodeAndRun(getAboveComment());
checkMultiErrorsOnLine(4, 1);
}
@@ -122,7 +122,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// ValueTypedef v;
// C() {} // 5 warnings for: i, ip, ir, e.
// }
- public void testTypedefsShouldBeInitialized() {
+ public void testTypedefsShouldBeInitialized() throws Exception {
loadCodeAndRun(getAboveComment());
checkMultiErrorsOnLine(14, 4);
}
@@ -132,7 +132,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C(int) : i2(0) {} // 1 warning for: i1.
// int i1, i2;
// };
- public void testAFewConstructorsHandling() {
+ public void testAFewConstructorsHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(2, 3);
}
@@ -144,7 +144,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// T1 t1;
// T2 t2;
// };
- public void testTemplateClassHandling() {
+ public void testTemplateClassHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -154,7 +154,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C() : i1(0) {} // 1 warning for: i2.
// int i1, i2;
// };
- public void testTemplateConstructorHandling() {
+ public void testTemplateConstructorHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -163,7 +163,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C(); // No warnings.
// int i;
// };
- public void testTemplateConstructorDeclarationOnlyHandling() {
+ public void testTemplateConstructorDeclarationOnlyHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -173,7 +173,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int i1, i2;
// };
// C::C() : i1(0) {} // 1 warning for: i2.
- public void testExternalConstructorHandling() {
+ public void testExternalConstructorHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(5);
}
@@ -187,7 +187,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// };
// template <typename T1, typename T2>
// C<T1,T2>::C() : i1(0), t1(T1()) {} // 1 warning for: i2.
- public void testExternalConstructorOfTemplateClassHandling() {
+ public void testExternalConstructorOfTemplateClassHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(9);
}
@@ -199,7 +199,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// };
// template <typename T>
// C::C() : i1(0) {} // 1 warning for: i2.
- public void testExternalTemplateConstructorHandling() {
+ public void testExternalTemplateConstructorHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -215,7 +215,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// template <typename T1, typename T2>
// template <typename T>
// C<T1,T2>::C() : i1(0), t1(T1()) {} // 1 warning for: i2.
- public void testExternalTemplateConstructorOfTemplateClassHandling() {
+ public void testExternalTemplateConstructorOfTemplateClassHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(11);
}
@@ -228,7 +228,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C() {} // 1 warning for: i.
// int i;
// };
- public void testNestedClassesHandling() {
+ public void testNestedClassesHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6);
}
@@ -243,7 +243,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// }
// int i;
// };
- public void testNestedClassInConstructorHandling() {
+ public void testNestedClassInConstructorHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(2);
}
@@ -260,7 +260,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int i;
// };
// }
- public void testNestedClassInExternalConstructorHandling() {
+ public void testNestedClassInExternalConstructorHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(6);
}
@@ -276,7 +276,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// }
// int i;
// };
- public void testNestedClassWithMethodNamedAsAnotherClassHandling() {
+ public void testNestedClassWithMethodNamedAsAnotherClassHandling() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(2);
}
@@ -286,7 +286,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int someFunction() { i = 0; } // No warnings.
// int i;
// };
- public void testAssignmentIsNotInConstructor() {
+ public void testAssignmentIsNotInConstructor() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(2);
}
@@ -299,7 +299,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// CDerived() : i2(0) {} // No warnings.
// int i2;
// };
- public void testBaseClassMemberShouldNotBeTakenIntoAccount() {
+ public void testBaseClassMemberShouldNotBeTakenIntoAccount() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -311,7 +311,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int C::i1 = 0;
// // NOTE: Static members are always initialized with 0, so there should not be warning on C::i2
// int C::i2;
- public void testNoErrorsOnStaticMembers() {
+ public void testNoErrorsOnStaticMembers() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -321,7 +321,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C(const C& c) = delete;
// int i1, i2;
// };
- public void testNoErrorsOnDeletedConstructor() {
+ public void testNoErrorsOnDeletedConstructor() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -331,7 +331,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C() { func(i); } // No warnings.
// int i;
// };
- public void testNoErrorsOnFunctionCallInitialization() {
+ public void testNoErrorsOnFunctionCallInitialization() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -341,7 +341,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C() { func(i); } // 1 warning for: i.
// int i;
// };
- public void testNoErrorsOnReadingFunctionCall() {
+ public void testNoErrorsOnReadingFunctionCall() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -350,7 +350,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// C() { (i1) = 0; *&i2 = 0; } // No warnings.
// int i1, i2;
// };
- public void testNoErrorsOnComplexAssignment() {
+ public void testNoErrorsOnComplexAssignment() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -363,7 +363,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// }
// int i1, i2, i3;
// };
- public void testNoErrorsOnChainInitialization() {
+ public void testNoErrorsOnChainInitialization() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -374,7 +374,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// a = 1;
// }
// };
- public void testErrorOnProtectedConstructor() {
+ public void testErrorOnProtectedConstructor() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(1);
}
@@ -383,7 +383,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// int i;
// S() {} // 1 warning for: i.
// };
- public void testCheckStructs() {
+ public void testCheckStructs() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -395,7 +395,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// a=0;
// }
// };
- public void testSkipUnions() {
+ public void testSkipUnions() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -403,7 +403,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// class C {
// int c;
// };
- public void testNoErrorsIfThereIsNoConstructorsDefined() {
+ public void testNoErrorsIfThereIsNoConstructorsDefined() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -416,7 +416,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// // else - 'i' will be not initialized
// }
// };
- public void testNoErrorsIfMemberWasInitializedInOneOfTheIfBranch() {
+ public void testNoErrorsIfMemberWasInitializedInOneOfTheIfBranch() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -432,7 +432,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// return a;
// }
// };
- public void testUsingMethodsInConstructorWithPreference() {
+ public void testUsingMethodsInConstructorWithPreference() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
@@ -449,7 +449,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// A(float a) { initializeA3(*this); } // No warnings.
// A(double a) { initializeA3(*(this)); } // No warnings.
// };
- public void testUsingConstMethodsInConstructorWithPreference() {
+ public void testUsingConstMethodsInConstructorWithPreference() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -466,7 +466,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// return a;
// }
// };
- public void testUsingMethodsInConstructorWithoutPreference() {
+ public void testUsingMethodsInConstructorWithoutPreference() throws Exception {
disableSkipConstructorsWithFCalls();
loadCodeAndRun(getAboveComment());
checkErrorLines(3,4);
@@ -484,7 +484,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// A(float a) { initializeA3(*this); } // 1 warning for: a.
// A(double a) { initializeA3(*(this)); } // 1 warning for: a.
// };
- public void testUsingConstMethodsInConstructorWithoutPreference() {
+ public void testUsingConstMethodsInConstructorWithoutPreference() throws Exception {
disableSkipConstructorsWithFCalls();
loadCodeAndRun(getAboveComment());
checkErrorLines(8,9,10,11);
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerLineTests.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerLineTests.java
index b2fe1557964..efbe0a6ec05 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerLineTests.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerLineTests.java
@@ -30,7 +30,7 @@ public class CommentCheckerLineTests extends CheckerTestCase {
// return; // error
// }
@Test
- public void testLineComment() {
+ public void testLineComment() throws Exception {
checkSampleAbove();
}
@@ -38,7 +38,7 @@ public class CommentCheckerLineTests extends CheckerTestCase {
// return;
// }
@Test
- public void testNoLineComment() {
+ public void testNoLineComment() throws Exception {
checkSampleAbove();
}
@@ -46,7 +46,7 @@ public class CommentCheckerLineTests extends CheckerTestCase {
// return "// this is a string";
// }
@Test
- public void testNoLineCommentInString() {
+ public void testNoLineCommentInString() throws Exception {
checkSampleAbove();
}
@@ -54,13 +54,13 @@ public class CommentCheckerLineTests extends CheckerTestCase {
// return; // not an error in c++
// }
@Test
- public void testLineCommentCpp() {
+ public void testLineCommentCpp() throws Exception {
checkSampleAboveCpp();
}
// #define AAA // error even in prepro
@Test
- public void testLineCommentInPrepro() {
+ public void testLineCommentInPrepro() throws Exception {
checkSampleAbove();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerNestedTests.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerNestedTests.java
index a79f59542f9..81782d63c8e 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerNestedTests.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CommentCheckerNestedTests.java
@@ -28,7 +28,7 @@ public class CommentCheckerNestedTests extends CheckerTestCase {
// return; /* /* */ // error
// }
@Test
- public void testLineComment() {
+ public void testLineComment() throws Exception {
checkSampleAbove();
}
// void foo() {
@@ -37,7 +37,7 @@ public class CommentCheckerNestedTests extends CheckerTestCase {
// */
// }
@Test
- public void testLineComment2() {
+ public void testLineComment2() throws Exception {
checkSampleAbove();
}
@@ -45,7 +45,7 @@ public class CommentCheckerNestedTests extends CheckerTestCase {
// return; /* */
// }
@Test
- public void testNoLineComment() {
+ public void testNoLineComment() throws Exception {
checkSampleAbove();
}
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/FormatStringCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/FormatStringCheckerTest.java
index d4313e54c45..cfc8b0bf125 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/FormatStringCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/FormatStringCheckerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Meisam Fathi and others
+ * Copyright (c) 2010, 2011 Meisam Fathi 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
@@ -14,7 +14,6 @@ import org.eclipse.cdt.codan.core.test.CheckerTestCase;
/**
* Test for {@see FormatStringChecker} class
- *
*/
public class FormatStringCheckerTest extends CheckerTestCase {
@Override
@@ -26,7 +25,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// int f(){
// return 0;
// }
- public void testBase() {
+ public void testBase() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -36,7 +35,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// scanf("%s", inputstr); // here
// return 0;
// }
- public void testSimple() {
+ public void testSimple() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -49,7 +48,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testIntRight() {
+ public void testIntRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -62,7 +61,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testIntWrong() {
+ public void testIntWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
@@ -75,7 +74,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testRightInt() {
+ public void testRightInt() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -88,7 +87,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testRightWrong() {
+ public void testRightWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
@@ -101,7 +100,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testWrongInt() {
+ public void testWrongInt() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
@@ -114,7 +113,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testWrongRight() {
+ public void testWrongRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
@@ -126,7 +125,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testInfiniteSize() {
+ public void testInfiniteSize() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
@@ -139,7 +138,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testRight() {
+ public void testRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -152,7 +151,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testRightRight() {
+ public void testRightRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -165,7 +164,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testWrongWrong() {
+ public void testWrongWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(5);
}
@@ -182,7 +181,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testGlobalBeforeWrong() {
+ public void testGlobalBeforeWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(9);
}
@@ -199,7 +198,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// char inputstr[5];
// return 0;
// }
- public void testNonglobalAfterRight() {
+ public void testNonglobalAfterRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -215,7 +214,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// char inputstr[15];
// return 0;
// }
- public void testNonglobalAfterWrong() {
+ public void testNonglobalAfterWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
@@ -231,7 +230,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testNonglobalBeforeRight() {
+ public void testNonglobalBeforeRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -247,7 +246,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testNonglobalBeforeWrong() {
+ public void testNonglobalBeforeWrong() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(8);
}
@@ -260,7 +259,7 @@ public class FormatStringCheckerTest extends CheckerTestCase {
// printf("%d" ,i);
// return 0;
// }
- public void testGaurdedRight() {
+ public void testGaurdedRight() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
index 0f3bf57f068..89629e2f105 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
@@ -34,7 +34,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// virtual void f() = 0;
// virtual ~A(); // ok.
// };
- public void testVirtualDtorInClass() {
+ public void testVirtualDtorInClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -44,7 +44,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// protected:
// ~A(); // ok.
// };
- public void testNonPublicVirtualDtorInClass() {
+ public void testNonPublicVirtualDtorInClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -53,7 +53,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// virtual void f() { };
// ~A(); // warn! public non-virtual dtor.
// };
- public void testPublicVirtualDtorInClass() {
+ public void testPublicVirtualDtorInClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -62,7 +62,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// virtual void f() { };
// // warn! implicit public non-virtual dtor.
// };
- public void testImplicitPublicNonVirtualDtorInClass() {
+ public void testImplicitPublicNonVirtualDtorInClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(1);
}
@@ -75,7 +75,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// friend class F;
// ~A(); // warn! can be called from class F.
// };
- public void testPublicNonVirtualDtorCanBeCalledFromFriendClass() {
+ public void testPublicNonVirtualDtorCanBeCalledFromFriendClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(7);
}
@@ -88,7 +88,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// struct B {
// ~B(); // ok.
// };
- public void testVirtualDtorInBaseClass1() {
+ public void testVirtualDtorInBaseClass1() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -105,7 +105,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// struct D : public B, C { };
//
// struct E : public D { };
- public void testVirtualDtorInBaseClass2() {
+ public void testVirtualDtorInBaseClass2() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -121,7 +121,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// virtual void m();
// friend class C;
// };
- public void testVirtualDtorInBaseClass3() {
+ public void testVirtualDtorInBaseClass3() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -140,7 +140,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
//
// struct E : public D {
// };
- public void testNonVirtualDtorInBaseClass() {
+ public void testNonVirtualDtorInBaseClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3, 7, 11, 13);
}
@@ -155,7 +155,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// virtual void f2() { };
// virtual ~B();
// };
- public void testAbstractBaseClass() {
+ public void testAbstractBaseClass() throws Exception {
loadCodeAndRun(getAboveComment());
// It doesn't matter if the class is abstract or not - dtor can be called polymorphically.
checkErrorLines(1);
@@ -166,7 +166,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// struct Derived : Base {
// virtual void bar();
// };
- public void testImplicitDtorInBaseClass() {
+ public void testImplicitDtorInBaseClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(3);
}
@@ -177,7 +177,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// struct Derived : Base {
// virtual void bar();
// };
- public void testExplicitDtorInBaseClass() {
+ public void testExplicitDtorInBaseClass() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
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 006a4df4812..604fab38cc6 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
@@ -39,7 +39,7 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
// struct X {} x;
// fun(x.y);
// }
- public void testFieldInFunctionCall_338683() {
+ public void testFieldInFunctionCall_338683() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3, ProblemBindingChecker.ERR_ID_FieldResolutionProblem);
}
@@ -51,7 +51,7 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
// void test() {
// A a("hi", 1, 2);
// }
- public void testImplicitConstructorCall_404774() {
+ public void testImplicitConstructorCall_404774() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(6, ProblemBindingChecker.ERR_ID_InvalidArguments);
}
@@ -70,7 +70,7 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
// x.y,
// a.b()))));
// }
- public void testVariousFieldMethodCombinations_338683() {
+ public void testVariousFieldMethodCombinations_338683() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3, ProblemBindingChecker.ERR_ID_MethodResolutionProblem);
checkErrorLine(4, ProblemBindingChecker.ERR_ID_MethodResolutionProblem);
@@ -90,14 +90,14 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
// MACRO(foo());
// return 0;
// }
- public void testDontUnderlineWholeMacro_341089() {
+ public void testDontUnderlineWholeMacro_341089() throws Exception {
loadCodeAndRun(getAboveComment());
IMarker marker = checkErrorLine(3, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem);
- assertFalse(marker.getAttribute(IMarker.MESSAGE, "").contains("MACRO")); //$NON-NLS-1$//$NON-NLS-2$
+ assertFalse(marker.getAttribute(IMarker.MESSAGE, "").contains("MACRO"));
}
// auto d = 42_waldo;
- public void testNonexistentUDLOperator_484619() {
+ public void testNonexistentUDLOperator_484619() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem);
}
@@ -105,7 +105,7 @@ public class ProblemBindingCheckerTest extends CheckerTestCase {
// struct R {};
// R operator "" _waldo(const char*, unsigned long); // expects a string literal
// auto d = 42_waldo; // passing an integer
- public void testUDLOperatorWithWrongType_484619() {
+ public void testUDLOperatorWithWrongType_484619() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3, ProblemBindingChecker.ERR_ID_InvalidArguments);
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
index d2b8e548240..2263ed74a1b 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
@@ -18,7 +18,6 @@ import org.eclipse.cdt.codan.internal.checkers.ReturnChecker;
/**
* Test for {@see ReturnCheckerTest} class
- *
*/
public class ReturnCheckerTest extends CheckerTestCase {
@Override
@@ -26,10 +25,11 @@ public class ReturnCheckerTest extends CheckerTestCase {
super.setUp();
enableProblems(ReturnChecker.RET_NORET_ID,ReturnChecker.RET_ERR_VALUE_ID,ReturnChecker.RET_NO_VALUE_ID);
}
+
// dummy() {
// return; // no error here on line 2
// }
- public void testDummyFunction() {
+ public void testDummyFunction() throws Exception {
checkSampleAbove();
// because return type if not defined, usually people don't care
}
@@ -37,7 +37,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// void void_function(void) {
// return; // no error here
// }
- public void testVoidFunction() {
+ public void testVoidFunction() throws Exception {
checkSampleAbove();
}
@@ -48,7 +48,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// }
// }
// }
- public void testBasicTypeFunction() {
+ public void testBasicTypeFunction() throws Exception {
checkSampleAbove();
}
@@ -60,7 +60,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// struct My_Struct struct_return_function(void) {
// return; // error here on line 6
// }
- public void testUserDefinedFunction() {
+ public void testUserDefinedFunction() throws Exception {
checkSampleAbove();
}
@@ -69,7 +69,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// uint8_t return_typedef(void) {
// return; // error here on line 4
// }
- public void testTypedefReturnFunction() {
+ public void testTypedefReturnFunction() throws Exception {
checkSampleAbove();
}
@@ -80,7 +80,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// {
// return; // error here on line 5
// }
- public void testFunctionPointerReturnFunction() {
+ public void testFunctionPointerReturnFunction() throws Exception {
checkSampleAbove();
}
@@ -92,7 +92,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// }
// };
// }
- public void testInnerFunction_Bug315525() {
+ public void testInnerFunction_Bug315525() throws Exception {
checkSampleAbove();
}
@@ -104,7 +104,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// }
// };
// }
- public void testInnerFunction_Bug316154() {
+ public void testInnerFunction_Bug316154() throws Exception {
checkSampleAbove();
}
@@ -117,7 +117,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// return;
// }
// };
- public void testConstructorRetValue() {
+ public void testConstructorRetValue() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkErrorLine(3, ReturnChecker.RET_ERR_VALUE_ID);
}
@@ -131,7 +131,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// return;
// }
// };
- public void testConstructor_Bug323602() {
+ public void testConstructor_Bug323602() throws Exception {
IProblemPreference macro = getPreference(ReturnChecker.RET_NO_VALUE_ID, ReturnChecker.PARAM_IMPLICIT);
macro.setValue(Boolean.TRUE);
loadCodeAndRunCpp(getAboveComment());
@@ -142,7 +142,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// {
// [](int r){return r;}(5);
// }
- public void testLambda_Bug332285() {
+ public void testLambda_Bug332285() throws Exception {
checkSampleAbove();
}
// void f()
@@ -150,7 +150,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// if ([](int r){return r == 0;}(0))
// ;
// }
- public void testLambda2_Bug332285() {
+ public void testLambda2_Bug332285() throws Exception {
checkSampleAbove();
}
@@ -159,21 +159,21 @@ public class ReturnCheckerTest extends CheckerTestCase {
// int r;
// ({return r;}); // error
// }
- public void testGccExtensions() {
+ public void testGccExtensions() throws Exception {
checkSampleAbove();
}
// auto f() -> void
// {
// }
- public void testVoidLateSpecifiedReturnType_Bug337677() {
+ public void testVoidLateSpecifiedReturnType_Bug337677() throws Exception {
checkSampleAboveCpp();
}
// auto f() -> void* // error
// {
// }
- public void testVoidPointerLateSpecifiedReturnType_Bug337677() {
+ public void testVoidPointerLateSpecifiedReturnType_Bug337677() throws Exception {
checkSampleAboveCpp();
}
@@ -184,7 +184,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// else
// return 0;
// }
- public void testBranches_Bug342906() {
+ public void testBranches_Bug342906() throws Exception {
checkSampleAbove();
}
@@ -195,7 +195,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// case 2:
// return 0;
// }
- public void testSwitch() {
+ public void testSwitch() throws Exception {
checkSampleAbove();
}
@@ -206,7 +206,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// else
// return 0;
//}
- public void testBranches_Bug343767() {
+ public void testBranches_Bug343767() throws Exception {
checkSampleAbove();
}
@@ -218,7 +218,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// return 0;
// foo++;
//}
- public void testBranchesDeadCode_Bug343767() {
+ public void testBranchesDeadCode_Bug343767() throws Exception {
checkSampleAbove();
}
@@ -229,7 +229,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// case 2: return 0;
// }
// }
- public void testBranchesSwitch_Bug343767a() {
+ public void testBranchesSwitch_Bug343767a() throws Exception {
checkSampleAbove();
}
// int f()
@@ -240,7 +240,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// default: return -1;
// }
// }
- public void testBranchesSwitch_Bug343767b() {
+ public void testBranchesSwitch_Bug343767b() throws Exception {
checkSampleAbove();
}
//int bar(int foo)
@@ -251,7 +251,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// if (g()) return 0;
// else return 1;
//}
- public void testBranches2_Bug343767() {
+ public void testBranches2_Bug343767() throws Exception {
checkSampleAbove();
}
//int bar(int foo) // error
@@ -260,7 +260,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// return 0;
// }
//}
- public void testWhile() {
+ public void testWhile() throws Exception {
checkSampleAbove();
}
@@ -269,7 +269,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// return 0;
// }
// }
- public void testNextedBlock_Bug345687() {
+ public void testNextedBlock_Bug345687() throws Exception {
checkSampleAbove();
}
@@ -282,7 +282,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// end:
// return (a);
// }
- public void testGoto_Bug346559() {
+ public void testGoto_Bug346559() throws Exception {
checkSampleAbove();
}
@@ -291,7 +291,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// char c; // added so function body is non-empty
// // no error since return value in main is optional
// }
- public void testMainFunction() {
+ public void testMainFunction() throws Exception {
checkSampleAbove();
}
@@ -299,7 +299,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// std::vector<int> f() {
// return {1,2,3};
// }
- public void testReturnInitializerList() {
+ public void testReturnInitializerList() throws Exception {
checkSampleAbove();
}
@@ -308,7 +308,7 @@ public class ReturnCheckerTest extends CheckerTestCase {
// int test() {
// f();
// }
- public void testNoReturn() {
+ public void testNoReturn() throws Exception {
checkSampleAbove();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnStyleCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnStyleCheckerTest.java
index 860c61fb6cf..a9dc0b0f195 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnStyleCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnStyleCheckerTest.java
@@ -22,7 +22,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// void foo() {
// return; // no error
// }
- public void testSimpleReturn() {
+ public void testSimpleReturn() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -31,7 +31,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// return
// ; // no error
// }
- public void testSimpleReturnMultiLine() {
+ public void testSimpleReturnMultiLine() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -39,7 +39,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// int foo() {
// return(0); // no error
// }
- public void testSimpleReturnValue() {
+ public void testSimpleReturnValue() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -47,7 +47,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// int foo() {
// return 0; // error line 2
// }
- public void testSimpleReturnValueError() {
+ public void testSimpleReturnValueError() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -58,7 +58,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// 0
// );
// }
- public void testReturnValueMultiline() {
+ public void testReturnValueMultiline() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -68,7 +68,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// 0
// ;
// }
- public void testReturnValueMultilineError() {
+ public void testReturnValueMultilineError() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -76,7 +76,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// int foo() {
// return ((0));// no error
// }
- public void testReturnValueMultipleBrackets() {
+ public void testReturnValueMultipleBrackets() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -87,7 +87,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// (0)
// );
// }
- public void testReturnValueMultilineMultipleBrackets() {
+ public void testReturnValueMultilineMultipleBrackets() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -97,7 +97,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// int foo() {
// MY_RETURN // no error
// }
- public void testReturnDefine() {
+ public void testReturnDefine() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -107,7 +107,7 @@ public class ReturnStyleCheckerTest extends CheckerTestCase {
// int foo() {
// MY_RETURN // error line 4
// }
- public void testReturnDefineError() {
+ public void testReturnDefineError() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
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 7448e098aee..bc708395385 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
@@ -11,7 +11,6 @@
package org.eclipse.cdt.codan.core.internal.checkers;
import java.io.File;
-import java.io.IOException;
import org.eclipse.cdt.codan.core.param.IProblemPreference;
import org.eclipse.cdt.codan.core.test.CheckerTestCase;
@@ -20,7 +19,6 @@ import org.eclipse.core.resources.IMarker;
/**
* Test for {@see StatementHasNoEffectChecker} class
- *
*/
public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
@Override
@@ -33,7 +31,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// +a; // error here on line 3
// }
- public void testUnaryExpression() throws IOException {
+ public void testUnaryExpression() throws Exception {
checkSampleAbove();
}
@@ -42,7 +40,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
//
// b+a; // error here on line 4
// }
- public void testBinaryExpression() {
+ public void testBinaryExpression() throws Exception {
checkSampleAbove();
}
@@ -51,7 +49,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
//
// a=b+a; // no error here
// }
- public void testNormalAssignment() {
+ public void testNormalAssignment() throws Exception {
checkSampleAbove();
}
@@ -69,7 +67,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// a%=2;
// a>>=2;
// }
- public void testFalsePositives() {
+ public void testFalsePositives() throws Exception {
checkSampleAbove();
}
@@ -77,7 +75,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// a; // error here on line 3
// }
- public void testIdExpression() {
+ public void testIdExpression() throws Exception {
checkSampleAbove();
}
@@ -85,14 +83,14 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a=({foo();a;}); // no error here on line 2
// char *p=({char s[]="Some string";&s[0];}); // no error here on line 3
// }
- public void testGNUExpressionCompoundStmtFalsePositives() {
+ public void testGNUExpressionCompoundStmtFalsePositives() throws Exception {
checkSampleAbove();
}
// main() {
// int z=({int a=0; +a; a;}) // error here on line 2
// }
- public void testGNUExpressionCompoundStmtInside() {
+ public void testGNUExpressionCompoundStmtInside() throws Exception {
checkSampleAbove();
}
@@ -106,7 +104,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
//
// +a; // error here on line 4
// }
- public void test2FilesUnaryExpression() throws IOException {
+ public void test2FilesUnaryExpression() throws Exception {
/* This test is using two files */
CharSequence[] code = getContents(2);
File f1 = loadcode(code[0].toString());
@@ -119,7 +117,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// main() {
// for (a=b;a;a=a->next);
// }
- public void testForTestExpression() {
+ public void testForTestExpression() throws Exception {
checkSampleAbove();
}
@@ -129,7 +127,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// c z;
// (a = z.foo(1)) || (a = z.foo(2));
// }
- public void testLazyEvalHack() {
+ public void testLazyEvalHack() throws Exception {
checkSampleAboveCpp();
}
@@ -138,7 +136,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
//
// b+=a; // no error here on line 4
// }
- public void testOverloadedBinaryExpression() {
+ public void testOverloadedBinaryExpression() throws Exception {
checkSampleAboveCpp();
}
@@ -147,7 +145,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// FUNC(a); // error by default
// }
- public void testInMacro() {
+ public void testInMacro() throws Exception {
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.TRUE);
checkSampleAbove();
@@ -158,7 +156,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int x;
// FUNC(x); // error
// }
- public void testMessageInMacro() throws IOException {
+ public void testMessageInMacro() throws Exception {
loadCodeAndRun(getAboveComment());
IMarker m = checkErrorLine(4);
assertMessageMatch("'FUNC(x)'", m); //$NON-NLS-1$
@@ -169,7 +167,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// FUNC(a); // no error if macro exp turned off
// }
- public void testInMacroParamOff() {
+ public void testInMacroParamOff() throws Exception {
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.FALSE);
checkSampleAbove();
@@ -179,7 +177,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// +a; // error here on line 3
// }
- public void testMessage() throws IOException {
+ public void testMessage() throws Exception {
loadCodeAndRun(getAboveComment());
IMarker m = checkErrorLine(3);
assertMessageMatch("'\\+a'", m); //$NON-NLS-1$
@@ -193,7 +191,7 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// S s;
// *s;
// }
- public void testOverloadedOperator_bug399146() {
+ public void testOverloadedOperator_bug399146() throws Exception {
checkSampleAboveCpp();
}
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuggestedParenthesisCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuggestedParenthesisCheckerTest.java
index 3eacb41cfa0..4b0c686dd6d 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuggestedParenthesisCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuggestedParenthesisCheckerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 Alena Laskavaia
* 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
@@ -16,14 +16,13 @@ import org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisChecker;
/**
* Test for {@see SuggestedParenthesisChecker} class
- *
*/
public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// main() {
// int a=1,b=3;
// if (!a<10) b=4; // error here on line 3
- // }
- public void test1() {
+ // }
+ public void test1() throws Exception {
IProblemPreference macro = getPreference(SuggestedParenthesisChecker.ER_ID, SuggestedParenthesisChecker.PARAM_NOT);
macro.setValue(Boolean.TRUE);
loadCodeAndRun(getAboveComment());
@@ -32,10 +31,10 @@ public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// main() {
// int a=1,b=3;
- //
+ //
// if (b+a && a>b || b-a) b--; // error here on line 4
// }
- public void test2() {
+ public void test2() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(4);
}
@@ -44,7 +43,7 @@ public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if (!(a<10)) b=4; // no error here on line 3
// }
- public void test3() {
+ public void test3() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -53,7 +52,7 @@ public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if (a && !b) b=4; // no error here on line 3
// }
- public void test_lastnot() {
+ public void test_lastnot() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -62,7 +61,7 @@ public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if ((!a) && 10) b=4; // no error here on line 3
// }
- public void test_fixed() {
+ public void test_fixed() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -71,7 +70,7 @@ public class SuggestedParenthesisCheckerTest extends CheckerTestCase {
// int a=1,b=3;
// if (a && b & a) b=4; // error here on line 3
// }
- public void test_mixedbin() {
+ public void test_mixedbin() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
index 71589532001..a32d9c26539 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
@@ -17,13 +17,13 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
- enableProblems("org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem"); //$NON-NLS-1$
+ enableProblems("org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem");
}
// void foo() {
// if(0);
// }
- public void testIf1() {
+ public void testIf1() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -33,7 +33,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// {
// }
// }
- public void testIf2() {
+ public void testIf2() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -42,7 +42,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// if(0)
// foo();
// }
- public void testIf3() {
+ public void testIf3() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -51,7 +51,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// if(0)
// ;
// }
- public void testIf4() {
+ public void testIf4() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -60,7 +60,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// if(0);{
// }
// }
- public void testIf5() {
+ public void testIf5() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -68,7 +68,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// void foo() {
// if(0) {};
// }
- public void testIf6() {
+ public void testIf6() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -78,7 +78,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// );
// }
// }
- public void testIf7() {
+ public void testIf7() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -88,7 +88,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// ;
// else if(0);
// }
- public void testElseIf1() {
+ public void testElseIf1() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
checkErrorLine(4);
@@ -102,7 +102,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
//
// }
// }
- public void testElseIf2() {
+ public void testElseIf2() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
checkErrorLine(4);
@@ -114,7 +114,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// else if(0);{
// }
// }
- public void testElseIf3() {
+ public void testElseIf3() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
checkErrorLine(4);
@@ -125,7 +125,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// ;
// else if(0){};
// }
- public void testElseIf4() {
+ public void testElseIf4() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
}
@@ -136,7 +136,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// else if(0
// );
// }
- public void testElseIf5() {
+ public void testElseIf5() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
checkErrorLine(5);
@@ -147,7 +147,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// if(0)
// OP;
// }
- public void testMacro() {
+ public void testMacro() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -156,7 +156,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// void foo() {
// MACRO(true);
// }
- public void testMacroExpansion() {
+ public void testMacroExpansion() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -167,7 +167,7 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// else
// ;
// }
- public void testIfElse() {
+ public void testIfElse() throws Exception {
setPreferenceValue(SuspiciousSemicolonChecker.ER_ID, SuspiciousSemicolonChecker.PARAM_ALFTER_ELSE, Boolean.TRUE);
loadCodeAndRun(getAboveComment());
checkErrorLines(3, 5);
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
index 86150c2885f..8dc72bb6c06 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
@@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.internal.checkers;
-import java.io.IOException;
-
import org.eclipse.cdt.codan.core.test.CheckerTestCase;
import org.eclipse.cdt.codan.internal.checkers.UnusedSymbolInFileScopeChecker;
@@ -35,7 +33,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// int test_fun();
// extern int test_efun();
- public void testExternFunction_Declaration_Unused() throws IOException {
+ public void testExternFunction_Declaration_Unused() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
checkErrorLine(2);
@@ -45,14 +43,14 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// test_fun();
// }
- public void testExternFunction_Declaration_Used() throws IOException {
+ public void testExternFunction_Declaration_Used() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// void test_fun();
// void test_fun() {}
- public void testExternFunction_Declaration_FollowedByDefinition() throws IOException {
+ public void testExternFunction_Declaration_FollowedByDefinition() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -62,7 +60,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
////////////////////////////////////////////////////////////////////////////
// void test_fun(void) {}
- public void testExternFunction_Definition() throws IOException {
+ public void testExternFunction_Definition() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -72,14 +70,14 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
////////////////////////////////////////////////////////////////////////////
// static void test_fun(void);
- public void testStaticFunction_Declaration_Unused() throws IOException {
+ public void testStaticFunction_Declaration_Unused() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static void test_fun(void);
// static void test_fun(void) {}
- public void testStaticFunction_Declaration_FollowedByDefinition() throws IOException {
+ public void testStaticFunction_Declaration_FollowedByDefinition() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -88,7 +86,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// test_fun();
// }
- public void testStaticFunction_Declaration_Used() throws IOException {
+ public void testStaticFunction_Declaration_Used() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
@@ -98,14 +96,14 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
////////////////////////////////////////////////////////////////////////////
// static void test_fun(void) {}
- public void testStaticFunction_Definition_Unused() throws IOException {
+ public void testStaticFunction_Definition_Unused() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static void test_fun(void);
// static void test_fun(void) {}
- public void testStaticFunction_Definition_Unused_WithDeclaration() throws IOException {
+ public void testStaticFunction_Definition_Unused_WithDeclaration() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(2);
}
@@ -114,7 +112,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// test_fun();
// }
- public void testStaticFunction_Definition_Used() throws IOException {
+ public void testStaticFunction_Definition_Used() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -123,7 +121,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// test_fun();
// }
// static int test_fun(void) {}
- public void testStaticFunction_Definition_UsedBeforeDefinition() throws IOException {
+ public void testStaticFunction_Definition_UsedBeforeDefinition() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -133,7 +131,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// test_fun(0);
// }
- public void testStaticFunction_Definition_Signature() throws IOException {
+ public void testStaticFunction_Definition_Signature() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkErrorLine(1);
}
@@ -142,7 +140,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// int test_fun=0;
// }
- public void testStaticFunction_Definition_SynonymLocalScope() throws IOException {
+ public void testStaticFunction_Definition_SynonymLocalScope() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
@@ -150,20 +148,20 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// static int test_fun(void) {}
// void fun(int test_fun) {
// }
- public void testStaticFunction_Definition_SynonymArgs() throws IOException {
+ public void testStaticFunction_Definition_SynonymArgs() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static int (test_fun) ();
- public void testStaticFunction_Definition_InParentheses() throws IOException {
+ public void testStaticFunction_Definition_InParentheses() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static int test_fun(int i) {}
// int i = test_fun(X);
- public void testStaticFunction_Definition_UnknownParameterType() throws IOException {
+ public void testStaticFunction_Definition_UnknownParameterType() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
@@ -172,14 +170,14 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void Class::fun() {
// test_fun();
// }
- public void testStaticFunction_Definition_InQualifiedFunction() throws IOException {
+ public void testStaticFunction_Definition_InQualifiedFunction() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// static int test_fun(X) {}
// int i = test_fun(X);
- public void testStaticFunction_Definition_UnknownArgumentType() throws IOException {
+ public void testStaticFunction_Definition_UnknownArgumentType() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
@@ -189,7 +187,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
////////////////////////////////////////////////////////////////////////////
// extern int test_var;
- public void testExternVariable_Declaration_Unused() throws IOException {
+ public void testExternVariable_Declaration_Unused() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
@@ -198,14 +196,14 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// test_var=0;
// }
- public void testExternVariable_Declaration_Used() throws IOException {
+ public void testExternVariable_Declaration_Used() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// extern int i,
// test_var;
- public void testExternVariable_Declaration_Combined() throws IOException {
+ public void testExternVariable_Declaration_Combined() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
checkErrorLine(2);
@@ -217,20 +215,20 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// int test_var;
// int test_var2=0;
- public void testGlobalVariable_Definition() throws IOException {
+ public void testGlobalVariable_Definition() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// extern const int test_var=0; // not quite legal but some compilers allow that
- public void testExternVariable_Definition1() throws IOException {
+ public void testExternVariable_Definition1() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// extern const int test_var;
// const int test_var = 0;
- public void testExternVariable_Definition2() throws IOException {
+ public void testExternVariable_Definition2() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -240,20 +238,20 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
////////////////////////////////////////////////////////////////////////////
// static int test_var;
- public void testStaticVariable_Unused() throws IOException {
+ public void testStaticVariable_Unused() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static int (*test_var)(float, char, char);
- public void testStaticVariable_Unused_FunctionPointer() throws IOException {
+ public void testStaticVariable_Unused_FunctionPointer() throws Exception {
loadCodeAndRun(getAboveComment());
checkErrorLine(1);
}
// static int test_var;
// int i=test_var;
- public void testStaticVariable_Used_GlobalScope() throws IOException {
+ public void testStaticVariable_Used_GlobalScope() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -262,7 +260,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void fun() {
// int i=test_var;
// }
- public void testStaticVariable_Used_LocalScope() throws IOException {
+ public void testStaticVariable_Used_LocalScope() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -271,38 +269,38 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// void Class::fun() {
// test_var = 0;
// }
- public void testStaticVariable_Used_InQualifiedFunction() throws IOException {
+ public void testStaticVariable_Used_InQualifiedFunction() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// class Class;
// static Class test_var; // constructor is called here
- public void testStaticVariable_Used_Constructor() throws IOException {
+ public void testStaticVariable_Used_Constructor() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// static X test_var; // avoid possible false positive, binding checker would complain anyway
- public void testExternVariable_Declaration_IgnoreUnresolved() throws IOException {
+ public void testExternVariable_Declaration_IgnoreUnresolved() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// static char* test_var="$Id: UnusedSymbolInFileScopeCheckerTest.java,v 1.2 2011/04/29 11:17:42 agvozdev Exp $";
- public void testExternVariable_Declaration_CvsIdent() throws IOException {
+ public void testExternVariable_Declaration_CvsIdent() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// static char* test_var="@(#) $Header: /cvsroot/tools/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java,v 1.2 2011/04/29 11:17:42 agvozdev Exp $";
- public void testExternVariable_Declaration_SccsIdent() throws IOException {
+ public void testExternVariable_Declaration_SccsIdent() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// static char test_var[]("@(#) $Id: UnusedSymbolInFileScopeCheckerTest.java,v 1.2 2011/04/29 11:17:42 agvozdev Exp $");
- public void testExternVariable_Declaration_CvsIdentInitializer() throws IOException {
+ public void testExternVariable_Declaration_CvsIdentInitializer() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
@@ -313,7 +311,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// static void f3() __attribute__((unused));
// static void f4() __attribute__((unused));
// static void f4() __attribute__((unused)) {}
- public void testAttributeUnused() throws IOException {
+ public void testAttributeUnused() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -323,7 +321,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// int main() {
// asm ("lds r26, pxCurrentTCB\n\t");
// }
- public void testUseInAsm_bug393129() throws IOException {
+ public void testUseInAsm_bug393129() throws Exception {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
@@ -339,7 +337,7 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
// int main() {
// bar(0);
// }
- public void testOverloadedStaticFunctionUsedInTemplate_bug358694() throws IOException {
+ public void testOverloadedStaticFunctionUsedInTemplate_bug358694() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/BasicProblemPreferenceTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/BasicProblemPreferenceTest.java
index b06e9a088a3..bd94d48c041 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/BasicProblemPreferenceTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/BasicProblemPreferenceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009,2010 Alena Laskavaia
+ * Copyright (c) 2009,2010 Alena Laskavaia
* 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
@@ -12,21 +12,21 @@ package org.eclipse.cdt.codan.core.param;
import java.io.File;
-import junit.framework.TestCase;
-
import org.eclipse.cdt.codan.core.param.IProblemPreferenceDescriptor.PreferenceType;
+import junit.framework.TestCase;
+
/**
* Test for BasicProblemPreference
*/
public class BasicProblemPreferenceTest extends TestCase {
- private static final String TEST_STR = "aaa"; //$NON-NLS-1$
+ private static final String TEST_STR = "aaa";
BasicProblemPreference pref;
- String key = "xxx"; //$NON-NLS-1$
+ String key = "xxx";
@Override
protected void setUp() throws Exception {
- pref = new BasicProblemPreference(key, "My Value"); //$NON-NLS-1$
+ pref = new BasicProblemPreference(key, "My Value");
}
public void testIntegerExportValue() {
@@ -38,7 +38,7 @@ public class BasicProblemPreferenceTest extends TestCase {
public void testIntegerImportValue() {
pref.setType(PreferenceType.TYPE_INTEGER);
- pref.importValue("22"); //$NON-NLS-1$
+ pref.importValue("22");
assertEquals(22, pref.getValue());
}
@@ -59,14 +59,14 @@ public class BasicProblemPreferenceTest extends TestCase {
pref.setType(PreferenceType.TYPE_BOOLEAN);
pref.setValue(Boolean.TRUE);
String value = pref.exportValue();
- assertEquals("true", value); //$NON-NLS-1$
+ assertEquals("true", value);
pref.importValue(TEST_STR);
assertEquals(Boolean.FALSE, pref.getValue());
}
public void testFileImportValue() {
pref.setType(PreferenceType.TYPE_FILE);
- File file = new File("file.c"); //$NON-NLS-1$
+ File file = new File("file.c");
pref.setValue(file);
String value = pref.exportValue();
assertEquals(file.getName(), value);
@@ -77,7 +77,7 @@ public class BasicProblemPreferenceTest extends TestCase {
public void testBadKey() {
try {
pref.setKey(null);
- fail("Should be exception"); //$NON-NLS-1$
+ fail("Should be exception");
} catch (Exception e) {
assertTrue(true);
}
@@ -86,7 +86,7 @@ public class BasicProblemPreferenceTest extends TestCase {
public void testBadType() {
try {
pref.setType(null);
- fail("Should be exception"); //$NON-NLS-1$
+ fail("Should be exception");
} catch (Exception e) {
assertTrue(true);
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/ListProblemPreferenceTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/ListProblemPreferenceTest.java
index bb2ecc504fd..095a643e3a0 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/ListProblemPreferenceTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/ListProblemPreferenceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009,2010 Alena Laskavaia
+ * Copyright (c) 2009,2010 Alena Laskavaia
* 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
@@ -12,24 +12,24 @@ package org.eclipse.cdt.codan.core.param;
import java.util.Arrays;
-import junit.framework.TestCase;
-
import org.eclipse.cdt.codan.core.param.IProblemPreferenceDescriptor.PreferenceType;
+import junit.framework.TestCase;
+
/**
* Test for BasicProblemPreference
*/
public class ListProblemPreferenceTest extends TestCase {
- private static final String PAR1 = "0"; //$NON-NLS-1$
- private static final String PAR2 = "1"; //$NON-NLS-1$
+ private static final String PAR1 = "0";
+ private static final String PAR2 = "1";
private ListProblemPreference list;
- private String key = "list"; //$NON-NLS-1$
+ private String key = "list";
private ListProblemPreference list2;
@Override
protected void setUp() throws Exception {
- list = new ListProblemPreference(key, "My Value"); //$NON-NLS-1$
- list2 = new ListProblemPreference(key, "My Value2"); //$NON-NLS-1$
+ list = new ListProblemPreference(key, "My Value");
+ list2 = new ListProblemPreference(key, "My Value2");
}
/**
@@ -57,22 +57,22 @@ public class ListProblemPreferenceTest extends TestCase {
}
public void testExportValueStr() {
- BasicProblemPreference str = addPar(PAR1, "42.5"); //$NON-NLS-1$
+ BasicProblemPreference str = addPar(PAR1, "42.5");
String value = list.exportValue();
- assertEquals("(42.5)", value); //$NON-NLS-1$
+ assertEquals("(42.5)", value);
}
public void testImportValue() {
- addPar(PAR1, "xxx"); //$NON-NLS-1$
+ addPar(PAR1, "xxx");
String value = list.exportValue();
BasicProblemPreference str2 = new BasicProblemPreference(PAR1, PAR1);
list2.addChildDescriptor(str2);
list2.importValue(value);
- assertEquals("xxx", list2.getChildValue(PAR1)); //$NON-NLS-1$
+ assertEquals("xxx", list2.getChildValue(PAR1));
}
public void testImportValueSpec() {
- BasicProblemPreference str = addPar(PAR1, "a=b"); //$NON-NLS-1$
+ BasicProblemPreference str = addPar(PAR1, "a=b");
String value = list.exportValue();
BasicProblemPreference str2 = new BasicProblemPreference(PAR1, PAR1);
list2.addChildDescriptor(str2);
@@ -81,31 +81,31 @@ public class ListProblemPreferenceTest extends TestCase {
}
public void testImportValue2() {
- addPar(PAR1, "a=b"); //$NON-NLS-1$
- BasicProblemPreference p2 = addPar(PAR2, "2,\"2"); //$NON-NLS-1$
+ addPar(PAR1, "a=b");
+ BasicProblemPreference p2 = addPar(PAR2, "2,\"2");
String value = list.exportValue();
- list = new ListProblemPreference(key, "My Value"); //$NON-NLS-1$
+ list = new ListProblemPreference(key, "My Value");
addPar(PAR1, null);
addPar(PAR2, null);
list.importValue(value);
- assertEquals("a=b", list.getChildValue(PAR1)); //$NON-NLS-1$
+ assertEquals("a=b", list.getChildValue(PAR1));
assertEquals(p2.getValue(), list.getChildValue(PAR2));
}
public void testImportValue2_nosec() {
- addPar(PAR1, "a=b"); //$NON-NLS-1$
- BasicProblemPreference p2 = addPar(PAR2, "2' 2\""); //$NON-NLS-1$
+ addPar(PAR1, "a=b");
+ BasicProblemPreference p2 = addPar(PAR2, "2' 2\"");
String value = list.exportValue();
- list = new ListProblemPreference(key, "My Value"); //$NON-NLS-1$
+ list = new ListProblemPreference(key, "My Value");
addPar(PAR1, null);
list.importValue(value);
- assertEquals("a=b", list.getChildValue(PAR1)); //$NON-NLS-1$
+ assertEquals("a=b", list.getChildValue(PAR1));
assertEquals(p2.getValue(), list.getChildValue(PAR2));
}
public void testGetValue() {
- list.setChildDescriptor(new BasicProblemPreference("#", "Value")); //$NON-NLS-1$//$NON-NLS-2$
- String x[] = { "a", "b" }; //$NON-NLS-1$ //$NON-NLS-2$
+ list.setChildDescriptor(new BasicProblemPreference("#", "Value"));
+ String x[] = { "a", "b" };
list.addChildValue(x[0]);
list.addChildValue(x[1]);
Object[] values = list.getValues();
@@ -113,20 +113,20 @@ public class ListProblemPreferenceTest extends TestCase {
}
public void testSetValue() {
- list.setChildDescriptor(new BasicProblemPreference("#", "Value")); //$NON-NLS-1$//$NON-NLS-2$
- String x[] = { "a", "b" }; //$NON-NLS-1$ //$NON-NLS-2$
+ list.setChildDescriptor(new BasicProblemPreference("#", "Value"));
+ String x[] = { "a", "b" };
list.setValue(x);
Object[] values = list.getValues();
assertTrue(Arrays.deepEquals(x, values));
}
public void testSetValueImport() {
- list.setChildDescriptor(new BasicProblemPreference("#", "Value")); //$NON-NLS-1$//$NON-NLS-2$
- String x[] = { "a", "b" }; //$NON-NLS-1$ //$NON-NLS-2$
+ list.setChildDescriptor(new BasicProblemPreference("#", "Value"));
+ String x[] = { "a", "b" };
list.setValue(x);
- list.importValue("(x)"); //$NON-NLS-1$
+ list.importValue("(x)");
Object[] values = list.getValues();
assertEquals(1, values.length);
- assertEquals("x", values[0]); //$NON-NLS-1$
+ assertEquals("x", values[0]);
}
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/MapProblemPreferenceTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/MapProblemPreferenceTest.java
index c0f72b9ca15..e0abcb169c3 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/MapProblemPreferenceTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/param/MapProblemPreferenceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009,2010 Alena Laskavaia
+ * Copyright (c) 2009,2010 Alena Laskavaia
* 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,24 +10,24 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.param;
-import junit.framework.TestCase;
-
import org.eclipse.cdt.codan.core.param.IProblemPreferenceDescriptor.PreferenceType;
+import junit.framework.TestCase;
+
/**
* Test for BasicProblemPreference
*/
public class MapProblemPreferenceTest extends TestCase {
- private static final String PAR1 = "aaa"; //$NON-NLS-1$
- private static final String PAR2 = "bbb"; //$NON-NLS-1$
+ private static final String PAR1 = "aaa";
+ private static final String PAR2 = "bbb";
private MapProblemPreference map;
- private String key = "map"; //$NON-NLS-1$
+ private String key = "map";
private MapProblemPreference map2;
@Override
protected void setUp() throws Exception {
- map = new MapProblemPreference(key, "My Value"); //$NON-NLS-1$
- map2 = new MapProblemPreference(key, "My Value2"); //$NON-NLS-1$
+ map = new MapProblemPreference(key, "My Value");
+ map2 = new MapProblemPreference(key, "My Value2");
}
/**
@@ -55,22 +55,22 @@ public class MapProblemPreferenceTest extends TestCase {
}
public void testExportValueStr() {
- BasicProblemPreference str = addPar(PAR1, "42.5"); //$NON-NLS-1$
+ BasicProblemPreference str = addPar(PAR1, "42.5");
String value = map.exportValue();
- assertEquals("{" + str.getKey() + "=>42.5}", value); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("{" + str.getKey() + "=>42.5}", value);
}
public void testImportValue() {
- addPar(PAR1, "xxx"); //$NON-NLS-1$
+ addPar(PAR1, "xxx");
String value = map.exportValue();
BasicProblemPreference str2 = new BasicProblemPreference(PAR1, PAR1);
map2.addChildDescriptor(str2);
map2.importValue(value);
- assertEquals("xxx", map2.getChildValue(PAR1)); //$NON-NLS-1$
+ assertEquals("xxx", map2.getChildValue(PAR1));
}
public void testImportValueSpec() {
- BasicProblemPreference str = addPar(PAR1, "a=b"); //$NON-NLS-1$
+ BasicProblemPreference str = addPar(PAR1, "a=b");
String value = map.exportValue();
BasicProblemPreference str2 = new BasicProblemPreference(PAR1, PAR1);
map2.addChildDescriptor(str2);
@@ -79,14 +79,14 @@ public class MapProblemPreferenceTest extends TestCase {
}
public void testImportValue2() {
- addPar(PAR1, "a=b"); //$NON-NLS-1$
- BasicProblemPreference p2 = addPar(PAR2, "2,\"2"); //$NON-NLS-1$
+ addPar(PAR1, "a=b");
+ BasicProblemPreference p2 = addPar(PAR2, "2,\"2");
String value = map.exportValue();
- map = new MapProblemPreference(key, "My Value"); //$NON-NLS-1$
+ map = new MapProblemPreference(key, "My Value");
addPar(PAR1, null);
addPar(PAR2, null);
map.importValue(value);
- assertEquals("a=b", map.getChildValue(PAR1)); //$NON-NLS-1$
+ assertEquals("a=b", map.getChildValue(PAR1));
assertEquals(p2.getValue(), map.getChildValue(PAR2));
}
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java
index 0cf81ba4375..e4c2772449c 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CheckerTestCase.java
@@ -154,12 +154,12 @@ public class CheckerTestCase extends CodanTestCase {
runCodan();
}
- public void loadCodeAndRun(String code) {
+ public void loadCodeAndRun(String code) throws CoreException {
loadcode(code);
runCodan();
}
- public void loadCodeAndRunCpp(String code) {
+ public void loadCodeAndRunCpp(String code) throws CoreException {
loadcode(code, true);
runCodan();
}
@@ -249,12 +249,12 @@ public class CheckerTestCase extends CodanTestCase {
CodanRuntime.getInstance().getCheckersRegistry().updateProfile(cproject.getProject(), profile);
}
- protected void checkSampleAbove() {
+ protected void checkSampleAbove() throws CoreException {
loadCodeAndRun(getAboveComment());
checkErrorComments();
}
- protected void checkSampleAboveCpp() {
+ protected void checkSampleAboveCpp() throws CoreException {
loadCodeAndRunCpp(getAboveComment());
checkErrorComments();
}
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanTestCase.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanTestCase.java
index b28db6dd352..d5b9b5ab799 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanTestCase.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanTestCase.java
@@ -195,7 +195,7 @@ public class CodanTestCase extends BaseTestCase {
return plugin;
}
- public File loadcode(String code, boolean cpp) {
+ public File loadcode(String code, boolean cpp) throws CoreException {
String fileKey = "@file:";
int indf = code.indexOf(fileKey);
if (indf >= 0) {
@@ -218,19 +218,15 @@ public class CodanTestCase extends BaseTestCase {
return loadcode(code, testFile);
}
- private File loadcode(String code, File testFile) {
+ private File loadcode(String code, File testFile) throws CoreException {
try {
tempFiles.add(testFile);
- String trim = code.trim();
- loadErrorComments(trim);
- TestUtils.saveFile(new ByteArrayInputStream(trim.getBytes()), testFile);
+ loadErrorComments(code);
+ TestUtils.saveFile(new ByteArrayInputStream(code.getBytes()), testFile);
currentFile = testFile;
try {
cproject.getProject().refreshLocal(1, null);
waitForIndexer(cproject);
- } catch (CoreException e) {
- // hmm
- fail(e.getMessage());
} catch (InterruptedException e) {
}
currentCElem = cproject.findElement(new Path(currentFile.toString()));
@@ -256,19 +252,19 @@ public class CodanTestCase extends BaseTestCase {
}
}
- public File loadcode_c(String code) {
+ public File loadcode_c(String code) throws CoreException {
return loadcode(code, true);
}
- public File loadcode_cpp(String code) {
+ public File loadcode_cpp(String code) throws CoreException {
return loadcode(code, false);
}
- public File loadcode(String code) {
+ public File loadcode(String code) throws CoreException {
return loadcode(code, isCpp());
}
- public File loadcode(CharSequence... more) {
+ public File loadcode(CharSequence... more) throws CoreException {
File file = null;
for (CharSequence cseq : more) {
file = loadcode(cseq.toString(), isCpp());
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/AssignmentInConditionQuickFixTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/AssignmentInConditionQuickFixTest.java
index 3dfb63106ae..092764fdf8f 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/AssignmentInConditionQuickFixTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/AssignmentInConditionQuickFixTest.java
@@ -12,7 +12,6 @@ package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
-@SuppressWarnings("nls")
public class AssignmentInConditionQuickFixTest extends QuickFixTestCase {
@SuppressWarnings("restriction")
@Override
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CaseBreakQuickFixTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CaseBreakQuickFixTest.java
index 14f03f89ddb..bafe92bc2ae 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CaseBreakQuickFixTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/CaseBreakQuickFixTest.java
@@ -12,7 +12,6 @@ package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
-@SuppressWarnings("nls")
public class CaseBreakQuickFixTest extends QuickFixTestCase {
@SuppressWarnings("restriction")
@Override

Back to the top