1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Fixed warnings.

This commit is contained in:
Sergey Prigogin 2011-04-26 03:37:18 +00:00
parent 37d2f3e93b
commit 44a3a89caa
2 changed files with 10 additions and 11 deletions

View file

@ -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
@ -16,12 +16,13 @@ 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
@ -33,7 +34,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// main() {
// int a=1,b=3;
// if (a=b) b=4; // error here on line 3
// }
// }
public void test_basic() {
loadCodeAndRun(getAboveComment());
checkErrorLine(3);
@ -41,7 +42,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// main() {
// int a=1,b=3;
//
//
// if ((a=b)) b--; // no error
// }
public void test_fixed() {
@ -99,7 +100,7 @@ public class AssignmentInConditionCheckerTest extends CheckerTestCase {
// main() {
// int a=1,b=3;
// if (a=b) b=4; // error here on line 3
// }
// }
public void test_basic_params() {
loadCodeAndRun(getAboveComment());
IMarker marker = checkErrorLine(3);

View file

@ -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
@ -20,7 +20,7 @@ import org.eclipse.core.resources.IMarker;
/**
* Test for {@see StatementHasNoEffectChecker} class
*
*
*/
public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
@Override
@ -147,9 +147,8 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
//#define FUNC(a) a
// main() {
// int a;
// FUNC(a); // error by default
// FUNC(a); // error by default
// }
@SuppressWarnings("restriction")
public void testInMacro() {
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.TRUE);
@ -173,7 +172,6 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// int a;
// FUNC(a); // no error if macro exp turned off
// }
@SuppressWarnings("restriction")
public void testInMacroParamOff() {
IProblemPreference macro = getPreference(StatementHasNoEffectChecker.ER_ID, StatementHasNoEffectChecker.PARAM_MACRO_ID);
macro.setValue(Boolean.FALSE);