Add semi-functional exception throwing.
We still need a way to call <init> on the new exception instance, in particular.
Change-Id: I839365d20288208cb8847253380cf654a35aeddd
diff --git a/src/jni_internal_test.cc b/src/jni_internal_test.cc
index 9394ff6..569dfda 100644
--- a/src/jni_internal_test.cc
+++ b/src/jni_internal_test.cc
@@ -115,7 +115,19 @@
EXPECT_TRUE(array != NULL);
env_->SetObjectArrayElement(array, 0, c);
// TODO: check reading value back
- // TODO: check IndexOutOfBoundsExceptions thrown for bad indexes.
+
+ // ArrayIndexOutOfBounds for negative index.
+ // TODO: check exception type
+ env_->SetObjectArrayElement(array, -1, c);
+ EXPECT_TRUE(env_->ExceptionCheck());
+ env_->ExceptionClear();
+
+ // ArrayIndexOutOfBounds for too-large index.
+ // TODO: check exception type
+ env_->SetObjectArrayElement(array, 1, c);
+ EXPECT_TRUE(env_->ExceptionCheck());
+ env_->ExceptionClear();
+
// TODO: check ArrayStoreException thrown for bad types.
}