• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 package android.mediav2.cts;
18 
19 import static org.junit.Assert.assertTrue;
20 
21 import androidx.test.filters.SmallTest;
22 import androidx.test.runner.AndroidJUnit4;
23 
24 import org.junit.Rule;
25 import org.junit.Test;
26 import org.junit.rules.Timeout;
27 import org.junit.runner.RunWith;
28 
29 import java.util.concurrent.TimeUnit;
30 
31 @SmallTest
32 @RunWith(AndroidJUnit4.class)
33 public class MediaFormatUnitTest {
34     static final int PER_TEST_TIMEOUT_MS = 10000;
35 
36     static {
37         System.loadLibrary("ctsmediav2utils_jni");
38     }
39 
40     @Rule
41     public Timeout timeout = new Timeout(PER_TEST_TIMEOUT_MS, TimeUnit.MILLISECONDS);
42 
43     @Test
testMediaFormatNativeInt32()44     public void testMediaFormatNativeInt32() {
45         assertTrue(nativeTestMediaFormatInt32());
46     }
47 
nativeTestMediaFormatInt32()48     private native boolean nativeTestMediaFormatInt32();
49 
50     @Test
testMediaFormatNativeInt64()51     public void testMediaFormatNativeInt64() {
52         assertTrue(nativeTestMediaFormatInt64());
53     }
54 
nativeTestMediaFormatInt64()55     private native boolean nativeTestMediaFormatInt64();
56 
57     @Test
testMediaFormatNativeFloat()58     public void testMediaFormatNativeFloat() {
59         assertTrue(nativeTestMediaFormatFloat());
60     }
61 
nativeTestMediaFormatFloat()62     private native boolean nativeTestMediaFormatFloat();
63 
64     @Test
testMediaFormatNativeDouble()65     public void testMediaFormatNativeDouble() {
66         assertTrue(nativeTestMediaFormatDouble());
67     }
68 
nativeTestMediaFormatDouble()69     private native boolean nativeTestMediaFormatDouble();
70 
71     @Test
testMediaFormatNativeSize()72     public void testMediaFormatNativeSize() {
73         assertTrue(nativeTestMediaFormatSize());
74     }
75 
nativeTestMediaFormatSize()76     private native boolean nativeTestMediaFormatSize();
77 
78     @Test
testMediaFormatNativeString()79     public void testMediaFormatNativeString() {
80         assertTrue(nativeTestMediaFormatString());
81     }
82 
nativeTestMediaFormatString()83     private native boolean nativeTestMediaFormatString();
84 
85     @Test
testMediaFormatNativeRect()86     public void testMediaFormatNativeRect() {
87         assertTrue(nativeTestMediaFormatRect());
88     }
89 
nativeTestMediaFormatRect()90     private native boolean nativeTestMediaFormatRect();
91 
92     @Test
testMediaFormatNativeBuffer()93     public void testMediaFormatNativeBuffer() {
94         assertTrue(nativeTestMediaFormatBuffer());
95     }
96 
nativeTestMediaFormatBuffer()97     private native boolean nativeTestMediaFormatBuffer();
98 
99     @Test
testMediaFormatNativeAll()100     public void testMediaFormatNativeAll() {
101         assertTrue(nativeTestMediaFormatAll());
102     }
103 
nativeTestMediaFormatAll()104     private native boolean nativeTestMediaFormatAll();
105 }
106