SF.net SVN: ant-contrib: [140] cpptasks/trunk/src

[email protected] Wed, 22 Aug 2007 16:50:24 -0700
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Revision: 140
          http://ant-contrib.svn.sourceforge.net/ant-contrib/?rev=140&view=rev
Author:   darius42
Date:     2007-08-22 16:50:24 -0700 (Wed, 22 Aug 2007)

Log Message:
-----------
Update for bug 1775873.  Modify the warning levels for Sunpro to provide finer grain control over the flags that are used.

Modified Paths:
--------------
    cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
    cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java

Modified: cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
===================================================================
--- cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java	2007-08-22 21:08:36 UTC (rev 139)
+++ cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java	2007-08-22 23:50:24 UTC (rev 140)
@@ -91,13 +91,16 @@
                 break;
             case 1 :
             case 2 :
+                break;
+            case 3 :
                 args.addElement("+w");
                 break;
-            case 3 :
             case 4 :
+                args.addElement("+w2");
+                break;
             case 5 :
                 args.addElement("+w2");
-                break;
+                args.addElement("-xwe");
         }
     }
     public File[] getEnvironmentIncludePath() {

Modified: cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java
===================================================================
--- cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java	2007-08-22 21:08:36 UTC (rev 139)
+++ cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java	2007-08-22 23:50:24 UTC (rev 140)
@@ -70,4 +70,63 @@
         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));
+    }
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/