CTS test failed -- Android. Graphics. CTS. yuvimagetest # testcompressyuvtojpeg

Source: Internet
Author: User
From: http://code.google.com/p/android/issues/detail? Id = 11290 reported by udaykira...@gmail.com, SEP 16,201 0
Below test was executed on emulator.cts_host > start test android.graphics.cts.YuvImageTest#testCompressYuvToJpeg==============================================================Test package: android.graphicsandroid.graphics.cts.YuvImageTest#testCompressYuvToJpeg........................(fail)junit.framework.AssertionFailedError: MSE too large for normal case: 850.3241935483871 at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)==============================================================Time: 9388.689s**************************************************************************Second Trial on another PC.============================result for standard android2.2 sdknjred202:/remoterepo/a20234/venus2/sdk_upload/android-cts[1009] $ ./tools/startctsAndroid CTS version 2.2_r2Device(emulator-5554) connectedcts_host > start --plan CTS -t android.graphics.cts.YuvImageTest#testCompressYuvToJpegcts_host > start test android.graphics.cts.YuvImageTest#testCompressYuvToJpeg==============================================================Test package: android.graphicsandroid.graphics.cts.YuvImageTest#testCompressYuvToJpeg....(fail)junit.framework.AssertionFailedError: MSE too large for normal case: 850.3241935483871 at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)==============================================================Time: 2557.41s************************************************************************Third Trial on another PC.============================cts_host >          result for venus2 sdk:njred202:/remoterepo/a20234/venus2/sdk_upload/android-cts[1007] $ ./tools/startctsAndroid CTS version 2.2_r2Device(emulator-5554) connectedcts_host > cts_host > start --plan CTS -t android.graphics.cts.YuvImageTest#testCompressYuvToJpegstart test android.graphics.cts.YuvImageTest#testCompressYuvToJpeg==============================================================Test package: android.graphicsandroid.graphics.cts.YuvImageTest#testCompressYuvToJpeg....(fail)junit.framework.AssertionFailedError: MSE too large for normal case: 849.296370967742 at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)at android.graphics.cts.YuvImageTest.compareBitmaps(YuvImageTest.java:355)at android.graphics.cts.YuvImageTest.compressRects(YuvImageTest.java:251)at android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)==============================================================Time: 1834.855s
Comment 1 by project member e...@google.com, SEP 20,201 0

(No comment was entered for this change.)
Owner:Btm...@android.comComment 2 by khanhlv...@gmail.com, Nov 14,201 0

I also get the same problem.Does anyone have solution and what is the cause?
Comment 3 by myamase...@gmail.com, Nov 14,201 0

Hello.I get the same problem.  I applied the patch (A). So this test passed!(A) http://android.git.kernel.org/?p=platform/cts.git;a=commit;h=cac69966080b824fe6c10a011f7d2658681ae8de
Comment 4 by project member btm...@android.com, Nov 15,201 0

Yes, that patch should fix things. It will included in the next release.
Status:Futurereleasecomment 5 by t4tina...@gmail.com, Nov 15,201 0

android.graphics.cts.YuvImageTest.testCompressYuvToJpeg(YuvImageTest.java:189)at this line we pass two copies of the same rect[l], so effectively the altered code is doing the same job as that of unchanged code..how is this fix solving the issue? 
Comment 6 by project member btm...@android.com, Nov 16,201 0

t4tina007, the compressRects method (line 243) changed to pass in a different argument to compareBitmaps (line 255) depending on whether or not the rect1 and rect2 arguments passed to compressRects was the same.Beyond that, I can't tell you much, since this is not my area of expertise. However, here is what the reviewer commented before approving it:"...the issue is that the requested rectangle region for doing the YuvToJpeg compression may be adjusted in the cases that the left-top point of the region is located in odd-indexed position. In such cases, the rectangle in the golden test image should be adjusted accordingly."
Look at the latest patch: Compare the differences between new and old yuvimagetest. java.
After modification, the test passes!
I personally think it is because actual = compressdecompress (image, rect2). When left and top of rect2 are odd, this sentence changes left and top of rect2.
In this case, rect1 and rect2 point to the same one. Therefore, after rect1 is compresstojpeg (), its left and top changes from (11, 11) to (10, 10)
diff -u /source/android-2.2/cts/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java /home/yhluo/tmp/YuvImageTest_new.txt
--- /source/android-2.2/cts/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java 2010-12-02 03:49:41.000000000 +0800
+++ /home/yhluo/tmp/YuvImageTest_new.txt 2011-03-24 14:58:59.000000000 +0800
@@ -245,9 +245,13 @@
         Bitmap expected = null;
         Bitmap actual = null;
         boolean sameRect = rect1.equals(rect2) ? true : false;
-        expected = Bitmap.createBitmap(testBitmap, rect1.left, rect1.top,
-                rect1.width(), rect1.height());
-        actual = compressDecompress(image, rect2);
+
+  Rect actualRect = new Rect(rect2);
+        actual = compressDecompress(image, actualRect);
+
+        Rect expectedRect = sameRect ? actualRect : rect1;
+        expected = Bitmap.createBitmap(testBitmap, expectedRect.left, expectedRect.top, expectedRect.width(), expectedRect.height());
+       
         compareBitmaps(expected, actual, mMseMargin, sameRect);
     }
 
@@ -422,3 +426,4 @@
         }
     }
 }
+
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.