diff options
Diffstat (limited to 'test/IntMath/IntMath.java')
| -rw-r--r-- | test/IntMath/IntMath.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/IntMath/IntMath.java b/test/IntMath/IntMath.java index e5fa806ca4..b1b7312fb2 100644 --- a/test/IntMath/IntMath.java +++ b/test/IntMath/IntMath.java @@ -786,6 +786,34 @@ class IntMath extends IntMathBase { return res; } + static void throwArrayStoreException(Object[] array, Object element) { + array[0] = element; + } + + static int testArrayStoreException() { + int res=0; + Object[] array = new Number[2]; + try { + throwArrayStoreException(array, null); + res += 1; + } catch(ArrayStoreException e) { + res += 2; + } + try { + throwArrayStoreException(array, Integer.valueOf(1)); + res += 10; + } catch(ArrayStoreException e) { + res += 20; + } + try { + throwArrayStoreException(array, "hello MTV-44"); + res += 100; + } catch(ArrayStoreException e) { + res += 200; + } + return res; + } + static long recursion_count_; static void throwStackOverflow(long l) { recursion_count_++; @@ -966,6 +994,14 @@ class IntMath extends IntMathBase { failure = true; } + res = testArrayStoreException(); + if (res == 211) { + System.out.println("testArrayStore PASSED"); + } else { + System.out.println("testArrayStore FAILED: " + res); + failure = true; + } + lres= testStackOverflow(); if (lres == 0) { System.out.println("testStackOverflow PASSED"); |