mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Fixed tests to pass on M6 & M7.
Inclusions were not being found as path info was incorrect.
This commit is contained in:
parent
5fe505bacb
commit
0fbb671b39
2 changed files with 6 additions and 3 deletions
|
@ -32,7 +32,6 @@ import org.eclipse.cdt.internal.core.search.matching.OrPattern;
|
||||||
import org.eclipse.cdt.testplugin.CTestPlugin;
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.core.search.tests;
|
package org.eclipse.cdt.core.search.tests;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ public class ParseTestOnSearchFiles extends TestCase
|
||||||
{
|
{
|
||||||
private FileInputStream fileIn;
|
private FileInputStream fileIn;
|
||||||
private String name;
|
private String name;
|
||||||
|
private String fullPathName;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -52,13 +54,15 @@ public class ParseTestOnSearchFiles extends TestCase
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
name = "resources/search/classDecl.cpp";
|
name = "resources/search/classDecl.cpp";
|
||||||
fileIn = new FileInputStream(CTestPlugin.getDefault().getFileInPlugin(new Path(name)));
|
File f = CTestPlugin.getDefault().getFileInPlugin(new Path(name));
|
||||||
|
fullPathName = f.getAbsolutePath();
|
||||||
|
fileIn = new FileInputStream(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testParseOfAndrewsFile() throws Exception
|
public void testParseOfAndrewsFile() throws Exception
|
||||||
{
|
{
|
||||||
ISourceElementRequestor requestor = new NullSourceElementRequestor();
|
ISourceElementRequestor requestor = new NullSourceElementRequestor();
|
||||||
IScanner scanner = ParserFactory.createScanner( new InputStreamReader( fileIn ), name, new ScannerInfo(), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, requestor, new NullLogService() );
|
IScanner scanner = ParserFactory.createScanner( new InputStreamReader( fileIn ), fullPathName, new ScannerInfo(), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, requestor, new NullLogService() );
|
||||||
IParser parser = ParserFactory.createParser( scanner, requestor, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null );
|
IParser parser = ParserFactory.createParser( scanner, requestor, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null );
|
||||||
assertTrue( parser.parse() );
|
assertTrue( parser.parse() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue