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
19#include "shared.rsh"
20#include "rs_graphics.rsh"
21
22rs_element elementTest;
23rs_type typeTest;
24rs_allocation allocationTest;
25rs_sampler samplerTest;
26rs_script scriptTest;
27
28rs_matrix4x4 matrix4x4Test;
29rs_matrix3x3 matrix3x3Test;
30rs_matrix2x2 matrix2x2Test;
31
32struct my_struct {
33    int i;
34    rs_allocation banana;
35};
36
37static bool basic_test(uint32_t index) {
38    bool failed = false;
39
40    rs_matrix4x4 matrix4x4TestLocal;
41    rs_matrix3x3 matrix3x3TestLocal;
42    rs_matrix2x2 matrix2x2TestLocal;
43    (void) matrix4x4TestLocal;
44	(void) matrix3x3TestLocal;
45    (void) matrix2x2TestLocal;
46
47    // This test focuses primarily on compilation-time, not run-time.
48    rs_element elementTestLocal;
49    rs_type typeTestLocal;
50    rs_allocation allocationTestLocal;
51    rs_sampler samplerTestLocal;
52    rs_script scriptTestLocal;
53    (void) elementTestLocal;
54    (void) typeTestLocal;
55    (void) allocationTestLocal;
56    (void) samplerTestLocal;
57    (void) scriptTestLocal;
58
59    struct my_struct structTest;
60    (void) structTest;
61
62    /*for (int i = 0; i < 4; i++) {
63        fontTestLocalArray[i] = fontTestLocal;
64    }*/
65
66    /*fontTest = fontTestLocalArray[3];*/
67
68    return failed;
69}
70
71void test_rstypes(uint32_t index, int test_num) {
72    bool failed = false;
73    failed |= basic_test(index);
74
75    if (failed) {
76        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
77        rsDebug("rstypes_test FAILED", -1);
78    }
79    else {
80        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
81        rsDebug("rstypes_test PASSED", 0);
82    }
83}
84