/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "dexopt_test.h"
#include "runtime.h"
#include "scoped_thread_state_change-inl.h"
#include "thread.h"

namespace art HIDDEN {

// This test creates two runtimes consecutively to check that state is
// setup and cleaned-up correctly each time.

// Make this a DexoptTest, which makes sure runtime images get mapped
// at random addresses.
class TwoRuntimesTest : public DexoptTest {};

TEST_F(TwoRuntimesTest, FirstInvocation) {
  Thread::Current()->TransitionFromSuspendedToRunnable();
  runtime_->Start();
}

TEST_F(TwoRuntimesTest, SecondInvocation) {
  Thread::Current()->TransitionFromSuspendedToRunnable();
  runtime_->Start();
}

}  // namespace art
