Loading tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_alloc.java +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class UT_alloc extends UnitTest { typeBuilder.setX(X).setY(Y); Allocation A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); typeBuilder = new Type.Builder(RS, Element.I32(RS)); typeBuilder.setX(X).setY(Y).setFaces(true); Loading @@ -59,6 +60,7 @@ public class UT_alloc extends UnitTest { ScriptC_alloc s = new ScriptC_alloc(pRS); pRS.setMessageHandler(mRsMessage); initializeGlobals(pRS, s); s.forEach_root(s.get_aRaw()); s.invoke_alloc_test(); pRS.finish(); waitForMessage(); Loading tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_foreach.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_foreach extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); return; } Loading tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_foreach_bounds.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_foreach_bounds extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); s.set_s(s); s.set_ain(A); s.set_aout(A); Loading tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_noroot.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_noroot extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); return; } Loading tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/alloc.rs +12 −14 Original line number Diff line number Diff line Loading @@ -5,39 +5,37 @@ int dimX; int dimY; int dimZ; rs_allocation aRaw; rs_allocation aFaces; rs_allocation aLOD; rs_allocation aFacesLOD; void root(int *o, uint32_t x, uint32_t y) { *o = x + y * dimX; } static bool test_alloc_dims() { bool failed = false; int i, j; for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { a[i + j * dimX] = i + j * dimX; } } rs_allocation alloc = rsGetAllocation(a); _RS_ASSERT(rsAllocationGetDimX(alloc) == dimX); _RS_ASSERT(rsAllocationGetDimY(alloc) == dimY); _RS_ASSERT(rsAllocationGetDimZ(alloc) == dimZ); _RS_ASSERT(rsAllocationGetDimX(aRaw) == dimX); _RS_ASSERT(rsAllocationGetDimY(aRaw) == dimY); _RS_ASSERT(rsAllocationGetDimZ(aRaw) == dimZ); // Test 2D addressing for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i + j * dimX); const void *p = rsGetElementAt(alloc, i, j); const void *p = rsGetElementAt(aRaw, i, j); int val = *(const int *)p; _RS_ASSERT(val == (i + j * dimX)); } } // Test 1D addressing for (i = 0; i < dimX * dimY; i++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i); const void *p = rsGetElementAt(alloc, i); const void *p = rsGetElementAt(aRaw, i); int val = *(const int *)p; _RS_ASSERT(val == i); } Loading @@ -46,7 +44,7 @@ static bool test_alloc_dims() { for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i + j * dimX); const void *p = rsGetElementAt(alloc, i, j, 0); const void *p = rsGetElementAt(aRaw, i, j, 0); int val = *(const int *)p; _RS_ASSERT(val == (i + j * dimX)); } Loading Loading
tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_alloc.java +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class UT_alloc extends UnitTest { typeBuilder.setX(X).setY(Y); Allocation A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); typeBuilder = new Type.Builder(RS, Element.I32(RS)); typeBuilder.setX(X).setY(Y).setFaces(true); Loading @@ -59,6 +60,7 @@ public class UT_alloc extends UnitTest { ScriptC_alloc s = new ScriptC_alloc(pRS); pRS.setMessageHandler(mRsMessage); initializeGlobals(pRS, s); s.forEach_root(s.get_aRaw()); s.invoke_alloc_test(); pRS.finish(); waitForMessage(); Loading
tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_foreach.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_foreach extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); return; } Loading
tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_foreach_bounds.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_foreach_bounds extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); s.set_s(s); s.set_ain(A); s.set_aout(A); Loading
tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/UT_noroot.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class UT_noroot extends UnitTest { s.set_dimY(Y); typeBuilder.setX(X).setY(Y); A = Allocation.createTyped(RS, typeBuilder.create()); s.bind_a(A); s.set_aRaw(A); return; } Loading
tests/RenderScriptTests/RSTest_CompatLib/src/com/android/rs/test/alloc.rs +12 −14 Original line number Diff line number Diff line Loading @@ -5,39 +5,37 @@ int dimX; int dimY; int dimZ; rs_allocation aRaw; rs_allocation aFaces; rs_allocation aLOD; rs_allocation aFacesLOD; void root(int *o, uint32_t x, uint32_t y) { *o = x + y * dimX; } static bool test_alloc_dims() { bool failed = false; int i, j; for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { a[i + j * dimX] = i + j * dimX; } } rs_allocation alloc = rsGetAllocation(a); _RS_ASSERT(rsAllocationGetDimX(alloc) == dimX); _RS_ASSERT(rsAllocationGetDimY(alloc) == dimY); _RS_ASSERT(rsAllocationGetDimZ(alloc) == dimZ); _RS_ASSERT(rsAllocationGetDimX(aRaw) == dimX); _RS_ASSERT(rsAllocationGetDimY(aRaw) == dimY); _RS_ASSERT(rsAllocationGetDimZ(aRaw) == dimZ); // Test 2D addressing for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i + j * dimX); const void *p = rsGetElementAt(alloc, i, j); const void *p = rsGetElementAt(aRaw, i, j); int val = *(const int *)p; _RS_ASSERT(val == (i + j * dimX)); } } // Test 1D addressing for (i = 0; i < dimX * dimY; i++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i); const void *p = rsGetElementAt(alloc, i); const void *p = rsGetElementAt(aRaw, i); int val = *(const int *)p; _RS_ASSERT(val == i); } Loading @@ -46,7 +44,7 @@ static bool test_alloc_dims() { for (j = 0; j < dimY; j++) { for (i = 0; i < dimX; i++) { rsDebug("Verifying ", i + j * dimX); const void *p = rsGetElementAt(alloc, i, j, 0); const void *p = rsGetElementAt(aRaw, i, j, 0); int val = *(const int *)p; _RS_ASSERT(val == (i + j * dimX)); } Loading