Fix yuv too strict
bug: 21037163

Change-Id: I09a7829e57a0adeae3a75bdecbd1325a1a470136
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java b/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
index 5cdfe95..e162d1d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
@@ -97,11 +97,11 @@
         Allocation ta = Allocation.createSized(mRS, Element.U8(mRS), tmp.length);
         ta.copyFrom(tmp);
 
-
         ScriptIntrinsicYuvToRGB syuv = ScriptIntrinsicYuvToRGB.create(mRS, Element.U8(mRS));
         syuv.setInput(ta);
         syuv.forEach(aout);
-
+        
+        mVerify.set_gAllowedIntError(2); // this will allow for less strict implementation
         ScriptC_yuv script = new ScriptC_yuv(mRS);
         script.invoke_makeRef(ay, au, av, aref);
 
@@ -141,7 +141,8 @@
         }
         ta.copyFrom(tmp);
         script.invoke_makeRef(ay, au, av, aref);
-
+        
+        mVerify.set_gAllowedIntError(2); // this will allow for less strict implementation
         syuv.setInput(ta);
         syuv.forEach(aout);
         mVerify.invoke_verify(aref, aout, ay);
@@ -186,6 +187,7 @@
         }
         ta.copyFrom(tmp);
         script.invoke_makeRef(ay, au, av, aref);
+        mVerify.set_gAllowedIntError(2); // this will allow for less strict implementation
 
         syuv.setInput(ta);
         syuv.forEach(aout);
@@ -236,6 +238,7 @@
         mVerify.invoke_verify(aref, aout, ay);
 
         mRS.finish();
+        mVerify.set_gAllowedFloatError(0.01f); // this will allow for less strict implementation
         mVerify.invoke_checkError();
         waitForMessage();
         checkForErrors();
@@ -266,11 +269,13 @@
             tmp[i++] = bv[j];
             tmp[i++] = bu[j];
         }
+
         ta.copyFrom(tmp);
         script.invoke_makeRef_f4(ay, au, av, aref);
 
         script.set_mInput(ta);
         script.forEach_cvt_f4(aout);
+        mVerify.set_gAllowedFloatError(0.01f); // this will allow for less strict implementation
         mVerify.invoke_verify(aref, aout, ay);
 
         mRS.finish();
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/verify.rs b/tests/tests/renderscript/src/android/renderscript/cts/verify.rs
index 3563fee..fb9e312 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/verify.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/verify.rs
@@ -17,12 +17,13 @@
 #include "shared.rsh"
 
 int gAllowedIntError = 0;
+float gAllowedFloatError = 0.0001f;
 static bool hadError = false;
 static int2 errorLoc = {0,0};
 
 
 static bool compare_float(float f1, float f2) {
-    if (fabs(f1-f2) > 0.0001f) {
+    if (fabs(f1-f2) > gAllowedFloatError) {
         hadError = true;
         return false;
     }