1#include "shared.rsh"
2#include "rs_graphics.rsh"
3
4rs_element elementTest;
5rs_type typeTest;
6rs_allocation allocationTest;
7rs_sampler samplerTest;
8rs_script scriptTest;
9
10rs_matrix4x4 matrix4x4Test;
11rs_matrix3x3 matrix3x3Test;
12rs_matrix2x2 matrix2x2Test;
13
14struct my_struct {
15    int i;
16    rs_allocation banana;
17};
18
19static bool basic_test(uint32_t index) {
20    bool failed = false;
21
22    rs_matrix4x4 matrix4x4TestLocal;
23    rs_matrix3x3 matrix3x3TestLocal;
24    rs_matrix2x2 matrix2x2TestLocal;
25
26    // This test focuses primarily on compilation-time, not run-time.
27    rs_element elementTestLocal;
28    rs_type typeTestLocal;
29    rs_allocation allocationTestLocal;
30    rs_sampler samplerTestLocal;
31    rs_script scriptTestLocal;
32
33    struct my_struct structTest;
34
35    //allocationTestLocal = allocationTest;
36
37    //allocationTest = allocationTestLocal;
38
39    /*for (int i = 0; i < 4; i++) {
40        fontTestLocalArray[i] = fontTestLocal;
41    }*/
42
43    /*fontTest = fontTestLocalArray[3];*/
44
45    return failed;
46}
47
48void test_rstypes(uint32_t index, int test_num) {
49    bool failed = false;
50    failed |= basic_test(index);
51
52    if (failed) {
53        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
54        rsDebug("rstypes_test FAILED", -1);
55    }
56    else {
57        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
58        rsDebug("rstypes_test PASSED", 0);
59    }
60}
61
62