1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGETEST_H_
18 #define ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGETEST_H_
19 
20 #define LOG_TAG "NativeBridge_test"
21 
22 #include <android-base/file.h>
23 #include <gtest/gtest.h>
24 #include <nativebridge/native_bridge.h>
25 
26 #include <string>
27 
28 constexpr const char* kNativeBridgeLibrary = "libnativebridge-test-case.so";
29 constexpr const char* kNativeBridgeLibrary2 = "libnativebridge2-test-case.so";
30 constexpr const char* kNativeBridgeLibrary3 = "libnativebridge3-test-case.so";
31 constexpr const char* kNativeBridgeLibrary6 = "libnativebridge6-test-case.so";
32 constexpr const char* kNativeBridgeLibrary7 = "libnativebridge7-test-case.so";
33 
34 namespace android {
35 
36 class NativeBridgeTest : public testing::Test {
37  protected:
NativeBridgeTest()38   NativeBridgeTest() : tempDir() {
39     appDataDir_ = std::string(tempDir.path);
40     codeCache_ = appDataDir_ + "/code_cache";
41     codeCacheStatFail_ = codeCache_ + "/temp";
42   }
43 
appDataDir()44   const char* appDataDir() { return appDataDir_.c_str(); }
45 
codeCache()46   const char* codeCache() { return codeCache_.c_str(); }
47 
codeCacheStatFail()48   const char* codeCacheStatFail() { return codeCacheStatFail_.c_str(); }
49 
50   TemporaryDir tempDir;
51   std::string appDataDir_;
52   std::string codeCache_;
53   std::string codeCacheStatFail_;
54 };
55 
56 };  // namespace android
57 
58 #endif  // ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGETEST_H_
59