"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/test/java/com/google/zxing/oned/UPCAWriterTestCase.java" between
zxing-zxing-3.4.0.tar.gz and zxing-zxing-3.4.1.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

UPCAWriterTestCase.java  (zxing-zxing-3.4.0):UPCAWriterTestCase.java  (zxing-zxing-3.4.1)
skipping to change at line 20 skipping to change at line 20
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.zxing.oned; package com.google.zxing.oned;
import com.google.zxing.BarcodeFormat; import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix; import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.BitMatrixTestCase; import com.google.zxing.common.BitMatrixTestCase;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
* @author qwandor@google.com (Andrew Walbran) * @author qwandor@google.com (Andrew Walbran)
*/ */
public final class UPCAWriterTestCase extends Assert { public final class UPCAWriterTestCase extends Assert {
@Test @Test
public void testEncode() throws WriterException { public void testEncode() {
String testStr = "0000101010001101101110110001000101101011110111101010101110 0101110100100111011001101101100101110010100000"; String testStr = "0000101010001101101110110001000101101011110111101010101110 0101110100100111011001101101100101110010100000";
BitMatrix result = new UPCAWriter().encode("485963095124", BarcodeFormat.UPC _A, testStr.length(), 0); BitMatrix result = new UPCAWriter().encode("485963095124", BarcodeFormat.UPC _A, testStr.length(), 0);
assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); assertEquals(testStr, BitMatrixTestCase.matrixToString(result));
} }
@Test @Test
public void testAddChecksumAndEncode() throws WriterException { public void testAddChecksumAndEncode() {
String testStr = "0000101001100100100110111101010001101100010101111010101000 1001001000111010011100101100110110110010100000"; String testStr = "0000101001100100100110111101010001101100010101111010101000 1001001000111010011100101100110110110010100000";
BitMatrix result = new UPCAWriter().encode("12345678901", BarcodeFormat.UPC_ A, testStr.length(), 0); BitMatrix result = new UPCAWriter().encode("12345678901", BarcodeFormat.UPC_ A, testStr.length(), 0);
assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); assertEquals(testStr, BitMatrixTestCase.matrixToString(result));
} }
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)