From 75b8d4657204ca1d40d03b5708f0c41d0cc661ce Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 14 Nov 2007 12:11:17 +0000 Subject: [PATCH] Testcase for 122891, macros in include directive. --- .../tests/scanner/PreprocessorBugsTests.java | 36 +++++++++++++++++++ .../tests/scanner/ScannerTestSuite.java | 1 + 2 files changed, 37 insertions(+) create mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorBugsTests.java diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorBugsTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorBugsTests.java new file mode 100644 index 00000000000..f15a336fef9 --- /dev/null +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorBugsTests.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 IBM Corporation 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM - Initial API and implementation + * Markus Schorn (Wind River Systems) + *******************************************************************************/ +package org.eclipse.cdt.core.parser.tests.scanner; + +import junit.framework.TestSuite; + +import org.eclipse.cdt.core.parser.IProblem; + + +/** + * Scanner2Tests ported to use the CPreprocessor + */ +public class PreprocessorBugsTests extends PreprocessorTestsBase { + + public static TestSuite suite() { + return suite(PreprocessorBugsTests.class); + } + + // #define NOP(x) x + // #define CPUINC(cpu) + // #include CPUINC(xag4) + public void testMacroInInclusion_Bug122891() throws Exception { + initializeScanner(); + validateEOF(); + validateProblem(0, IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND, "regxag4.sfr"); + } +} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java index 8feba5800be..99a33ff4c73 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java @@ -21,6 +21,7 @@ public class ScannerTestSuite extends TestSuite { suite.addTest(LocationMapTests.suite()); suite.addTest(PortedScannerTests.suite()); suite.addTest(PreprocessorTests.suite()); + suite.addTest(PreprocessorBugsTests.suite()); return suite; } }