Fix up C++ basic API test

Change-Id: I80cd8d74e7b12c2097da5b16725dbbd3c079573c
diff --git a/tests/Android.mk b/tests/Android.mk
index 2263733..ff945f1 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -3,7 +3,12 @@
 
 LOCAL_SRC_FILES:= \
 	compute.cpp \
-	ScriptC_mono.cpp
+
+LOCAL_RS_CPP_FILES:= \
+	mono.rs
+
+#LOCAL_GENERATED_SOURCES := \
+#	rawScriptC_mono.cpp
 
 LOCAL_SHARED_LIBRARIES := \
 	libRS \
@@ -24,10 +29,10 @@
 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)
+#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 351627b..8c390db 100644
--- a/tests/compute.cpp
+++ b/tests/compute.cpp
@@ -56,6 +56,8 @@
     t.clear();
     a1.clear();
     e.clear();
+    ain.clear();
+    aout.clear();
     delete rs;
     printf("Delete OK\n");
 }
diff --git a/tests/mono.rs b/tests/mono.rs
new file mode 100644
index 0000000..c420cac
--- /dev/null
+++ b/tests/mono.rs
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(com.android.rs.image)
+#pragma rs_fp_relaxed
+
+const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
+
+void root(const uchar4 *v_in, uchar4 *v_out) {
+    float4 f4 = rsUnpackColor8888(*v_in);
+
+    float3 mono = dot(f4.rgb, gMonoMult);
+    *v_out = rsPackColorTo8888(mono);
+}
+
+