At last update to JUnit 4.x
[zxing.git] / core / test / src / com / google / zxing / common / PerspectiveTransformTestCase.java
index 19bc809..531c46b 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.
 
 package com.google.zxing.common;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
 /**
- * @author srowen@google.com (Sean Owen)
+ * @author Sean Owen
  */
-public final class PerspectiveTransformTestCase extends TestCase {
+public final class PerspectiveTransformTestCase extends Assert {
 
   private static final float EPSILON = 0.0001f;
 
+  @Test
   public void testSquareToQuadrilateral() {
     PerspectiveTransform pt = PerspectiveTransform.squareToQuadrilateral(
         2.0f, 3.0f, 10.0f, 4.0f, 16.0f, 15.0f, 4.0f, 9.0f);
@@ -36,6 +38,7 @@ public final class PerspectiveTransformTestCase extends TestCase {
     assertPointEquals(48.0f, 42.42857f, 1.5f, 1.5f, pt);
   }
 
+  @Test
   public void testQuadrilateralToQuadrilateral() {
     PerspectiveTransform pt = PerspectiveTransform.quadrilateralToQuadrilateral(
         2.0f, 3.0f, 10.0f, 4.0f, 16.0f, 15.0f, 4.0f, 9.0f,
@@ -48,7 +51,11 @@ public final class PerspectiveTransformTestCase extends TestCase {
     assertPointEquals(328.09116f, 334.16385f, 50.0f, 50.0f, pt);
   }
 
-  private static void assertPointEquals(float expectedX, float expectedY, float sourceX, float sourceY, PerspectiveTransform pt) {
+  private static void assertPointEquals(float expectedX,
+                                        float expectedY,
+                                        float sourceX,
+                                        float sourceY,
+                                        PerspectiveTransform pt) {
     float[] points = {sourceX, sourceY};
     pt.transformPoints(points);
     assertEquals(expectedX, points[0], EPSILON);