Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-11-23 12:09:20 -0500
committerAndrew Gvozdev2010-11-23 12:09:20 -0500
commitd731ae4f20f64486b983e3618b69d33a62e2db35 (patch)
treeb58eef614c2a02b6780788f7d9a50fbce6268495 /xlc/org.eclipse.cdt.errorparsers.xlc.tests
parentd0b4e55624680e69c61d0fe5433b8ff5ec751cd9 (diff)
downloadorg.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.tar.gz
org.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.tar.xz
org.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.zip
bug 330941: Xlc error parser can't figure out that file name is in quotes
Diffstat (limited to 'xlc/org.eclipse.cdt.errorparsers.xlc.tests')
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java2
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java21
2 files changed, 18 insertions, 5 deletions
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
index df4a98f677..f8973e86fb 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
@@ -32,7 +32,7 @@ public class AllXlcErrorParserTests {
suite.addTestSuite(TestNoFuncProto.class);
suite.addTestSuite(TestCompatibility.class);
suite.addTestSuite(TestUnrecoverableError.class);
- suite.addTestSuite(TestMacroRedefinition.class);
+ suite.addTestSuite(TestRedefinition.class);
suite.addTestSuite(TestRedeclaration.class);
suite.addTestSuite(TestLinkerUndefinedSymbol.class);
suite.addTestSuite(TestLinkerDuplicateSymbol.class);
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
index c890612a91..82b20113bc 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
@@ -18,7 +18,7 @@ public class TestMacroRedefinition extends TestCase {
/**
* This function tests parseLine function of the
* XlcErrorParser class. The second message generated by
- * xlc compiler for macro redefinition problem is given as
+ * xlc compiler for macro/variable redefinition problem is given as
* input for testing.
*/
public void testparseLine()
@@ -28,19 +28,32 @@ public class TestMacroRedefinition extends TestCase {
// Second line is re-parsed to 2 warnings to cross-reference both.
String err_msg1 = "\"temp1.c\", line 5.9: 1506-236 (W) Macro name TEMP_1 has been redefined.";
String err_msg2 = "\"temp1.c\", line 5.9: 1506-358 (I) \"TEMP_1\" is defined on line 3 of temp1.h.";
+ // variation of the message
+ String err_msg3 = "\"temp2.c\", line 17.9: 1506-358 (I) \"MACRO_2\" is defined on line 10 of \"temp2.c\".";
aix.parseLine(err_msg1);
aix.parseLine(err_msg2);
- assertEquals(2, aix.getNumberOfMarkers());
+ aix.parseLine(err_msg3);
+ assertEquals(4, aix.getNumberOfMarkers());
- assertEquals("Macro name TEMP_1 has been redefined on line 5 of temp1.c", aix.getMessage(0));
+ assertEquals("\"TEMP_1\" has been redefined on line 5 of temp1.c", aix.getMessage(0));
assertEquals("temp1.h", aix.getFileName(0));
assertEquals(3, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
- assertEquals("Macro name TEMP_1 redefines macro originally defined on line 3 of temp1.h", aix.getMessage(1));
+ assertEquals("\"TEMP_1\" redefines original definition on line 3 of temp1.h", aix.getMessage(1));
assertEquals("temp1.c", aix.getFileName(1));
assertEquals(5, aix.getLineNumber(1));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(1));
+
+ assertEquals("\"MACRO_2\" has been redefined on line 17 of temp2.c", aix.getMessage(2));
+ assertEquals("temp2.c", aix.getFileName(2));
+ assertEquals(10, aix.getLineNumber(2));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(2));
+
+ assertEquals("\"MACRO_2\" redefines original definition on line 10 of temp2.c", aix.getMessage(3));
+ assertEquals("temp2.c", aix.getFileName(3));
+ assertEquals(17, aix.getLineNumber(3));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(3));
}
public TestMacroRedefinition( String name)
{

Back to the top