Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2004-06-04 17:01:48 -0400
committerDoug Schaefer2004-06-04 17:01:48 -0400
commita206e32d2a667de93cdecff1ae387503e76a755a (patch)
tree3440a2f8dee25e0e90ada03ea71503869a8235f4 /build/org.eclipse.cdt.managedbuilder.core.tests
parent98800badf41d15b2ca0fc2860c3e7b21103c59e6 (diff)
downloadorg.eclipse.cdt-a206e32d2a667de93cdecff1ae387503e76a755a.tar.gz
org.eclipse.cdt-a206e32d2a667de93cdecff1ae387503e76a755a.tar.xz
org.eclipse.cdt-a206e32d2a667de93cdecff1ae387503e76a755a.zip
Changed the interface to the Scanner to take a CodeReader object.
A CodeReader simply contains a char[] and the name of the file, if any, that the char[] is the contents of. This leads us down the path of using char[]s in the parser instead of Strings in an attempt to cut down on our memory usage.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core.tests')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
index e538af65087..b91231383cb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
@@ -11,7 +11,6 @@
package org.eclipse.cdt.managedbuild.core.tests;
import java.io.ByteArrayInputStream;
-import java.io.StringReader;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -23,6 +22,7 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.IParser;
import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.parser.IScannerInfo;
@@ -1508,8 +1508,8 @@ public class ManagedBuildCoreTests extends TestCase {
IScannerInfo info = provider.getScannerInformation( project );
ISourceElementRequestor callback = new NullSourceElementRequestor();
- IScanner scanner = ParserFactory.createScanner( new StringReader( "#include <header.h>\n int A::i = 1;" ),
- "TEST", info, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback, new NullLogService(), null);
+ IScanner scanner = ParserFactory.createScanner( new CodeReader( "#include <header.h>\n int A::i = 1;".toCharArray() ),
+ info, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback, new NullLogService(), null);
IParser parser = ParserFactory.createParser( scanner, callback, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null );
assertTrue( parser.parse() );

Back to the top