diff options
Diffstat (limited to 'tests/cppbasic/compute.cpp')
| -rw-r--r-- | tests/cppbasic/compute.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/cppbasic/compute.cpp b/tests/cppbasic/compute.cpp index d9776677..96aa324a 100644 --- a/tests/cppbasic/compute.cpp +++ b/tests/cppbasic/compute.cpp @@ -6,9 +6,8 @@ using namespace android; using namespace RSC; -int main() +int test_compute() { - sp<RS> rs = new RS(); printf("New RS %p\n", rs.get()); @@ -32,9 +31,17 @@ int main() sp<Allocation> aout = Allocation::createTyped(rs, t); printf("Allocation %p %p\n", ain.get(), aout.get()); - ScriptC_mono* sc = new ScriptC_mono(rs); + sp<ScriptC_mono> sc = new ScriptC_mono(rs); printf("new script\n"); + sc->set_alloc(a1); + sc->set_elem(e); + sc->set_type(t); + sc->set_script(sc); + sc->set_script(NULL); + sp<const Sampler> samp = Sampler::CLAMP_NEAREST(rs); + sc->set_sampler(samp); + // We read back the status from the script-side via a "failed" allocation. sp<const Element> failed_e = Element::BOOLEAN(rs); Type::Builder failed_tb(rs, failed_e); @@ -88,9 +95,11 @@ int main() failed_alloc->copy1DTo(&failed); } - printf("Deleting stuff\n"); - delete sc; - printf("Delete OK\n"); + return failed; +} + +int main() { + bool failed = test_compute(); if (failed) { printf("TEST FAILED!\n"); |
