Skip to main content
summaryrefslogtreecommitdiffstats
path: root/xlc
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-07-28 18:57:19 -0400
committerAndrew Gvozdev2010-07-28 18:57:19 -0400
commit739f1e403e4c10dc9e0fc6fb4001c4861fdd811e (patch)
treea1a373f3e43e4d849c09d9583409993c61462cb7 /xlc
parentba337c9707b9d53086f28c2a6003b9fcae44b7da (diff)
downloadorg.eclipse.cdt-739f1e403e4c10dc9e0fc6fb4001c4861fdd811e.tar.gz
org.eclipse.cdt-739f1e403e4c10dc9e0fc6fb4001c4861fdd811e.tar.xz
org.eclipse.cdt-739f1e403e4c10dc9e0fc6fb4001c4861fdd811e.zip
bug 321160: Confusing message about redefined macro from xlc error parser
Diffstat (limited to 'xlc')
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCompatibility.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestConditional.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFloatingPoint.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFuncArg.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerDuplicateSymbol.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerErrorWhileReading.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerInfo.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerSevereError.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerUndefinedSymbol.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java27
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMissingArg.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestNoFuncProto.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestOperModi.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestSyntaxError.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUndeclIdent.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java8
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java48
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties6
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml4
19 files changed, 115 insertions, 90 deletions
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCompatibility.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCompatibility.java
index 47106f14de..263608f41f 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCompatibility.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCompatibility.java
@@ -26,10 +26,10 @@ public class TestCompatibility extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp1.c", aix.getFileName());
- assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity());
- assertEquals("Compatibility test",aix.getMessage());
+ assertEquals("temp1.c", aix.getFileName(0));
+ assertEquals(5, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
+ assertEquals("Compatibility test",aix.getMessage(0));
}
public TestCompatibility( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestConditional.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestConditional.java
index 83841bd636..e75f305d4f 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestConditional.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestConditional.java
@@ -27,10 +27,10 @@ public class TestConditional extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp8.c", aix.getFileName());
- assertEquals(12, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity());
- assertEquals("The then branch of conditional is an empty statement.",aix.getMessage());
+ assertEquals("temp8.c", aix.getFileName(0));
+ assertEquals(12, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
+ assertEquals("The then branch of conditional is an empty statement.",aix.getMessage(0));
}
public TestConditional( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFloatingPoint.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFloatingPoint.java
index 938cd2e27d..a48256b88d 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFloatingPoint.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFloatingPoint.java
@@ -28,11 +28,11 @@ public class TestFloatingPoint extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp9.c", aix.getFileName());
- assertEquals(11, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
+ assertEquals("temp9.c", aix.getFileName(0));
+ assertEquals(11, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
assertEquals("Floating point constant 10.23.3 is not valid",
- aix.getMessage());
+ aix.getMessage(0));
}
public TestFloatingPoint( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFuncArg.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFuncArg.java
index 3c7d2ab760..9a4ee2c56f 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFuncArg.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestFuncArg.java
@@ -27,12 +27,12 @@ public class TestFuncArg extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp9.c", aix.getFileName());
- assertEquals(12, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
+ assertEquals("temp9.c", aix.getFileName(0));
+ assertEquals(12, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
assertEquals("Function argument assignment between types " +
"\"int\" and \"char*\" is not allowed.",
- aix.getMessage());
+ aix.getMessage(0));
}
public TestFuncArg( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerDuplicateSymbol.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerDuplicateSymbol.java
index 27a8d52c42..e5a00893b1 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerDuplicateSymbol.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerDuplicateSymbol.java
@@ -27,10 +27,10 @@ public class TestLinkerDuplicateSymbol extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("", aix.getFileName());
- assertEquals(0, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity());
- assertEquals("Duplicate symbol: dupefun",aix.getMessage());
+ assertEquals("", aix.getFileName(0));
+ assertEquals(0, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
+ assertEquals("Duplicate symbol: dupefun",aix.getMessage(0));
}
public TestLinkerDuplicateSymbol( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerErrorWhileReading.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerErrorWhileReading.java
index bb93eb3738..3cbaf6da6c 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerErrorWhileReading.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerErrorWhileReading.java
@@ -27,10 +27,10 @@ public class TestLinkerErrorWhileReading extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("", aix.getFileName());
- assertEquals(0, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Error occurred while reading file",aix.getMessage());
+ assertEquals("", aix.getFileName(0));
+ assertEquals(0, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Error occurred while reading file",aix.getMessage(0));
}
public TestLinkerErrorWhileReading( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerInfo.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerInfo.java
index 3cfda50139..e4bf18b6c0 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerInfo.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerInfo.java
@@ -27,10 +27,10 @@ public class TestLinkerInfo extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("", aix.getFileName());
- assertEquals(0, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity());
- assertEquals("Use the -bloadmap or -bnoquiet option to obtain more information.",aix.getMessage());
+ assertEquals("", aix.getFileName(0));
+ assertEquals(0, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
+ assertEquals("Use the -bloadmap or -bnoquiet option to obtain more information.",aix.getMessage(0));
}
public TestLinkerInfo( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerSevereError.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerSevereError.java
index eacb6a146a..cddb064208 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerSevereError.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerSevereError.java
@@ -27,10 +27,10 @@ public class TestLinkerSevereError extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("", aix.getFileName());
- assertEquals(0, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("EXEC binder commands nested too deeply.",aix.getMessage());
+ assertEquals("", aix.getFileName(0));
+ assertEquals(0, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("EXEC binder commands nested too deeply.",aix.getMessage(0));
}
public TestLinkerSevereError( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerUndefinedSymbol.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerUndefinedSymbol.java
index 5e7aa81534..0774274db1 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerUndefinedSymbol.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerUndefinedSymbol.java
@@ -27,10 +27,10 @@ public class TestLinkerUndefinedSymbol extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("", aix.getFileName());
- assertEquals(0, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Undefined symbol: nofun()",aix.getMessage());
+ assertEquals("", aix.getFileName(0));
+ assertEquals(0, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Undefined symbol: nofun()",aix.getMessage(0));
}
public TestLinkerUndefinedSymbol( String name)
{
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 3409e8d35a..c890612a91 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
@@ -15,7 +15,6 @@ import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestMacroRedefinition extends TestCase {
- String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. The second message generated by
@@ -25,18 +24,26 @@ public class TestMacroRedefinition extends TestCase {
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
- aix.parseLine(err_msg);
- assertEquals("temp1.h", aix.getFileName());
- assertEquals(3, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity());
- assertEquals("Macro name TEMP_1 originally defined in file temp1.h",aix.getMessage());
+ // Macro redefinition warning generates 2 messages. First line is ignored.
+ // 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.";
+ aix.parseLine(err_msg1);
+ aix.parseLine(err_msg2);
+ assertEquals(2, aix.getNumberOfMarkers());
+
+ assertEquals("Macro name 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("temp1.c", aix.getFileName(1));
+ assertEquals(5, aix.getLineNumber(1));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(1));
}
public TestMacroRedefinition( String name)
{
super(name);
- // Macro redefinition warning provides 2 lines. First line is captured as regular warning message.
- // "temp1.c", line 5.9: 1506-236 (W) Macro name TEMP_1 has been redefined.
- // Second line is re-parsed to stay close to the first one and point to file with original definition
- err_msg = "\"temp1.c\", line 5.9: 1506-358 (I) \"TEMP_1\" is defined on line 3 of temp1.h.";
}
} \ No newline at end of file
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMissingArg.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMissingArg.java
index 636a05b675..6038d0b312 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMissingArg.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMissingArg.java
@@ -28,10 +28,10 @@ public class TestMissingArg extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp8.c", aix.getFileName());
- assertEquals(9, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Missing argument(s).",aix.getMessage());
+ assertEquals("temp8.c", aix.getFileName(0));
+ assertEquals(9, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Missing argument(s).",aix.getMessage(0));
}
public TestMissingArg( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestNoFuncProto.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestNoFuncProto.java
index d3ee3c94cc..f212db3e16 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestNoFuncProto.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestNoFuncProto.java
@@ -25,10 +25,10 @@ public class TestNoFuncProto extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp1.c", aix.getFileName());
- assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity());
- assertEquals("No function prototype given for \"printf\".",aix.getMessage());
+ assertEquals("temp1.c", aix.getFileName(0));
+ assertEquals(5, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
+ assertEquals("No function prototype given for \"printf\".",aix.getMessage(0));
}
public TestNoFuncProto( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestOperModi.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestOperModi.java
index 554bcad010..fa1f699789 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestOperModi.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestOperModi.java
@@ -27,10 +27,10 @@ public class TestOperModi extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp9.c", aix.getFileName());
- assertEquals(13, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Operand must be a modifiable lvalue.",aix.getMessage());
+ assertEquals("temp9.c", aix.getFileName(0));
+ assertEquals(13, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Operand must be a modifiable lvalue.",aix.getMessage(0));
}
public TestOperModi( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestSyntaxError.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestSyntaxError.java
index 2fc8bcd6ff..280ee47820 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestSyntaxError.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestSyntaxError.java
@@ -26,10 +26,10 @@ public class TestSyntaxError extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp1.c", aix.getFileName());
- assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Syntax error: possible missing ')'?",aix.getMessage());
+ assertEquals("temp1.c", aix.getFileName(0));
+ assertEquals(5, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Syntax error: possible missing ')'?",aix.getMessage(0));
}
public TestSyntaxError( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUndeclIdent.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUndeclIdent.java
index ac30e5f785..0fc1b80145 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUndeclIdent.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUndeclIdent.java
@@ -27,10 +27,10 @@ public class TestUndeclIdent extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp5.c", aix.getFileName());
- assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("Undeclared identifier y.",aix.getMessage());
+ assertEquals("temp5.c", aix.getFileName(0));
+ assertEquals(5, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("Undeclared identifier y.",aix.getMessage(0));
}
public TestUndeclIdent( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
index e94da5b1cf..ee9962c0e7 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError.java
@@ -26,10 +26,10 @@ public class TestUnrecoverableError extends TestCase {
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
- assertEquals("temp1.c", aix.getFileName());
- assertEquals(5, aix.getLineNumber());
- assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity());
- assertEquals("INTERNAL COMPILER ERROR",aix.getMessage());
+ assertEquals("temp1.c", aix.getFileName(0));
+ assertEquals(5, aix.getLineNumber(0));
+ assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
+ assertEquals("INTERNAL COMPILER ERROR",aix.getMessage(0));
}
public TestUnrecoverableError( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
index b565c593fb..04b57e9525 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/XlcErrorParserTester.java
@@ -12,6 +12,9 @@
package org.eclipse.cdt.errorparsers.xlc.tests;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.Assert;
import org.eclipse.cdt.core.ErrorParserManager;
@@ -44,10 +47,14 @@ public class XlcErrorParserTester {
}
}
- private String fileName;
- private int lineNumber;
- private int severity;
- private String message;
+ private class MarkerData {
+ private String fileName;
+ private int lineNumber;
+ private int severity;
+ private String message;
+ }
+
+ private List<MarkerData> markerDataList = new ArrayList<MarkerData>();
/*
* Dummy class implementing IMarkerGenerator lets get through testing
@@ -97,14 +104,17 @@ public class XlcErrorParserTester {
@Override
public void generateExternalMarker(IResource rc, int lineNumb, String desc, int sev, String varName, IPath externalPath) {
// if rc is this project it means that file was not found
+ MarkerData markerData = new MarkerData();
if (rc!=null && rc!=fTempProject) {
- fileName = rc.getName();
+ markerData.fileName = rc.getName();
} else {
- fileName="";
+ markerData.fileName="";
}
- lineNumber = lineNumb;
- message = desc;
- severity = sev;
+ markerData.lineNumber = lineNumb;
+ markerData.message = desc;
+ markerData.severity = sev;
+
+ markerDataList.add(markerData);
}
}
@@ -121,19 +131,23 @@ public class XlcErrorParserTester {
return errorParser.processLine(line, epManager);
}
- String getFileName() {
- return fileName;
+ int getNumberOfMarkers() {
+ return markerDataList.size();
+ }
+
+ String getFileName(int i) {
+ return markerDataList.get(i).fileName;
}
- int getLineNumber() {
- return lineNumber;
+ int getLineNumber(int i) {
+ return markerDataList.get(i).lineNumber;
}
- int getSeverity() {
- return severity;
+ int getSeverity(int i) {
+ return markerDataList.get(i).severity;
}
- String getMessage() {
- return message;
+ String getMessage(int i) {
+ return markerDataList.get(i).message;
}
}
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
index 89c0bddd88..916d7f3177 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
@@ -20,12 +20,14 @@ CDTXLCErrorParser.name=CDT xlC Error Parser
# Translators: do not translate patterns below. We currently do not support NL versions of the XL C/C++ compilers.
# Following are patterns of xlC compiler messages. While translating the patterns should be replaced
-# with corresponding patterns matchind localized compiler messages
+# with corresponding patterns matching localized compiler messages
# START NON-TRANSLATABLE
# "hello.c", line 5.9: 1506-358 (I) "MACRO" is defined on line 3 of hello.h.
CDTXLCErrorParser.pattern.macro=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*["]?(\\w*)["]? is defined on line ([0-9]+) of (.*)\\.
-CDTXLCErrorParser.pattern.macro.replacement=Macro name $4 originally defined in file $6
+CDTXLCErrorParser.pattern.macro.replacement=Macro name $4 has been redefined on line $2 of $1
+CDTXLCErrorParser.pattern.macro.crossreference=Macro name $4 redefines macro originally defined on line $5 of $6
+CDTXLCErrorParser.pattern.macro.ignore=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*Macro name .* has been redefined\\.
# "main.cpp", line 10.6: 1540-0064 (S) Syntax error: "name" was expected but "char" was found.
CDTXLCErrorParser.pattern.error=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*)
CDTXLCErrorParser.pattern.warning=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*)
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml
index 3dc995eab1..3dd9c5aab8 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml
@@ -6,9 +6,11 @@
class="org.eclipse.cdt.core.errorparsers.RegexErrorParser"
id="org.eclipse.cdt.errorparsers.xlc.XlcErrorParser"
name="%CDTXLCErrorParser.name">
+ <pattern regex="%CDTXLCErrorParser.pattern.macro.ignore" severity="Ignore" file-expr="" line-expr="" description-expr="" eat-processed-line="true" />
+ <pattern regex="%CDTXLCErrorParser.pattern.macro" severity="Warning" file-expr="$6" line-expr="$5" description-expr="%CDTXLCErrorParser.pattern.macro.replacement" eat-processed-line="false" />
+ <pattern regex="%CDTXLCErrorParser.pattern.macro" severity="Warning" file-expr="$1" line-expr="$2" description-expr="%CDTXLCErrorParser.pattern.macro.crossreference" eat-processed-line="true" />
<pattern regex="%CDTXLCErrorParser.pattern.error" severity="Error" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.warning" severity="Warning" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
- <pattern regex="%CDTXLCErrorParser.pattern.macro" severity="Warning" file-expr="$6" line-expr="$5" description-expr="%CDTXLCErrorParser.pattern.macro.replacement" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.info" severity="Info" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.error" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.error2" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>

Back to the top