OSDN Git Service

Do not use EXPECT_DEATH in unit test, fails on device.
authorAart Bik <ajcbik@google.com>
Tue, 19 Apr 2016 22:07:23 +0000 (15:07 -0700)
committerAart Bik <ajcbik@google.com>
Tue, 19 Apr 2016 22:07:23 +0000 (15:07 -0700)
Change-Id: I77ff843edb416fae72e7bbf66a6151405dab81b0

compiler/optimizing/reference_type_propagation_test.cc

index 99d5f82..4653e2f 100644 (file)
@@ -61,16 +61,6 @@ class ReferenceTypePropagationTest : public CommonCompilerTest {
     return ReferenceTypeInfo::Create(propagation_->handle_cache_.GetStringClassHandle(), is_exact);
   }
 
-  // Helper method to construct the Throwable type.
-  ReferenceTypeInfo ThrowableType(bool is_exact = true) SHARED_REQUIRES(Locks::mutator_lock_) {
-    return ReferenceTypeInfo::Create(propagation_->handle_cache_.GetThrowableClassHandle(), is_exact);
-  }
-
-  // Helper method to provide access to Throwable handle.
-  Handle<mirror::Class> GetThrowableHandle() {
-    return propagation_->handle_cache_.GetThrowableClassHandle();
-  }
-
   // General building fields.
   ArenaPool pool_;
   ArenaAllocator allocator_;
@@ -124,26 +114,6 @@ TEST_F(ReferenceTypePropagationTest, MergeInvalidTypes) {
   EXPECT_TRUE(t5.IsEqual(StringType()));
 }
 
-TEST_F(ReferenceTypePropagationTest, CreateErroneousType) {
-  ScopedObjectAccess soa(Thread::Current());
-  StackHandleScopeCollection handles(soa.Self());
-  SetupPropagation(&handles);
-
-  // Some trickery to make the runtime think something went wrong with loading
-  // the throwable class, making this an erroneous type from here on.
-  soa.Self()->SetException(Thread::GetDeoptimizationException());
-  Handle<mirror::Class> klass = GetThrowableHandle();
-  ObjectLock<mirror::Class> lock(soa.Self(), klass);
-  mirror::Class::SetStatus(klass, mirror::Class::kStatusError, soa.Self());
-  soa.Self()->ClearException();
-  ASSERT_TRUE(klass->IsErroneous());
-
-  // Trying to get an erroneous type crashes (debug mode only).
-  if (kIsDebugBuild) {
-    EXPECT_DEATH(ThrowableType(), "Check failed: !type_handle->IsErroneous()");
-  }
-}
-
 TEST_F(ReferenceTypePropagationTest, MergeValidTypes) {
   ScopedObjectAccess soa(Thread::Current());
   StackHandleScopeCollection handles(soa.Self());