• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 constexpr const char* kNativeBridgeLibrary8 = "libnativebridge8-test-case.so";
34 
35 namespace android {
36 
37 class NativeBridgeTest : public ::testing::Test {
38  protected:
NativeBridgeTest()39   NativeBridgeTest() : temp_dir_() {
40     app_data_dir_ = std::string(temp_dir_.path);
41     code_cache_ = app_data_dir_ + "/code_cache";
42     code_cache_stat_fail_ = code_cache_ + "/temp";
43   }
44 
AppDataDir()45   const char* AppDataDir() { return app_data_dir_.c_str(); }
46 
CodeCache()47   const char* CodeCache() { return code_cache_.c_str(); }
48 
CodeCacheStatFail()49   const char* CodeCacheStatFail() { return code_cache_stat_fail_.c_str(); }
50 
51   TemporaryDir temp_dir_;
52   std::string app_data_dir_;
53   std::string code_cache_;
54   std::string code_cache_stat_fail_;
55 };
56 
57 };  // namespace android
58 
59 #endif  // ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGETEST_H_
60