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