Update CPP test to use new APIs.

Change-Id: Ic4eff0e3c3dc826d1e0b5edbd7fe56dd335b8634
diff --git a/tests/Android.mk b/tests/Android.mk
index ff945f1..5c2c53a 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -2,13 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-	compute.cpp \
-
-LOCAL_RS_CPP_FILES:= \
-	mono.rs
-
-#LOCAL_GENERATED_SOURCES := \
-#	rawScriptC_mono.cpp
+	mono.rs \
+	compute.cpp
 
 LOCAL_SHARED_LIBRARIES := \
 	libRS \
@@ -29,10 +24,6 @@
 LOCAL_MODULE_TAGS := tests
 
 intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
-#librs_generated_headers := \
-#    $(intermediates)/rsgApiStructs.h \
-#    $(intermediates)/rsgApiFuncDecl.h
-#LOCAL_GENERATED_SOURCES := $(librs_generated_headers)
 
 LOCAL_C_INCLUDES += frameworks/rs/cpp
 LOCAL_C_INCLUDES += frameworks/rs
diff --git a/tests/compute.cpp b/tests/compute.cpp
index 8c390db..fef116f 100644
--- a/tests/compute.cpp
+++ b/tests/compute.cpp
@@ -1,8 +1,5 @@
 
 #include "RenderScript.h"
-#include "Element.h"
-#include "Type.h"
-#include "Allocation.h"
 
 #include "ScriptC_mono.h"
 
@@ -12,10 +9,10 @@
 int main(int argc, char** argv)
 {
 
-    RenderScript *rs = new RenderScript();
-    printf("New RS %p\n", rs);
+    sp<RS> rs = new RS();
+    printf("New RS %p\n", rs.get());
 
-    bool r = rs->init(16);
+    bool r = rs->init();
     printf("Init returned %i\n", r);
 
     sp<const Element> e = Element::RGBA_8888(rs);
@@ -45,12 +42,9 @@
     //ain->copy1DRangeFrom(0, 128*128, (int32_t *)buf, 128*128*4);
     ain->copy1DRangeFromUnchecked(0, t->getCount(), buf, t->getCount()*4);
 
-
-
     sc->forEach_root(ain, aout);
     printf("for each done\n");
 
-
     printf("Deleting stuff\n");
     sc.clear();
     t.clear();
@@ -58,6 +52,6 @@
     e.clear();
     ain.clear();
     aout.clear();
-    delete rs;
+    //    delete rs;
     printf("Delete OK\n");
 }