blob: e1d66f53df1e223f782fc70910f1335752630e6c [file] [log] [blame]
Martin Stjernholm19d1feb2021-03-30 22:35:24 +01001/*
2 * Copyright (C) 2021 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#include <android-base/macros.h>
18#include <gtest/gtest.h>
19
20#include "nativebridge/native_bridge.h"
21
22namespace android {
23
24class NativeBridgeLazyTest : public ::testing::Test {};
25
26// The testing we can do here is limited since there's no exported API to
27// actually load the native bridge, but we only need to test the trivial
28// wrappers.
29
30TEST_F(NativeBridgeLazyTest, NeedsNativeBridge) {
31 EXPECT_FALSE(NeedsNativeBridge(ABI_STRING));
32}
33
34TEST_F(NativeBridgeLazyTest, PreInitializeNativeBridge) {
35 EXPECT_FALSE(PreInitializeNativeBridge(nullptr, ""));
36}
37
38TEST_F(NativeBridgeLazyTest, NativeBridgeAvailable) {
39 EXPECT_FALSE(NativeBridgeAvailable());
40}
41
42TEST_F(NativeBridgeLazyTest, NativeBridgeInitialized) {
43 EXPECT_FALSE(NativeBridgeInitialized());
44}
45
46TEST_F(NativeBridgeLazyTest, NativeBridgeGetTrampoline) {
47 EXPECT_EQ(nullptr, NativeBridgeGetTrampoline(nullptr, nullptr, nullptr, 0));
48}
49
50TEST_F(NativeBridgeLazyTest, NativeBridgeGetError) {
51 EXPECT_STREQ("native bridge is not initialized", NativeBridgeGetError());
52}
53
54}; // namespace android