summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstypes.rs
blob: f3bf2448a4f6cdc18e7c0ef8732e4a51e45765ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "shared.rsh"
#include "rs_graphics.rsh"

rs_element elementTest;
rs_type typeTest;
rs_allocation allocationTest;
rs_sampler samplerTest;
rs_script scriptTest;
rs_mesh meshTest;
rs_program_fragment program_fragmentTest;
rs_program_vertex program_vertexTest;
rs_program_raster program_rasterTest;
rs_program_store program_storeTest;
rs_font fontTest;

rs_matrix4x4 matrix4x4Test;
rs_matrix3x3 matrix3x3Test;
rs_matrix2x2 matrix2x2Test;

struct my_struct {
    int i;
    rs_font fontTestStruct;
};

static bool basic_test(uint32_t index) {
    bool failed = false;

    rs_matrix4x4 matrix4x4TestLocal;
    rs_matrix3x3 matrix3x3TestLocal;
    rs_matrix2x2 matrix2x2TestLocal;

    // This test focuses primarily on compilation-time, not run-time.
    rs_element elementTestLocal;
    rs_type typeTestLocal;
    rs_allocation allocationTestLocal;
    rs_sampler samplerTestLocal;
    rs_script scriptTestLocal;
    rs_mesh meshTestLocal;
    rs_program_fragment program_fragmentTestLocal;
    rs_program_vertex program_vertexTestLocal;
    rs_program_raster program_rasterTestLocal;
    rs_program_store program_storeTestLocal;
    rs_font fontTestLocal;

    rs_font fontTestLocalArray[4];

    rs_font fontTestLocalPreInit = fontTest;

    struct my_struct structTest;

    rsSetObject(&fontTestLocal, fontTest);
    //allocationTestLocal = allocationTest;

    rsSetObject(&fontTest, fontTestLocal);
    //allocationTest = allocationTestLocal;

    /*for (int i = 0; i < 4; i++) {
        rsSetObject(&fontTestLocalArray[i], fontTestLocal);
    }*/

    /*rsSetObject(&fontTest, fontTestLocalArray[3]);*/

    return failed;
}

void test_rstypes(uint32_t index, int test_num) {
    bool failed = false;
    failed |= basic_test(index);

    if (failed) {
        rsSendToClientBlocking(RS_MSG_TEST_FAILED);
        rsDebug("rstypes_test FAILED", -1);
    }
    else {
        rsSendToClientBlocking(RS_MSG_TEST_PASSED);
        rsDebug("rstypes_test PASSED", 0);
    }
}