mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fixed warnings.
This commit is contained in:
parent
37d2f3e93b
commit
44a3a89caa
2 changed files with 10 additions and 11 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -16,12 +16,13 @@ import org.eclipse.core.resources.IMarker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for {@see AssignmentInConditionChecker} class
|
* Test for {@see AssignmentInConditionChecker} class
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class AssignmentInConditionCheckerTest extends CheckerTestCase {
|
public class AssignmentInConditionCheckerTest extends CheckerTestCase {
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.codan.core.test.CodanTestCase#setUp()
|
* @see org.eclipse.cdt.codan.core.test.CodanTestCase#setUp()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,7 +34,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
|
||||||
// main() {
|
// main() {
|
||||||
// int a=1,b=3;
|
// int a=1,b=3;
|
||||||
// if (a=b) b=4; // error here on line 3
|
// if (a=b) b=4; // error here on line 3
|
||||||
// }
|
// }
|
||||||
public void test_basic() {
|
public void test_basic() {
|
||||||
loadCodeAndRun(getAboveComment());
|
loadCodeAndRun(getAboveComment());
|
||||||
checkErrorLine(3);
|
checkErrorLine(3);
|
||||||
|
@ -41,7 +42,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
|
||||||
|
|
||||||
// main() {
|
// main() {
|
||||||
// int a=1,b=3;
|
// int a=1,b=3;
|
||||||
//
|
//
|
||||||
// if ((a=b)) b--; // no error
|
// if ((a=b)) b--; // no error
|
||||||
// }
|
// }
|
||||||
public void test_fixed() {
|
public void test_fixed() {
|
||||||
|
@ -99,7 +100,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
|
||||||
// main() {
|
// main() {
|
||||||
// int a=1,b=3;
|
// int a=1,b=3;
|
||||||
// if (a=b) b=4; // error here on line 3
|
// if (a=b) b=4; // error here on line 3
|
||||||
// }
|
// }
|
||||||
public void test_basic_params() {
|
public void test_basic_params() {
|
||||||
loadCodeAndRun(getAboveComment());
|
loadCodeAndRun(getAboveComment());
|
||||||
IMarker marker = checkErrorLine(3);
|
IMarker marker = checkErrorLine(3);
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -20,7 +20,7 @@ import org.eclipse.core.resources.IMarker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for {@see StatementHasNoEffectChecker} class
|
* Test for {@see StatementHasNoEffectChecker} class
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
|
public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
|
||||||
@Override
|
@Override
|
||||||
|
@ -147,9 +147,8 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
|
||||||
//#define FUNC(a) a
|
//#define FUNC(a) a
|
||||||
// main() {
|
// main() {
|
||||||
// int a;
|
// int a;
|
||||||
// FUNC(a); // error by default
|
// FUNC(a); // error by default
|
||||||
// }
|
// }
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
public void testInMacro() {
|
public void testInMacro() {
|
||||||
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
|
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
|
||||||
macro.setValue(Boolean.TRUE);
|
macro.setValue(Boolean.TRUE);
|
||||||
|
@ -173,7 +172,6 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
|
||||||
// int a;
|
// int a;
|
||||||
// FUNC(a); // no error if macro exp turned off
|
// FUNC(a); // no error if macro exp turned off
|
||||||
// }
|
// }
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
public void testInMacroParamOff() {
|
public void testInMacroParamOff() {
|
||||||
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
|
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
|
||||||
macro.setValue(Boolean.FALSE);
|
macro.setValue(Boolean.FALSE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue