@@ -0,0 +1,2103 @@
+/*%0A * Copyright 2014 ZXing authors%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.zxing;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Apublic final class PlanarYUVLuminanceSourceTestCase extends Assert %7B%0A%0A  private static final byte%5B%5D YUV = %7B%0A       0,  1,  1,  2,  3,  5,%0A       8, 13, 21, 34, 55, 89,%0A       0,  -1,  -1,  -2,  -3,  -5,%0A      -8, -13, -21, -34, -55, -89,%0A      127, 127, 127, 127, 127, 127,%0A      127, 127, 127, 127, 127, 127,%0A  %7D;%0A  private static final int COLS = 6;%0A  private static final int ROWS = 4;%0A  private static final byte%5B%5D Y = new byte%5BCOLS * ROWS%5D;%0A  static %7B%0A    System.arraycopy(YUV, 0, Y, 0, Y.length);%0A  %7D%0A%0A  @Test%0A  public void testNoCrop() %7B%0A    PlanarYUVLuminanceSource source =%0A        new PlanarYUVLuminanceSource(YUV, COLS, ROWS, 0, 0, COLS, ROWS, false);%0A    assertEquals(Y, 0, source.getMatrix(), 0, Y.length);%0A    for (int r = 0; r %3C ROWS; r++) %7B%0A      assertEquals(Y, r * COLS, source.getRow(r, null), 0, COLS);%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void testCrop() %7B%0A    PlanarYUVLuminanceSource source =%0A        new PlanarYUVLuminanceSource(YUV, COLS, ROWS, 1, 1, COLS-2, ROWS-2, false);%0A    for (int r = 0; r %3C ROWS-2; r++) %7B%0A      assertEquals(Y, (r + 1) * COLS + 1, source.getRow(r, null), 0, COLS-2);%0A    %7D%0A  %7D%0A%0A  private static void assertEquals(byte%5B%5D expected, int expectedFrom,%0A                                   byte%5B%5D actual, int actualFrom,%0A                                   int length) %7B%0A    for (int i = 0; i %3C length; i++) %7B%0A      assertEquals(expected%5BexpectedFrom + i%5D, actual%5BactualFrom + i%5D);%0A    %7D%0A  %7D%0A%0A%7D%0A

Add simple test to try codecov.io