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

Commit 5ef71efb authored by Mark Harman's avatar Mark Harman
Browse files

Make HDR tests more tolerant for testHDR18 on Galaxy S10e.

parent 2571d991
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -11152,9 +11152,10 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
        Log.d(TAG, "compare median value " + hdrHistogramDetails.median_value + " to expected " + exp_median_value);
        Log.d(TAG, "compare max value " + hdrHistogramDetails.max_value + " to expected " + exp_max_value);
        // we allow some tolerance as different devices can produce different results (e.g., Nexus 6 vs OnePlus 3T; see testHDR18 on Nexus 6 which needs a tolerance of 2)
        assertTrue(Math.abs(exp_min_value - hdrHistogramDetails.min_value) <= 2);
        assertTrue(Math.abs(exp_median_value - hdrHistogramDetails.median_value) <= 2);
        assertTrue(Math.abs(exp_max_value - hdrHistogramDetails.max_value) <= 2);
        // interestingly it's testHDR18 that also needs a higher tolerance for Nokia 8 vs Galaxy S10e
        assertTrue(Math.abs(exp_min_value - hdrHistogramDetails.min_value) <= 3);
        assertTrue(Math.abs(exp_median_value - hdrHistogramDetails.median_value) <= 3);
        assertTrue(Math.abs(exp_max_value - hdrHistogramDetails.max_value) <= 3);
    }
    final private String hdr_images_path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + "/testOpenCamera/testdata/hdrsamples/";