1 /* 2 * Copyright 2016 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.hardware.camera2.cts.testcases.Camera2AndroidTestCase; 20 import android.util.Log; 21 22 /** 23 * <p>Basic test for CameraManager class.</p> 24 */ 25 public class NativeImageReaderTest extends Camera2AndroidTestCase { 26 private static final String TAG = "NativeImageReaderTest"; 27 private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE); 28 29 /** Load jni on initialization */ 30 static { 31 Log.i("NativeImageReaderTest", "before loadlibrary"); 32 System.loadLibrary("ctscamera2_jni"); 33 Log.i("NativeImageReaderTest", "after loadlibrary"); 34 } 35 testJpeg()36 public void testJpeg() { 37 assertTrue("testJpeg fail, see log for details", 38 testJpegNative(mDebugFileNameBase)); 39 } 40 testY8()41 public void testY8() { 42 assertTrue("testY8 fail, see log for details", 43 testY8Native(mDebugFileNameBase)); 44 } 45 testHeic()46 public void testHeic() { 47 assertTrue("testHeic fail, see log for details", 48 testHeicNative(mDebugFileNameBase)); 49 } 50 testDepthJpeg()51 public void testDepthJpeg() { 52 assertTrue("testDepthJpeg fail, see log for details", 53 testDepthJpegNative(mDebugFileNameBase)); 54 } 55 testImageReaderCloseAcquiredImages()56 public void testImageReaderCloseAcquiredImages() { 57 assertTrue("testImageReaderClose fail, see log for details", 58 testImageReaderCloseAcquiredImagesNative()); 59 } 60 testJpegNative(String filePath)61 private static native boolean testJpegNative(String filePath); testY8Native(String filePath)62 private static native boolean testY8Native(String filePath); testHeicNative(String filePath)63 private static native boolean testHeicNative(String filePath); testDepthJpegNative(String filePath)64 private static native boolean testDepthJpegNative(String filePath); testImageReaderCloseAcquiredImagesNative()65 private static native boolean testImageReaderCloseAcquiredImagesNative(); 66 } 67