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    (void) matrix4x4TestLocal;
26    (void) matrix3x3TestLocal;
27    (void) matrix2x2TestLocal;
28
29    // This test focuses primarily on compilation-time, not run-time.
30    rs_element elementTestLocal;
31    rs_type typeTestLocal;
32    rs_allocation allocationTestLocal;
33    rs_sampler samplerTestLocal;
34    rs_script scriptTestLocal;
35    (void) elementTestLocal;
36    (void) typeTestLocal;
37    (void) allocationTestLocal;
38    (void) samplerTestLocal;
39    (void) scriptTestLocal;
40
41    struct my_struct structTest;
42    (void) structTest;
43
44    //allocationTestLocal = allocationTest;
45
46    //allocationTest = allocationTestLocal;
47
48    /*for (int i = 0; i < 4; i++) {
49        fontTestLocalArray[i] = fontTestLocal;
50    }*/
51
52    /*fontTest = fontTestLocalArray[3];*/
53
54    return failed;
55}
56
57void test_rstypes(uint32_t index, int test_num) {
58    bool failed = false;
59    failed |= basic_test(index);
60
61    if (failed) {
62        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
63        rsDebug("rstypes_test FAILED", -1);
64    }
65    else {
66        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
67        rsDebug("rstypes_test PASSED", 0);
68    }
69}
70
71