1 /*
2  * Copyright 2015 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 package android.hardware.camera2.cts;
18 
19 import android.test.AndroidTestCase;
20 import android.util.Log;
21 
22 /**
23  * <p>Basic test for CameraManager class.</p>
24  */
25 public class NativeCameraManagerTest extends AndroidTestCase {
26     private static final String TAG = "NativeCameraManagerTest";
27     private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
28 
29     /** Load jni on initialization */
30     static {
31         Log.i("NativeCameraManagerTest", "before loadlibrary");
32         System.loadLibrary("ctscamera2_jni");
33         Log.i("NativeCameraManagerTest", "after loadlibrary");
34     }
35 
testCameraManagerGetAndClose()36     public void testCameraManagerGetAndClose() {
37         assertTrue("testCameraManagerGetAndClose fail, see log for details",
38                 testCameraManagerGetAndCloseNative());
39     }
40 
testCameraManagerGetCameraIds()41     public void testCameraManagerGetCameraIds() {
42         assertTrue("testCameraManagerGetCameraIds fail, see log for details",
43                 testCameraManagerGetCameraIdsNative());
44     }
45 
testCameraManagerAvailabilityCallback()46     public void testCameraManagerAvailabilityCallback() {
47         assertTrue("testCameraManagerAvailabilityCallback fail, see log for details",
48                 testCameraManagerAvailabilityCallbackNative());
49     }
50 
testCameraManagerCameraCharacteristics()51     public void testCameraManagerCameraCharacteristics() {
52         assertTrue("testCameraManagerCameraCharacteristics fail, see log for details",
53                 testCameraManagerCharacteristicsNative());
54     }
55 
testCameraManagerGetAndCloseNative()56     private static native boolean testCameraManagerGetAndCloseNative();
testCameraManagerGetCameraIdsNative()57     private static native boolean testCameraManagerGetCameraIdsNative();
testCameraManagerAvailabilityCallbackNative()58     private static native boolean testCameraManagerAvailabilityCallbackNative();
testCameraManagerCharacteristicsNative()59     private static native boolean testCameraManagerCharacteristicsNative();
60 }
61