mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Checked in JUnit for regression purposes.
Patch for Andrew partial fix for Bug 103560 ClassCastException in LocationMap.endInclusion
This commit is contained in:
parent
23842807c9
commit
27cfada85a
4 changed files with 31 additions and 4 deletions
|
@ -103,6 +103,17 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
|
|||
|
||||
public class AST2CPPTests extends AST2BaseTest {
|
||||
|
||||
|
||||
// public void testBug102825() throws Exception {
|
||||
// StringBuffer buffer = new StringBuffer("#define CURLOPTTYPE_OBJECTPOINT 10000\n" ); //$NON-NLS-1$
|
||||
// buffer.append("#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number\n" ); //$NON-NLS-1$
|
||||
// buffer.append("typedef enum {\n" ); //$NON-NLS-1$
|
||||
// buffer.append("CINIT(FILE, OBJECTPOINT, 1),\n" ); //$NON-NLS-1$
|
||||
// buffer.append(" CINIT(URL, OBJECTPOINT, 2)\n" ); //$NON-NLS-1$
|
||||
// buffer.append("} CURLoption ;\n" ); //$NON-NLS-1$
|
||||
// parseAndCheckBindings(buffer.toString());
|
||||
// }
|
||||
|
||||
public void testBug78883() throws Exception {
|
||||
StringBuffer buffer = new StringBuffer("class B {\n"); //$NON-NLS-1$
|
||||
buffer.append("public:\n"); //$NON-NLS-1$
|
||||
|
|
|
@ -2468,4 +2468,11 @@ public class CompleteParser2Tests extends TestCase {
|
|||
parse( writer.toString() );
|
||||
}
|
||||
|
||||
public void testBug103560() throws Exception {
|
||||
Writer writer = new StringWriter();
|
||||
writer.write("#define A( a, b ) a ## b \n"); //$NON-NLS-1$
|
||||
writer.write("#define FOOBAR 1 \n"); //$NON-NLS-1$
|
||||
writer.write("int i = A( FOO, BAR ); \n"); //$NON-NLS-1$
|
||||
parse( writer.toString() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,16 @@ import org.eclipse.cdt.internal.core.parser.scanner2.FunctionStyleMacro;
|
|||
*/
|
||||
public class Scanner2Test extends BaseScanner2Test
|
||||
{
|
||||
// public void testBug102825() throws Exception {
|
||||
// StringBuffer buffer = new StringBuffer("#define CURLOPTTYPE_OBJECTPOINT 10000\n" ); //$NON-NLS-1$
|
||||
// buffer.append("#define CINIT(name,type,number) CURLOPT_##name = CURLOPTTYPE_##type + number\n" ); //$NON-NLS-1$
|
||||
// buffer.append("CINIT(FILE, OBJECTPOINT, 1)\n" ); //$NON-NLS-1$
|
||||
// initializeScanner(buffer.toString());
|
||||
// validateIdentifier( "CURLOPT_FILE"); //$NON-NLS-1$
|
||||
// validateToken( IToken.tASSIGN );
|
||||
// validateInteger( "10000"); //$NON-NLS-1$
|
||||
// }
|
||||
|
||||
public class TableRow
|
||||
{
|
||||
private int[] values;
|
||||
|
|
|
@ -4274,11 +4274,10 @@ abstract class BaseScanner implements IScanner {
|
|||
replacedArgs.put(repObject, rep);
|
||||
repObject = rep;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != null)
|
||||
System.arraycopy(repObject, 0, result, outpos,
|
||||
repObject.length);
|
||||
if (result != null )
|
||||
System.arraycopy(repObject, 0, result, outpos, repObject.length);
|
||||
}
|
||||
outpos += repObject.length;
|
||||
|
||||
lastcopy = pos;
|
||||
|
|
Loading…
Add table
Reference in a new issue