Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 789de110 authored by Yin-Chia Yeh's avatar Yin-Chia Yeh Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Test null TonemapCurve behavior" into lmp-preview-dev

parents c7b1b7ae 82984727
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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));
    }

    /**