1/*
2 * Copyright (C) 2017 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
17package com.android.rs.unittest;
18
19import android.content.Context;
20import android.renderscript.Allocation;
21import android.renderscript.Element;
22import android.renderscript.RenderScript;
23import android.renderscript.Type;
24
25public class UT_static_globals extends UnitTest {
26
27    public UT_static_globals(Context ctx) {
28        super("Static Globals", ctx);
29    }
30
31    public void run() {
32        RenderScript pRS = createRenderScript(true);
33        ScriptC_static_globals s = new ScriptC_static_globals(pRS);
34        Type.Builder typeBuilder = new Type.Builder(pRS, Element.I32(pRS));
35        Type t = typeBuilder.setX(1).create();
36        Allocation A = Allocation.createTyped(pRS, t);
37        s.forEach_root(A);
38        s.invoke_static_globals_test();
39        pRS.finish();
40        A.destroy();
41        t.destroy();
42        s.destroy();
43        pRS.destroy();
44    }
45}
46