1#pragma version(1) 2 3#pragma rs java_package_name(com.android.rs.test_v14) 4 5typedef struct TestResult_s { 6 rs_allocation name; 7 bool pass; 8 float score; 9 int64_t time; 10} TestResult; 11//TestResult *g_results; 12 13static int64_t g_time; 14 15static void start(void) { 16 g_time = rsUptimeMillis(); 17} 18 19static float end(uint32_t idx) { 20 int64_t t = rsUptimeMillis() - g_time; 21 //g_results[idx].time = t; 22 //rsDebug("test time", (int)t); 23 return ((float)t) / 1000.f; 24} 25 26#define _RS_ASSERT(b) \ 27do { \ 28 if (!(b)) { \ 29 failed = true; \ 30 rsDebug(#b " FAILED", 0); \ 31 } \ 32\ 33} while (0) 34 35/* These constants must match those in UnitTest.java */ 36static const int RS_MSG_TEST_PASSED = 100; 37static const int RS_MSG_TEST_FAILED = 101; 38 39