diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-05-28 15:39:50 -0700 |
---|---|---|
committer | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-05-28 15:39:50 -0700 |
commit | 82984727642c5705cfb5d7868bc92997bd2bfd4d (patch) | |
tree | 5c2b03f9707330884e5ecd75ed37c99c644e81f0 /media | |
parent | b9a65de1f79d92326abcccc295c18f24afb83053 (diff) | |
download | frameworks_base-82984727642c5705cfb5d7868bc92997bd2bfd4d.zip frameworks_base-82984727642c5705cfb5d7868bc92997bd2bfd4d.tar.gz frameworks_base-82984727642c5705cfb5d7868bc92997bd2bfd4d.tar.bz2 |
Camera2: Test null TonemapCurve behavior
Add a test to verify we return null TonemapCurve when at least one
channel of tonemap curve is absent.
Bug: 14628001
Change-Id: I3e89dbcf00e5f21b01fc78fe43fe5c4200690357
Diffstat (limited to 'media')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java index fe51215..afc2931 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/CameraMetadataTest.java @@ -1032,11 +1032,14 @@ public class CameraMetadataTest extends junit.framework.TestCase { float[] redOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_RED); float[] greenOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_GREEN); float[] blueOut = mMetadata.get(CaptureResult.TONEMAP_CURVE_BLUE); - assertTrue("Input and output tonemap curve should match", Arrays.equals(red, redOut)); - assertTrue("Input and output tonemap curve should match", Arrays.equals(green, greenOut)); - assertTrue("Input and output tonemap curve should match", Arrays.equals(blue, blueOut)); + assertArrayEquals(red, redOut); + assertArrayEquals(green, greenOut); + assertArrayEquals(blue, blueOut); TonemapCurve tcOut = mMetadata.get(CaptureResult.TONEMAP_CURVE); - assertTrue("Input and output tonemap curve should match", tcIn.equals(tcOut)); + assertEquals(tcIn, tcOut); + mMetadata.set(CaptureResult.TONEMAP_CURVE_GREEN, null); + // If any of channel has null curve, return a null TonemapCurve + assertNull(mMetadata.get(CaptureResult.TONEMAP_CURVE)); } /** |