Merge pull request #20097 from komakai:fix_qrcode_test

pull/20115/head^2
Alexander Alekhin 4 years ago
commit 1ae16beb06
  1. 11
      modules/objdetect/misc/java/test/QRCodeDetectorTest.java

@ -5,7 +5,10 @@ import org.opencv.core.Mat;
import org.opencv.objdetect.QRCodeDetector;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.test.OpenCVTestCase;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class QRCodeDetectorTest extends OpenCVTestCase {
@ -39,11 +42,7 @@ public class QRCodeDetectorTest extends OpenCVTestCase {
boolean result = detector.detectAndDecodeMulti(img, output);
assertTrue(result);
assertEquals(output.size(), 6);
assertEquals(output.get(0), "SKIP");
assertEquals(output.get(1), "EXTRA");
assertEquals(output.get(2), "TWO STEPS FORWARD");
assertEquals(output.get(3), "STEP BACK");
assertEquals(output.get(4), "QUESTION");
assertEquals(output.get(5), "STEP FORWARD");
List < String > expectedResults = Arrays.asList("SKIP", "EXTRA", "TWO STEPS FORWARD", "STEP BACK", "QUESTION", "STEP FORWARD");
assertEquals(new HashSet<String>(output), new HashSet<String>(expectedResults));
}
}

Loading…
Cancel
Save