1 /*
2  * Copyright (C) 2012 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.renderscriptlegacy.cts;
18 
19 import android.renderscript.RenderScript.RSMessageHandler;
20 import android.renderscript.RSRuntimeException;
21 
22 /**
23  * Test for appropriate handling of versioned bitcode.
24  */
25 public class VersionTest extends RSBaseCompute {
testVersion11()26     public void testVersion11() {
27         ScriptC_set_target_api_11 test11 = new ScriptC_set_target_api_11(mRS);
28         test11.invoke_check(11);
29         waitForMessage();
30         checkForErrors();
31     }
32 
testVersion12()33     public void testVersion12() {
34         ScriptC_set_target_api_12 test12 = new ScriptC_set_target_api_12(mRS);
35         test12.invoke_check(12);
36         waitForMessage();
37         checkForErrors();
38     }
39 
testVersion13()40     public void testVersion13() {
41         ScriptC_set_target_api_13 test13 = new ScriptC_set_target_api_13(mRS);
42         test13.invoke_check(13);
43         waitForMessage();
44         checkForErrors();
45     }
46 
testVersion14()47     public void testVersion14() {
48         ScriptC_set_target_api_14 test14 = new ScriptC_set_target_api_14(mRS);
49         test14.invoke_check(14);
50         waitForMessage();
51         checkForErrors();
52     }
53 
testVersion15()54     public void testVersion15() {
55         ScriptC_set_target_api_15 test15 = new ScriptC_set_target_api_15(mRS);
56         test15.invoke_check(15);
57         waitForMessage();
58         checkForErrors();
59     }
60 
testVersion16()61     public void testVersion16() {
62         ScriptC_set_target_api_16 test16 = new ScriptC_set_target_api_16(mRS);
63         test16.invoke_check(16);
64         waitForMessage();
65         checkForErrors();
66     }
67 
testVersion17()68     public void testVersion17() {
69         ScriptC_set_target_api_17 test17 = new ScriptC_set_target_api_17(mRS);
70         test17.invoke_check(17);
71         waitForMessage();
72         checkForErrors();
73     }
74 
testVersion18()75     public void testVersion18() {
76         ScriptC_set_target_api_18 test18 = new ScriptC_set_target_api_18(mRS);
77         test18.invoke_check(18);
78         waitForMessage();
79         checkForErrors();
80     }
81 
testVersion19()82     public void testVersion19() {
83         ScriptC_set_target_api_19 test19 = new ScriptC_set_target_api_19(mRS);
84         test19.invoke_check(19);
85         waitForMessage();
86         checkForErrors();
87     }
88 
testVersion_too_high()89     public void testVersion_too_high() {
90         try {
91             ScriptC_set_target_api_too_high test_too_high =
92                     new ScriptC_set_target_api_too_high(mRS);
93             fail("should throw RSRuntimeException");
94         } catch (RSRuntimeException e) {
95         }
96         checkForErrors();
97     }
98 }
99