summaryrefslogtreecommitdiff
path: root/runtime/reflection_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/reflection_test.cc')
-rw-r--r--runtime/reflection_test.cc36
1 files changed, 4 insertions, 32 deletions
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc
index 8a7685578e..4a24d2aab6 100644
--- a/runtime/reflection_test.cc
+++ b/runtime/reflection_test.cc
@@ -21,7 +21,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
-#include "common_compiler_test.h"
+#include "common_runtime_test.h"
#include "dex/descriptors_names.h"
#include "jni/java_vm_ext.h"
#include "jni/jni_internal.h"
@@ -31,11 +31,10 @@
namespace art {
-// TODO: Convert to CommonRuntimeTest. Currently CompileDirectMethod is used in one test.
-class ReflectionTest : public CommonCompilerTest {
+class ReflectionTest : public CommonRuntimeTest {
protected:
void SetUp() override {
- CommonCompilerTest::SetUp();
+ CommonRuntimeTest::SetUp();
vm_ = Runtime::Current()->GetJavaVM();
@@ -76,7 +75,7 @@ class ReflectionTest : public CommonCompilerTest {
void TearDown() override {
CleanUpJniEnv();
- CommonCompilerTest::TearDown();
+ CommonRuntimeTest::TearDown();
}
jclass GetPrimitiveClass(char descriptor) {
@@ -511,33 +510,6 @@ class ReflectionTest : public CommonCompilerTest {
jclass sioobe_;
};
-TEST_F(ReflectionTest, StaticMainMethod) {
- ScopedObjectAccess soa(Thread::Current());
- jobject jclass_loader = LoadDex("Main");
- StackHandleScope<1> hs(soa.Self());
- Handle<mirror::ClassLoader> class_loader(
- hs.NewHandle(soa.Decode<mirror::ClassLoader>(jclass_loader)));
- CompileDirectMethod(class_loader, "Main", "main", "([Ljava/lang/String;)V");
-
- ObjPtr<mirror::Class> klass = class_linker_->FindClass(soa.Self(), "LMain;", class_loader);
- ASSERT_TRUE(klass != nullptr);
-
- ArtMethod* method = klass->FindClassMethod("main",
- "([Ljava/lang/String;)V",
- kRuntimePointerSize);
- ASSERT_TRUE(method != nullptr);
- ASSERT_TRUE(method->IsStatic());
-
- // Start runtime.
- bool started = runtime_->Start();
- CHECK(started);
- soa.Self()->TransitionFromSuspendedToRunnable();
-
- jvalue args[1];
- args[0].l = nullptr;
- InvokeWithJValues(soa, nullptr, jni::EncodeArtMethod(method), args);
-}
-
TEST_F(ReflectionTest, StaticNopMethod) {
InvokeNopMethod(true);
}