1// This file is automatically generated from
2// frameworks/rs/tests/java_api/RSUnitTests/RSUnitTests.py
3/*
4 * Copyright (C) 2017 The Android Open Source Project
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *      http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19package com.android.rs.unittest;
20
21import android.content.Context;
22
23public class UT_constant extends UnitTest {
24
25    public UT_constant(Context ctx) {
26        super("Const", ctx);
27    }
28
29    private void Assert(boolean b) {
30        if (!b) {
31            failTest();
32        }
33    }
34
35    public void run() {
36        Assert(ScriptC_constant.const_floatTest == 1.99f);
37        Assert(ScriptC_constant.const_doubleTest == 2.05);
38        Assert(ScriptC_constant.const_charTest == -8);
39        Assert(ScriptC_constant.const_shortTest == -16);
40        Assert(ScriptC_constant.const_intTest == -32);
41        Assert(ScriptC_constant.const_longTest == 17179869184l);
42        Assert(ScriptC_constant.const_longlongTest == 68719476736l);
43
44        Assert(ScriptC_constant.const_ucharTest == 8);
45        Assert(ScriptC_constant.const_ushortTest == 16);
46        Assert(ScriptC_constant.const_uintTest == 32);
47        Assert(ScriptC_constant.const_ulongTest == 4611686018427387904L);
48        Assert(ScriptC_constant.const_int64_tTest == -17179869184l);
49        Assert(ScriptC_constant.const_uint64_tTest == 117179869184l);
50
51        Assert(ScriptC_constant.const_boolTest == true);
52
53        passTest();
54    }
55}
56