db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1576062 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java
Date Mon, 10 Mar 2014 19:21:46 GMT
Author: rhillegas
Date: Mon Mar 10 19:21:46 2014
New Revision: 1576062

URL: http://svn.apache.org/r1576062
Log:
DERBY-3155: Fix build problem introduced by derby-3155-38-aa-datatypes.diff; commit derby-3155-39-aa-fixBuild.diff.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java?rev=1576062&r1=1576061&r2=1576062&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MergeStatementTest.java
Mon Mar 10 19:21:46 2014
@@ -8088,7 +8088,7 @@ public class MergeStatementTest extends 
         if ( left ==  null ) { return null; }
         if ( right == null ) { return null; }
 
-        int     count = Integer.min( left.length, right.length );
+        int     count = Math.min( left.length, right.length );
         byte[]  retval = new byte[ count ];
 
         for ( int i = 0; i < count; i++ ) { retval[ i ] = (byte) (left[ i ] + right[ i
]); }
@@ -8119,12 +8119,24 @@ public class MergeStatementTest extends 
     }
 
     /** Function for making a byte array from an array of ints */
-    public  static  Blob  makeBlob( Integer... inputs )
+    public  static  Blob  makeBlob( int... inputs )
+    {
+        return makeBlob( 1, inputs );
+    }
+
+    /** Function for making a big Blob by repeating the inputs a number of times */
+    public  static  Blob  makeBlob( int repeatCount, int... inputs )
     {
         if ( inputs == null )   { return null; }
+        if ( (inputs.length == 0) || (repeatCount == 0) ) { return null; }
 
-        byte[]  retval = new byte[ inputs.length ];
-        for ( int i = 0; i < inputs.length; i++ ) { retval[ i ] = (byte) inputs[ i ].intValue();
}
+        byte[]  retval = new byte[ repeatCount * inputs.length ];
+        int     idx = 0;
+        
+        for ( int i = 0; i < repeatCount; i++ )
+        {
+            for ( int val : inputs ) { retval[ idx++ ] = (byte) val; }
+        }
 
         return new HarmonySerialBlob( retval );
     }



Mime
View raw message