Home | History | Annotate | Download | only in cts
      1 #include "shared.rsh"
      2 
      3 int *a;
      4 rs_allocation aRaw;
      5 int dimX;
      6 int dimY;
      7 static bool failed = false;
      8 
      9 void foo(const int *in, int *out, uint32_t x, uint32_t y) {
     10     *out = 99 + x + y * dimX;
     11 }
     12 
     13 static bool test_foo_output() {
     14     bool failed = false;
     15     int i, j;
     16 
     17     for (j = 0; j < dimY; j++) {
     18         for (i = 0; i < dimX; i++) {
     19             int v = rsGetElementAt_int(aRaw, i, j);
     20             _RS_ASSERT(v == (99 + i + j * dimX));
     21         }
     22     }
     23 
     24     if (failed) {
     25         rsDebug("test_foo_output FAILED", 0);
     26     }
     27     else {
     28         rsDebug("test_foo_output PASSED", 0);
     29     }
     30 
     31     return failed;
     32 }
     33 
     34 void verify_foo() {
     35     failed |= test_foo_output();
     36 }
     37 
     38 void noroot_test() {
     39     if (failed) {
     40         rsSendToClientBlocking(RS_MSG_TEST_FAILED);
     41     }
     42     else {
     43         rsSendToClientBlocking(RS_MSG_TEST_PASSED);
     44     }
     45 }
     46 
     47