diff options
author | darius42 <[email protected]> | 2007-08-22 23:50:24 +0000 |
---|---|---|
committer | darius42 <[email protected]> | 2007-08-22 23:50:24 +0000 |
commit | 1cde7e1f0247afc51e2204b1115641c83db3c60a (patch) | |
tree | 6178426f2cfacdd092d077b08b6b6ac63c8b6dbc | |
parent | b8f9c2efe5a0b11db7a644b20b7d311da0cd02fa (diff) |
Update for bug 1775873. Modify the warning levels for Sunpro to provide finer grain control over the flags that are used.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@140 32d7a393-a5a9-423c-abd3-5d954feb1f2f
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java | 7 | ||||
-rw-r--r-- | src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java | 59 |
2 files changed, 64 insertions, 2 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java index 2212871..9422e49 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java @@ -91,13 +91,16 @@ public final class ForteCCCompiler extends GccCompatibleCCompiler { break; case 1 : case 2 : - args.addElement("+w"); break; case 3 : + args.addElement("+w"); + break; case 4 : - case 5 : args.addElement("+w2"); break; + case 5 : + args.addElement("+w2"); + args.addElement("-xwe"); } } public File[] getEnvironmentIncludePath() { diff --git a/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java b/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java index 0fa3297..df08539 100644 --- a/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java +++ b/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java @@ -70,4 +70,63 @@ public class TestForteCCCompiler extends TestCase { assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler .bid("foo.s")); } + /** + * Tests command line switches for warning = 0 + */ + public void testWarningLevel0() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 0); + assertEquals(1, args.size()); + assertEquals("-w", args.elementAt(0)); + } + /** + * Tests command line switches for warning = 1 + */ + public void testWarningLevel1() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 1); + assertEquals(0, args.size()); + } + /** + * Tests command line switches for warning = 2 + */ + public void testWarningLevel2() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 2); + assertEquals(0, args.size()); + } + /** + * Tests command line switches for warning = 3 + */ + public void testWarningLevel3() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 3); + assertEquals(1, args.size()); + assertEquals("+w", args.elementAt(0)); + } + /** + * Tests command line switches for warning = 4 + */ + public void testWarningLevel4() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 4); + assertEquals(1, args.size()); + assertEquals("+w2", args.elementAt(0)); + } + /** + * Tests command line switches for warning = 5 + */ + public void testWarningLevel5() { + ForteCCCompiler compiler = ForteCCCompiler.getInstance(); + Vector args = new Vector(); + compiler.addWarningSwitch(args, 5); + assertEquals(2, args.size()); + assertEquals("+w2", args.elementAt(0)); + assertEquals("-xwe", args.elementAt(1)); + } } |