1049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe/*
2049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * Copyright (C) 2011 The Android Open Source Project
3049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe *
4049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * Licensed under the Apache License, Version 2.0 (the "License");
5049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * you may not use this file except in compliance with the License.
6049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * You may obtain a copy of the License at
7049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe *
8049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe *      http://www.apache.org/licenses/LICENSE-2.0
9049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe *
10049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * Unless required by applicable law or agreed to in writing, software
11049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * distributed under the License is distributed on an "AS IS" BASIS,
12049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * See the License for the specific language governing permissions and
14049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe * limitations under the License.
15049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe */
16049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe
17049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe#include <NativeBridgeTest.h>
18049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe
19049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampenamespace android {
20049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe
21049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampestatic const char* kTestName = "librandom-bridge_not.existing.so";
22049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe
23049249ce7addafaa0bd09480cd8858cd2c54138fAndreas GampeTEST_F(NativeBridgeTest, ValidName) {
24035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    // Check that the name is acceptable.
25035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    EXPECT_EQ(true, NativeBridgeNameAcceptable(kTestName));
26035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe
27035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    // Now check what happens on LoadNativeBridge.
28049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe    EXPECT_EQ(false, NativeBridgeError());
29035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    LoadNativeBridge(kTestName, nullptr);
30035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    // This will lead to an error as the library doesn't exist.
31049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe    EXPECT_EQ(true, NativeBridgeError());
32035bd7541ed909344348b6a4e17a7ef01a434653Andreas Gampe    EXPECT_EQ(false, NativeBridgeAvailable());
33049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe}
34049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe
35049249ce7addafaa0bd09480cd8858cd2c54138fAndreas Gampe}  // namespace android
36