Home | History | Annotate | Download | only in test
      1 #include "shared.rsh"
      2 #include "rs_graphics.rsh"
      3 
      4 rs_element elementTest;
      5 rs_type typeTest;
      6 rs_allocation allocationTest;
      7 rs_sampler samplerTest;
      8 rs_script scriptTest;
      9 rs_mesh meshTest;
     10 rs_program_fragment program_fragmentTest;
     11 rs_program_vertex program_vertexTest;
     12 rs_program_raster program_rasterTest;
     13 rs_program_store program_storeTest;
     14 rs_font fontTest;
     15 
     16 rs_matrix4x4 matrix4x4Test;
     17 rs_matrix3x3 matrix3x3Test;
     18 rs_matrix2x2 matrix2x2Test;
     19 
     20 struct my_struct {
     21     int i;
     22     rs_font fontTestStruct;
     23 };
     24 
     25 static bool basic_test(uint32_t index) {
     26     bool failed = false;
     27 
     28     rs_matrix4x4 matrix4x4TestLocal;
     29     rs_matrix3x3 matrix3x3TestLocal;
     30     rs_matrix2x2 matrix2x2TestLocal;
     31 
     32     // This test focuses primarily on compilation-time, not run-time.
     33     rs_element elementTestLocal;
     34     rs_type typeTestLocal;
     35     rs_allocation allocationTestLocal;
     36     rs_sampler samplerTestLocal;
     37     rs_script scriptTestLocal;
     38     rs_mesh meshTestLocal;
     39     rs_program_fragment program_fragmentTestLocal;
     40     rs_program_vertex program_vertexTestLocal;
     41     rs_program_raster program_rasterTestLocal;
     42     rs_program_store program_storeTestLocal;
     43     rs_font fontTestLocal;
     44 
     45     rs_font fontTestLocalArray[4];
     46 
     47     rs_font fontTestLocalPreInit = fontTest;
     48 
     49     struct my_struct structTest;
     50 
     51     rsSetObject(&fontTestLocal, fontTest);
     52     //allocationTestLocal = allocationTest;
     53 
     54     rsSetObject(&fontTest, fontTestLocal);
     55     //allocationTest = allocationTestLocal;
     56 
     57     /*for (int i = 0; i < 4; i++) {
     58         rsSetObject(&fontTestLocalArray[i], fontTestLocal);
     59     }*/
     60 
     61     /*rsSetObject(&fontTest, fontTestLocalArray[3]);*/
     62 
     63     return failed;
     64 }
     65 
     66 void test_rstypes(uint32_t index, int test_num) {
     67     bool failed = false;
     68     failed |= basic_test(index);
     69 
     70     if (failed) {
     71         rsSendToClientBlocking(RS_MSG_TEST_FAILED);
     72         rsDebug("rstypes_test FAILED", -1);
     73     }
     74     else {
     75         rsSendToClientBlocking(RS_MSG_TEST_PASSED);
     76         rsDebug("rstypes_test PASSED", 0);
     77     }
     78 }
     79 
     80