aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>2019-12-11 19:35:51 -0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-13 10:49:04 +0100
commit284583c2370b2cdaf6b83a35ffafa0de528a6c07 (patch)
tree1fe2c05919dc14f447ceb7c39191b17514d98b0f
parent59e0ed18f5185a57516ea3115027a9bdbad04fd8 (diff)
test: add binary QR code test and example data
Check the correctness of binary data extracted from QR codes. This specific test can be run with: make check-images The binary QR code example is the qr-code.png file, QR encoded: qrencode --8bit --output examples/qr-code-binary.png < examples/qr-code.png Tested-by: Peter Moran <petecmo@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--examples/qr-code-binary.pngbin0 -> 922 bytes
-rw-r--r--examples/sha1sum1
-rw-r--r--test/Makefile.am.inc1
-rw-r--r--test/test_examples.sh.in1
4 files changed, 3 insertions, 0 deletions
diff --git a/examples/qr-code-binary.png b/examples/qr-code-binary.png
new file mode 100644
index 0000000..6337d26
--- /dev/null
+++ b/examples/qr-code-binary.png
Binary files differ
diff --git a/examples/sha1sum b/examples/sha1sum
index 00a950a..72cab2e 100644
--- a/examples/sha1sum
+++ b/examples/sha1sum
@@ -16,3 +16,4 @@ b567e550216fe24f7652f683146365a9fe7ee867 zbarimg -Sisbn10.enable ean-13.png
d0f37aa076d42c270f7231c5490beea5605e2ba0 zbarimg -Sisbn13.enable ean-13.png
3f041225df3b8364b5fd0daf9cf402e8a4731f9b zbarimg -Supca.enable code-upc-a.png
b350ca7efad7a50c5ac082d5c683a8e8d8d380a7 zbarimg -Stest-inverted qr-code-inverted.png
+df896e459e47a7d392031a7d4962722a143e276b zbarimg --raw --oneshot -Sbinary qr-code-binary.png
diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc
index d480a67..0410068 100644
--- a/test/Makefile.am.inc
+++ b/test/Makefile.am.inc
@@ -76,6 +76,7 @@ gen_checksum: all
$(ZBARIMG) -Sisbn13.enable $(EXAMPLES)/ean-13.png 2>/dev/null|sha1sum|sed "s,-,zbarimg -Sisbn13.enable ean-13.png," >>$(EXAMPLES)/sha1sum
$(ZBARIMG) -Supca.enable $(EXAMPLES)/code-upc-a.png 2>/dev/null|sha1sum|sed "s,-,zbarimg -Supca.enable code-upc-a.png," >>$(EXAMPLES)/sha1sum
$(ZBARIMG) -Stest-inverted $(EXAMPLES)/qr-code-inverted.png 2>/dev/null|sha1sum|sed "s,-,zbarimg -Stest-inverted qr-code-inverted.png," >>$(EXAMPLES)/sha1sum
+ $(ZBARIMG) --raw -Sbinary $(EXAMPLES)/qr-code-binary.png 2>/dev/null|head -c -1|sha1sum|sed "s,-,zbarimg --raw -Sbinary qr-code-binary.png," >>$(EXAMPLES)/sha1sum
test_progs: $(check_PROGRAMS)
@$(MAKE) $(check_PROGRAMS)
diff --git a/test/test_examples.sh.in b/test/test_examples.sh.in
index db6ee9d..f4c18e8 100644
--- a/test/test_examples.sh.in
+++ b/test/test_examples.sh.in
@@ -69,6 +69,7 @@ fi
if [ "@ENABLE_QRCODE@" == "1" ]; then
test qr-code.png
test -Stest-inverted qr-code-inverted.png
+ test '--raw --oneshot -Sbinary' qr-code-binary.png
fi
if [ "@ENABLE_SQCODE@" == "1" ]; then

Privacy Policy