commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r813857 - in /commons/sandbox/runtime/trunk/src: main/java/org/apache/commons/runtime/io/Status.java test/org/apache/commons/runtime/TestPrivate.java test/org/apache/commons/runtime/TestStatus.java
Date Fri, 11 Sep 2009 14:34:47 GMT
Author: mturk
Date: Fri Sep 11 14:34:46 2009
New Revision: 813857

URL: http://svn.apache.org/viewvc?rev=813857&view=rev
Log:
Use new error code ranges

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestPrivate.java
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStatus.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java?rev=813857&r1=813856&r2=813857&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Status.java
Fri Sep 11 14:34:46 2009
@@ -321,14 +321,19 @@
 
     /* Hard coded definitions for acr_error.h
      */
-    private static final int OS_START_ERROR         =  20000;
-    private static final int OS_START_STATUS        =  70000;
-    private static final int UTIL_START_STATUS      = 100000;
-    private static final int OS_START_USERERR       = 120000;
-    private static final int OS_START_CANONERR      = 620000;
+    private static final int OS_START_ERROR         = 200000;
+    private static final int OS_START_STATUS        = 300000;
+    /**
+     * ACR_OS_START_CANONERR is where ACR versions of errno values are defined
+     *     on systems which don't have the corresponding errno.
+     */
+    private static final int OS_START_CANONERR      = 500000;
     private static final int OS_LAST_CANONERR;
-    private static final int OS_START_EAIERR        = 670000;
-    private static final int OS_START_SYSERR        = 720000;
+    /**
+     * ACR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
+     *    into one of the error/status ranges below -- except for
+     *    ACR_OS_START_USERERR, which see.
+     */
     private static final int OS_ERRSPACE_SIZE       =  50000;
 
     /** Status is OK. */
@@ -405,22 +410,9 @@
     public static final int ENOTIMPL                = OS_START_STATUS + 23;
     public static final int EMISMATCH               = OS_START_STATUS + 24;
 
-    /** Native system error */
-    public static boolean IS_NATIVE_ERROR(int s)
-    {
-        return (s < OS_START_ERROR);
-    }
-
-    /** Cannonical system error */
-    public static boolean IS_OS_SYSERR(int s)
-    {
-        return ((s > OS_START_SYSERR) &&
-                (s < OS_START_SYSERR + OS_ERRSPACE_SIZE));
-    }
-
     public static boolean IS_STATUS(int s)
     {
-        return ((s > OS_START_STATUS) && (s < OS_START_STATUS + 1000));
+        return ((s > OS_START_STATUS) && (s < OS_START_STATUS + OS_ERRSPACE_SIZE));
     }
 
     private static native boolean is0(int what, int err);

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestPrivate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestPrivate.java?rev=813857&r1=813856&r2=813857&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestPrivate.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestPrivate.java Fri
Sep 11 14:34:46 2009
@@ -414,8 +414,7 @@
         int r = test018(p);
         assertEquals("Result ", 0, r);
         int c = test018(p);
-        // 70008 is ACR_INCLOMPLETE */
-        assertEquals("Result ", 70008, c);
+        assertEquals("Result ", Status.INCOMPLETE, c);
 
         p.free();
         p = null;
@@ -580,8 +579,7 @@
         int r = test022(d);
         assertEquals("Result ", 0, r);
         int c = test022(d);
-        // 70008 is ACR_INCLOMPLETE */
-        assertEquals("Result ", 70008, c);
+        assertEquals("Result ", Status.INCOMPLETE, c);
 
         d.close();
         d = null;

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStatus.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStatus.java?rev=813857&r1=813856&r2=813857&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStatus.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestStatus.java Fri
Sep 11 14:34:46 2009
@@ -45,13 +45,6 @@
         assertTrue("Status", err != 0);
     }
 
-    public void testStatusSys()
-        throws Exception
-    {
-        int err = 720000 + 32;
-        assertTrue("Status", Status.IS_OS_SYSERR(err));
-    }
-
     public void testStatusStat()
         throws Exception
     {



Mime
View raw message