xref: /aosp_15_r20/libnativehelper/tests_mts/jni/libnativehelper_test.cpp (revision 0797b24ee566c78eb48500180cb4bf71f81c8aab)
1*0797b24eSAndroid Build Coastguard Worker /*
2*0797b24eSAndroid Build Coastguard Worker  * Copyright (C) 2020 The Android Open Source Project
3*0797b24eSAndroid Build Coastguard Worker  *
4*0797b24eSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*0797b24eSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*0797b24eSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*0797b24eSAndroid Build Coastguard Worker  *
8*0797b24eSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*0797b24eSAndroid Build Coastguard Worker  *
10*0797b24eSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*0797b24eSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*0797b24eSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*0797b24eSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*0797b24eSAndroid Build Coastguard Worker  * limitations under the License.
15*0797b24eSAndroid Build Coastguard Worker  */
16*0797b24eSAndroid Build Coastguard Worker 
17*0797b24eSAndroid Build Coastguard Worker #include "libnativehelper_test.h"
18*0797b24eSAndroid Build Coastguard Worker 
19*0797b24eSAndroid Build Coastguard Worker #include "nativetesthelper_jni/utils.h"
20*0797b24eSAndroid Build Coastguard Worker 
SetUp()21*0797b24eSAndroid Build Coastguard Worker void LibnativehelperTest::SetUp() {
22*0797b24eSAndroid Build Coastguard Worker     int result = GetJavaVM()->GetEnv(reinterpret_cast<void**>(&mEnv), JNI_VERSION_1_6);
23*0797b24eSAndroid Build Coastguard Worker     EXPECT_EQ(JNI_OK, result);
24*0797b24eSAndroid Build Coastguard Worker     EXPECT_NE(nullptr, mEnv);
25*0797b24eSAndroid Build Coastguard Worker }
26*0797b24eSAndroid Build Coastguard Worker 
TearDown()27*0797b24eSAndroid Build Coastguard Worker void LibnativehelperTest::TearDown() {
28*0797b24eSAndroid Build Coastguard Worker     mEnv = nullptr;
29*0797b24eSAndroid Build Coastguard Worker }
30