diff options
Diffstat (limited to 'java/tests/RsTest/src')
6 files changed, 23 insertions, 42 deletions
diff --git a/java/tests/RsTest/src/com/android/rs/test/element.rs b/java/tests/RsTest/src/com/android/rs/test/element.rs index 419ce074..95b29a31 100644 --- a/java/tests/RsTest/src/com/android/rs/test/element.rs +++ b/java/tests/RsTest/src/com/android/rs/test/element.rs @@ -57,14 +57,6 @@ static uint32_t subElemArraySizes[] = { 1, }; -static void resetStruct() { - uint8_t *bytePtr = (uint8_t*)complexStruct; - uint32_t sizeOfStruct = sizeof(*complexStruct); - for(uint32_t i = 0; i < sizeOfStruct; i ++) { - bytePtr[i] = 0; - } -} - static bool equals(const char *name0, const char * name1, uint32_t len) { for (uint32_t i = 0; i < len; i ++) { if (name0[i] != name1[i]) { diff --git a/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs b/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs index b6f2b2a6..62ef3ecf 100644 --- a/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs +++ b/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs @@ -8,7 +8,6 @@ static float4 data_f4[1025]; static void test_mad4(uint32_t index) { start(); - float total = 0; // Do ~1 billion ops for (int ct=0; ct < 1000 * (1000 / 80); ct++) { for (int i=0; i < (1000); i++) { @@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) { static void test_mad(uint32_t index) { start(); - float total = 0; // Do ~1 billion ops for (int ct=0; ct < 1000 * (1000 / 20); ct++) { for (int i=0; i < (1000); i++) { @@ -56,7 +54,6 @@ static void test_mad(uint32_t index) { static void test_norm(uint32_t index) { start(); - float total = 0; // Do ~10 M ops for (int ct=0; ct < 1000 * 10; ct++) { for (int i=0; i < (1000); i++) { @@ -71,7 +68,6 @@ static void test_norm(uint32_t index) { static void test_sincos4(uint32_t index) { start(); - float total = 0; // Do ~10 M ops for (int ct=0; ct < 1000 * 10 / 4; ct++) { for (int i=0; i < (1000); i++) { @@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) { static void test_sincos(uint32_t index) { start(); - float total = 0; // Do ~10 M ops for (int ct=0; ct < 1000 * 10; ct++) { for (int i=0; i < (1000); i++) { @@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) { static void test_clamp4(uint32_t index) { start(); - float total = 0; // Do ~100 M ops for (int ct=0; ct < 1000 * 100 /4; ct++) { for (int i=0; i < (1000); i++) { @@ -170,5 +164,3 @@ void fp_mad_test(uint32_t index, int test_num) { rsDebug("fp_mad_test PASSED", 0); rsSendToClientBlocking(RS_MSG_TEST_PASSED); } - - diff --git a/java/tests/RsTest/src/com/android/rs/test/math.rs b/java/tests/RsTest/src/com/android/rs/test/math.rs index 2c0521bf..f3eac553 100644 --- a/java/tests/RsTest/src/com/android/rs/test/math.rs +++ b/java/tests/RsTest/src/com/android/rs/test/math.rs @@ -355,7 +355,7 @@ static bool test_int_math(uint32_t index) { TEST_IN_FUNC_IN(clz); TEST_IN_FUNC_IN_IN(min); TEST_IN_FUNC_IN_IN(max); - TEST_I_FUNC_I_I_I(rsClamp); + TEST_I_FUNC_I_I_I(clamp); float time = end(index); @@ -442,4 +442,3 @@ void math_test(uint32_t index, int test_num) { rsSendToClientBlocking(RS_MSG_TEST_PASSED); } } - diff --git a/java/tests/RsTest/src/com/android/rs/test/math_agree.rs b/java/tests/RsTest/src/com/android/rs/test/math_agree.rs index 5bfbb2bf..489cc277 100644 --- a/java/tests/RsTest/src/com/android/rs/test/math_agree.rs +++ b/java/tests/RsTest/src/com/android/rs/test/math_agree.rs @@ -343,13 +343,9 @@ TEST_UC_UC_ALL(func) \ TEST_SS_SS_ALL(func) \ TEST_US_US_ALL(func) \ TEST_SI_SI_ALL(func) \ -TEST_UI_UI_ALL(func) - -// TODO: add long types to ALL macro -#if 0 +TEST_UI_UI_ALL(func) \ TEST_SL_SL_ALL(func) \ TEST_UL_UL_ALL(func) -#endif #define DECLARE_TEMP_SET(type, abbrev) \ volatile type temp_##abbrev##1; \ @@ -406,4 +402,3 @@ void math_agree_test() { rsSendToClientBlocking(RS_MSG_TEST_PASSED); } } - diff --git a/java/tests/RsTest/src/com/android/rs/test/rstypes.rs b/java/tests/RsTest/src/com/android/rs/test/rstypes.rs index bec124dd..088fe508 100644 --- a/java/tests/RsTest/src/com/android/rs/test/rstypes.rs +++ b/java/tests/RsTest/src/com/android/rs/test/rstypes.rs @@ -22,6 +22,9 @@ static bool basic_test(uint32_t index) { rs_matrix4x4 matrix4x4TestLocal; rs_matrix3x3 matrix3x3TestLocal; rs_matrix2x2 matrix2x2TestLocal; + (void) matrix4x4TestLocal; + (void) matrix3x3TestLocal; + (void) matrix2x2TestLocal; // This test focuses primarily on compilation-time, not run-time. rs_element elementTestLocal; @@ -29,12 +32,14 @@ static bool basic_test(uint32_t index) { rs_allocation allocationTestLocal; rs_sampler samplerTestLocal; rs_script scriptTestLocal; + (void) elementTestLocal; + (void) typeTestLocal; + (void) allocationTestLocal; + (void) samplerTestLocal; + (void) scriptTestLocal; struct my_struct structTest; - - //allocationTestLocal = allocationTest; - - //allocationTest = allocationTestLocal; + (void) structTest; /*for (int i = 0; i < 4; i++) { fontTestLocalArray[i] = fontTestLocal; @@ -58,4 +63,3 @@ void test_rstypes(uint32_t index, int test_num) { rsDebug("rstypes_test PASSED", 0); } } - diff --git a/java/tests/RsTest/src/com/android/rs/test/shared.rsh b/java/tests/RsTest/src/com/android/rs/test/shared.rsh index 0281383b..de7135cc 100644 --- a/java/tests/RsTest/src/com/android/rs/test/shared.rsh +++ b/java/tests/RsTest/src/com/android/rs/test/shared.rsh @@ -12,11 +12,11 @@ typedef struct TestResult_s { static int64_t g_time; -static void start(void) { +static inline void start(void) { g_time = rsUptimeMillis(); } -static float end(uint32_t idx) { +static inline float end(uint32_t idx) { int64_t t = rsUptimeMillis() - g_time; //g_results[idx].time = t; //rsDebug("test time", (int)t); @@ -38,42 +38,42 @@ do { \ static const int iposinf = 0x7f800000; static const int ineginf = 0xff800000; -static const float posinf() { +static inline const float posinf() { float f = *((float*)&iposinf); return f; } -static const float neginf() { +static inline const float neginf() { float f = *((float*)&ineginf); return f; } -static bool isposinf(float f) { +static inline bool isposinf(float f) { int i = *((int*)(void*)&f); return (i == iposinf); } -static bool isneginf(float f) { +static inline bool isneginf(float f) { int i = *((int*)(void*)&f); return (i == ineginf); } -static bool isnan(float f) { +static inline bool isnan(float f) { int i = *((int*)(void*)&f); return (((i & 0x7f800000) == 0x7f800000) && (i & 0x007fffff)); } -static bool isposzero(float f) { +static inline bool isposzero(float f) { int i = *((int*)(void*)&f); return (i == 0x00000000); } -static bool isnegzero(float f) { +static inline bool isnegzero(float f) { int i = *((int*)(void*)&f); return (i == 0x80000000); } -static bool iszero(float f) { +static inline bool iszero(float f) { return isposzero(f) || isnegzero(f); } @@ -87,13 +87,13 @@ static bool iszero(float f) { /* Calculate the difference in ULPs between the two values. (Return zero on perfect equality.) */ -static int float_dist(float f1, float f2) { +static inline int float_dist(float f1, float f2) { return *((int *)(&f1)) - *((int *)(&f2)); } /* Check if two floats are essentially equal. Will fail with some values due to design. (Validate using FLT_EPSILON or similar if necessary.) */ -static bool float_almost_equal(float f1, float f2) { +static inline bool float_almost_equal(float f1, float f2) { int *i1 = (int*)(&f1); int *i2 = (int*)(&f2); @@ -114,4 +114,3 @@ static bool float_almost_equal(float f1, float f2) { /* These constants must match those in UnitTest.java */ static const int RS_MSG_TEST_PASSED = 100; static const int RS_MSG_TEST_FAILED = 101; - |