From e785cb4291dd2133d925ff7d4fd7c6ee7b10fb2f Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Mon, 7 Feb 2011 18:25:58 +0000 Subject: [PATCH] change: throw IndexOutOfBoundsException (rather than IllegalArgumentException) when an index is out-of-bounds (upgrade all native libs) add: tests of new methods in NativeData SVN: 19802 --- base/source/c/compile_windows_i386.mak | 2 +- base/source/c/compile_windows_x64.mak | 2 +- .../ch/systemsx/cisd/base/convert/NativeDataTests.java | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/base/source/c/compile_windows_i386.mak b/base/source/c/compile_windows_i386.mak index 358d8889872..e5f53e70bec 100644 --- a/base/source/c/compile_windows_i386.mak +++ b/base/source/c/compile_windows_i386.mak @@ -6,7 +6,7 @@ #============================================================================ # Visual C++ directory, for example -VCPPDIR=C:\Program Files\Microsoft Visual Studio 8\VC +VCPPDIR=C:\Program Files\Microsoft Visual Studio 9.0\VC # Directory where JDK is installed (We require JDK 1.5 or above), for example JAVADIR=C:\Program Files\Java\jdk1.5.0_22 diff --git a/base/source/c/compile_windows_x64.mak b/base/source/c/compile_windows_x64.mak index 111b06c1493..ac92a1733ce 100644 --- a/base/source/c/compile_windows_x64.mak +++ b/base/source/c/compile_windows_x64.mak @@ -6,7 +6,7 @@ #============================================================================ # Visual C++ directory, for example -VCPPDIR=C:\Program Files (x86)\Microsoft Visual Studio 8\VC +VCPPDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC # Directory where JDK is installed (We require JDK 1.5 or above), for example JAVADIR=C:\Program Files\Java\jdk1.5.0_22 diff --git a/base/sourceTest/java/ch/systemsx/cisd/base/convert/NativeDataTests.java b/base/sourceTest/java/ch/systemsx/cisd/base/convert/NativeDataTests.java index 2203d2e79bd..4432c393944 100644 --- a/base/sourceTest/java/ch/systemsx/cisd/base/convert/NativeDataTests.java +++ b/base/sourceTest/java/ch/systemsx/cisd/base/convert/NativeDataTests.java @@ -324,12 +324,18 @@ public class NativeDataTests NativeData.copyByteToLong(null, 0, null, 0, 0, ByteOrder.NATIVE); } - @Test(expectedExceptions = {IllegalArgumentException.class, IndexOutOfBoundsException.class}) - public void testIAE() + @Test(expectedExceptions = IndexOutOfBoundsException.class) + public void testIOOB() { NativeData.copyByteToLong(new byte[] {}, -1, new long[] {}, 0, 0, ByteOrder.NATIVE); } + @Test(expectedExceptions = IndexOutOfBoundsException.class) + public void testIOOB2() + { + NativeData.copyByteToLong(new byte[] {}, 0, new long[] {}, 10, 0, ByteOrder.NATIVE); + } + @Test public void testPlatformEndiness() { -- GitLab