package com.google.zxing.qrcode.decoder;
-import com.google.zxing.ReaderException;
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
/**
* @author Sean Owen
*/
-public final class ErrorCorrectionLevelTestCase extends TestCase {
+public final class ErrorCorrectionLevelTestCase extends Assert {
- public void testForBits() throws ReaderException {
- assertEquals(ErrorCorrectionLevel.M, ErrorCorrectionLevel.forBits(0));
- assertEquals(ErrorCorrectionLevel.L, ErrorCorrectionLevel.forBits(1));
- assertEquals(ErrorCorrectionLevel.H, ErrorCorrectionLevel.forBits(2));
- assertEquals(ErrorCorrectionLevel.Q, ErrorCorrectionLevel.forBits(3));
+ @Test
+ public void testForBits() {
+ assertSame(ErrorCorrectionLevel.M, ErrorCorrectionLevel.forBits(0));
+ assertSame(ErrorCorrectionLevel.L, ErrorCorrectionLevel.forBits(1));
+ assertSame(ErrorCorrectionLevel.H, ErrorCorrectionLevel.forBits(2));
+ assertSame(ErrorCorrectionLevel.Q, ErrorCorrectionLevel.forBits(3));
try {
ErrorCorrectionLevel.forBits(4);
fail("Should have thrown an exception");
- } catch (ReaderException re) {
+ } catch (IllegalArgumentException iae) {
// good
}
}