FileDocCategorySizeDatePackage
UT_array_alloc.javaAPI DocAndroid 5.1 API1678Thu Mar 12 22:22:54 GMT 2015com.android.rs.test_compat

UT_array_alloc

public class UT_array_alloc extends UnitTest

Fields Summary
private android.content.res.Resources
mRes
Constructors Summary
protected UT_array_alloc(RSTestCore rstc, android.content.res.Resources res, android.content.Context ctx)

        super(rstc, "Array Allocation", ctx);
        mRes = res;
    
Methods Summary
public voidrun()

        RenderScript pRS = RenderScript.create(mCtx);
        ScriptC_array_alloc s = new ScriptC_array_alloc(pRS);
        pRS.setMessageHandler(mRsMessage);

        int dimX = s.get_dimX();
        Allocation[] Arr = new Allocation[dimX];
        Type.Builder typeBuilder = new Type.Builder(pRS, Element.I32(pRS));
        Type T = typeBuilder.setX(1).create();
        for (int i = 0; i < dimX; i++) {
            Allocation A = Allocation.createTyped(pRS, T);
            Arr[i] = A;
        }
        s.set_a(Arr);

        s.invoke_array_alloc_test();
        pRS.finish();
        waitForMessage();
        pRS.destroy();
        passTest();