Merge pull request #20097 from komakai:fix_qrcode_test

This commit is contained in:
Alexander Alekhin 2021-05-17 17:53:34 +00:00
commit 1ae16beb06

View File

@ -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));
}
}