Remove getBits()
[zxing.git] / core / test / src / com / google / zxing / qrcode / decoder / DataMaskTestCase.java
index 9982168..1f15ce6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Google Inc.
+ * Copyright 2007 ZXing authors
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import com.google.zxing.common.BitMatrix;
 import junit.framework.TestCase;
 
 /**
- * @author srowen@google.com (Sean Owen)
+ * @author Sean Owen
  */
 public final class DataMaskTestCase extends TestCase {
 
@@ -59,7 +59,7 @@ public final class DataMaskTestCase extends TestCase {
   public void testMask4() {
     testMaskAcrossDimensions(4, new MaskCondition() {
       public boolean isMasked(int i, int j) {
-        return (i/2 + j/3) % 2 == 0;
+        return (i / 2 + j / 3) % 2 == 0;
       }
     });
   }
@@ -67,7 +67,7 @@ public final class DataMaskTestCase extends TestCase {
   public void testMask5() {
     testMaskAcrossDimensions(5, new MaskCondition() {
       public boolean isMasked(int i, int j) {
-        return (i*j) % 2 + (i*j) % 3 == 0;
+        return (i * j) % 2 + (i * j) % 3 == 0;
       }
     });
   }
@@ -75,7 +75,7 @@ public final class DataMaskTestCase extends TestCase {
   public void testMask6() {
     testMaskAcrossDimensions(6, new MaskCondition() {
       public boolean isMasked(int i, int j) {
-        return ((i*j) % 2 + (i*j) % 3) % 2 == 0;
+        return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
       }
     });
   }
@@ -83,7 +83,7 @@ public final class DataMaskTestCase extends TestCase {
   public void testMask7() {
     testMaskAcrossDimensions(7, new MaskCondition() {
       public boolean isMasked(int i, int j) {
-        return ((i+j) % 2 + (i*j) % 3) % 2 == 0;
+        return ((i + j) % 2 + (i * j) % 3) % 2 == 0;
       }
     });
   }
@@ -92,25 +92,25 @@ public final class DataMaskTestCase extends TestCase {
                                         MaskCondition condition) {
     DataMask mask = DataMask.forReference(reference);
     for (int version = 1; version <= 40; version++) {
-      int dimension = 17 + 4*version;
+      int dimension = 17 + 4 * version;
       testMask(mask, dimension, condition);
     }
   }
 
   private void testMask(DataMask mask, int dimension, MaskCondition condition) {
     BitMatrix bits = new BitMatrix(dimension);
-    mask.unmaskBitMatrix(bits.getBits(), dimension);
+    mask.unmaskBitMatrix(bits, dimension);
     for (int i = 0; i < dimension; i++) {
       for (int j = 0; j < dimension; j++) {
         assertEquals(
-            "(" + i + ',' + j + ')', 
+            "(" + i + ',' + j + ')',
             condition.isMasked(i, j),
             bits.get(i, j));
       }
     }
   }
 
-  private static interface MaskCondition {
+  private interface MaskCondition {
     boolean isMasked(int i, int j);
   }