summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-09-01 14:05:27 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-09-01 14:05:27 (GMT)
commitf2d8f433391919bc13041fe850aefb502fa6f348 (patch)
tree017f5c657746b5ecf28aad956a594e667b2c2ec2
parenta9eb97707b3960c052d05bb85a41fdb5c9ef777c (diff)
downloadlibnsbmp-f2d8f433391919bc13041fe850aefb502fa6f348.tar.gz
libnsbmp-f2d8f433391919bc13041fe850aefb502fa6f348.tar.bz2
add decode test suite
-rw-r--r--Makefile6
-rwxr-xr-xexamples/bmp_display (renamed from bmp_display)0
-rwxr-xr-xexamples/ico_display (renamed from ico_display)0
-rw-r--r--test/Makefile3
-rw-r--r--test/bmpsuite/g01bg.bmp (renamed from examples/bmpsuite/g01bg.bmp)bin1086 -> 1086 bytes
-rw-r--r--test/bmpsuite/g01bw.bmp (renamed from examples/bmpsuite/g01bw.bmp)bin1086 -> 1086 bytes
-rw-r--r--test/bmpsuite/g01p1.bmp (renamed from examples/bmpsuite/g01p1.bmp)bin1082 -> 1082 bytes
-rw-r--r--test/bmpsuite/g01wb.bmp (renamed from examples/bmpsuite/g01wb.bmp)bin1086 -> 1086 bytes
-rw-r--r--test/bmpsuite/g04.bmp (renamed from examples/bmpsuite/g04.bmp)bin4214 -> 4214 bytes
-rw-r--r--test/bmpsuite/g04p4.bmp (renamed from examples/bmpsuite/g04p4.bmp)bin4166 -> 4166 bytes
-rw-r--r--test/bmpsuite/g04rle.bmp (renamed from examples/bmpsuite/g04rle.bmp)bin922 -> 922 bytes
-rw-r--r--test/bmpsuite/g08.bmp (renamed from examples/bmpsuite/g08.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08offs.bmp (renamed from examples/bmpsuite/g08offs.bmp)bin9370 -> 9370 bytes
-rw-r--r--test/bmpsuite/g08os2.bmp (renamed from examples/bmpsuite/g08os2.bmp)bin8986 -> 8986 bytes
-rw-r--r--test/bmpsuite/g08p256.bmp (renamed from examples/bmpsuite/g08p256.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08p64.bmp (renamed from examples/bmpsuite/g08p64.bmp)bin8502 -> 8502 bytes
-rw-r--r--test/bmpsuite/g08pi256.bmp (renamed from examples/bmpsuite/g08pi256.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08pi64.bmp (renamed from examples/bmpsuite/g08pi64.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08res11.bmp (renamed from examples/bmpsuite/g08res11.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08res21.bmp (renamed from examples/bmpsuite/g08res21.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08res22.bmp (renamed from examples/bmpsuite/g08res22.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08rle.bmp (renamed from examples/bmpsuite/g08rle.bmp)bin1820 -> 1820 bytes
-rw-r--r--test/bmpsuite/g08s0.bmp (renamed from examples/bmpsuite/g08s0.bmp)bin9270 -> 9270 bytes
-rw-r--r--test/bmpsuite/g08w124.bmp (renamed from examples/bmpsuite/g08w124.bmp)bin8642 -> 8642 bytes
-rw-r--r--test/bmpsuite/g08w125.bmp (renamed from examples/bmpsuite/g08w125.bmp)bin9014 -> 9014 bytes
-rw-r--r--test/bmpsuite/g08w126.bmp (renamed from examples/bmpsuite/g08w126.bmp)bin9142 -> 9142 bytes
-rw-r--r--test/bmpsuite/g16bf555.bmp (renamed from examples/bmpsuite/g16bf555.bmp)bin16450 -> 16450 bytes
-rw-r--r--test/bmpsuite/g16bf565.bmp (renamed from examples/bmpsuite/g16bf565.bmp)bin16450 -> 16450 bytes
-rw-r--r--test/bmpsuite/g16def555.bmp (renamed from examples/bmpsuite/g16def555.bmp)bin16438 -> 16438 bytes
-rw-r--r--test/bmpsuite/g24.bmp (renamed from examples/bmpsuite/g24.bmp)bin24630 -> 24630 bytes
-rw-r--r--test/bmpsuite/g32bf.bmp (renamed from examples/bmpsuite/g32bf.bmp)bin32578 -> 32578 bytes
-rw-r--r--test/bmpsuite/g32def.bmp (renamed from examples/bmpsuite/g32def.bmp)bin32566 -> 32566 bytes
-rw-r--r--test/bmpsuite/png/01bg.png (renamed from examples/bmpsuite/png/01bg.png)bin281 -> 281 bytes
-rw-r--r--test/bmpsuite/png/01bw.png (renamed from examples/bmpsuite/png/01bw.png)bin281 -> 281 bytes
-rw-r--r--test/bmpsuite/png/01p1.png (renamed from examples/bmpsuite/png/01p1.png)bin139 -> 139 bytes
-rw-r--r--test/bmpsuite/png/04.png (renamed from examples/bmpsuite/png/04.png)bin280 -> 280 bytes
-rw-r--r--test/bmpsuite/png/04p4.png (renamed from examples/bmpsuite/png/04p4.png)bin223 -> 223 bytes
-rw-r--r--test/bmpsuite/png/08.png (renamed from examples/bmpsuite/png/08.png)bin1447 -> 1447 bytes
-rw-r--r--test/bmpsuite/png/08p64.png (renamed from examples/bmpsuite/png/08p64.png)bin694 -> 694 bytes
-rw-r--r--test/bmpsuite/png/08w124.png (renamed from examples/bmpsuite/png/08w124.png)bin1434 -> 1434 bytes
-rw-r--r--test/bmpsuite/png/08w125.png (renamed from examples/bmpsuite/png/08w125.png)bin1450 -> 1450 bytes
-rw-r--r--test/bmpsuite/png/08w126.png (renamed from examples/bmpsuite/png/08w126.png)bin1461 -> 1461 bytes
-rw-r--r--test/bmpsuite/png/16bf555.png (renamed from examples/bmpsuite/png/16bf555.png)bin525 -> 525 bytes
-rw-r--r--test/bmpsuite/png/16bf565.png (renamed from examples/bmpsuite/png/16bf565.png)bin580 -> 580 bytes
-rw-r--r--test/bmpsuite/png/24.png (renamed from examples/bmpsuite/png/24.png)bin433 -> 433 bytes
-rw-r--r--test/bmpsuite/png/reference.html (renamed from examples/bmpsuite/png/reference.html)0
-rw-r--r--test/bmpsuite/readme.txt (renamed from examples/bmpsuite/readme.txt)0
-rw-r--r--test/bmpsuite/test.html (renamed from examples/bmpsuite/test.html)0
-rw-r--r--test/decode_bmp.c (renamed from examples/decode_bmp.c)0
-rw-r--r--test/decode_ico.c (renamed from examples/decode_ico.c)0
-rw-r--r--test/icons/monitor.ico (renamed from examples/monitor.ico)bin102758 -> 102758 bytes
-rwxr-xr-xtest/runtest.sh26
52 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5837e5d..3250af7 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,9 @@ PREFIX ?= /opt/netsurf
NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
include $(NSSHARED)/makefiles/Makefile.tools
+# Reevaluate when used, as BUILDDIR won't be defined yet
+TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
+
# Toolchain flags
WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
@@ -34,6 +37,9 @@ else
CFLAGS := $(CFLAGS) -Dinline="__inline__"
endif
+TESTCFLAGS := -g -O2
+TESTLDFLAGS := -lm -l$(COMPONENT) $(TESTLDFLAGS)
+
include $(NSBUILD)/Makefile.top
# Extra installation rules
diff --git a/bmp_display b/examples/bmp_display
index dd0458c..dd0458c 100755
--- a/bmp_display
+++ b/examples/bmp_display
diff --git a/ico_display b/examples/ico_display
index ff5cd3c..ff5cd3c 100755
--- a/ico_display
+++ b/examples/ico_display
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..6c73a91
--- a/dev/null
+++ b/test/Makefile
@@ -0,0 +1,3 @@
+DIR_TEST_ITEMS := decode_bmp:decode_bmp.c decode_ico:decode_ico.c
+
+include $(NSBUILD)/Makefile.subdir
diff --git a/examples/bmpsuite/g01bg.bmp b/test/bmpsuite/g01bg.bmp
index a720347..a720347 100644
--- a/examples/bmpsuite/g01bg.bmp
+++ b/test/bmpsuite/g01bg.bmp
Binary files differ
diff --git a/examples/bmpsuite/g01bw.bmp b/test/bmpsuite/g01bw.bmp
index 06189a6..06189a6 100644
--- a/examples/bmpsuite/g01bw.bmp
+++ b/test/bmpsuite/g01bw.bmp
Binary files differ
diff --git a/examples/bmpsuite/g01p1.bmp b/test/bmpsuite/g01p1.bmp
index 706b4a1..706b4a1 100644
--- a/examples/bmpsuite/g01p1.bmp
+++ b/test/bmpsuite/g01p1.bmp
Binary files differ
diff --git a/examples/bmpsuite/g01wb.bmp b/test/bmpsuite/g01wb.bmp
index 2f05b43..2f05b43 100644
--- a/examples/bmpsuite/g01wb.bmp
+++ b/test/bmpsuite/g01wb.bmp
Binary files differ
diff --git a/examples/bmpsuite/g04.bmp b/test/bmpsuite/g04.bmp
index a064f66..a064f66 100644
--- a/examples/bmpsuite/g04.bmp
+++ b/test/bmpsuite/g04.bmp
Binary files differ
diff --git a/examples/bmpsuite/g04p4.bmp b/test/bmpsuite/g04p4.bmp
index 4c1096b..4c1096b 100644
--- a/examples/bmpsuite/g04p4.bmp
+++ b/test/bmpsuite/g04p4.bmp
Binary files differ
diff --git a/examples/bmpsuite/g04rle.bmp b/test/bmpsuite/g04rle.bmp
index 7239fa6..7239fa6 100644
--- a/examples/bmpsuite/g04rle.bmp
+++ b/test/bmpsuite/g04rle.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08.bmp b/test/bmpsuite/g08.bmp
index 3be9a20..3be9a20 100644
--- a/examples/bmpsuite/g08.bmp
+++ b/test/bmpsuite/g08.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08offs.bmp b/test/bmpsuite/g08offs.bmp
index 71def41..71def41 100644
--- a/examples/bmpsuite/g08offs.bmp
+++ b/test/bmpsuite/g08offs.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08os2.bmp b/test/bmpsuite/g08os2.bmp
index f7f9f57..f7f9f57 100644
--- a/examples/bmpsuite/g08os2.bmp
+++ b/test/bmpsuite/g08os2.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08p256.bmp b/test/bmpsuite/g08p256.bmp
index a129bbc..a129bbc 100644
--- a/examples/bmpsuite/g08p256.bmp
+++ b/test/bmpsuite/g08p256.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08p64.bmp b/test/bmpsuite/g08p64.bmp
index 9d3affd..9d3affd 100644
--- a/examples/bmpsuite/g08p64.bmp
+++ b/test/bmpsuite/g08p64.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08pi256.bmp b/test/bmpsuite/g08pi256.bmp
index 45df3f8..45df3f8 100644
--- a/examples/bmpsuite/g08pi256.bmp
+++ b/test/bmpsuite/g08pi256.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08pi64.bmp b/test/bmpsuite/g08pi64.bmp
index 52baf91..52baf91 100644
--- a/examples/bmpsuite/g08pi64.bmp
+++ b/test/bmpsuite/g08pi64.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08res11.bmp b/test/bmpsuite/g08res11.bmp
index f03d0f3..f03d0f3 100644
--- a/examples/bmpsuite/g08res11.bmp
+++ b/test/bmpsuite/g08res11.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08res21.bmp b/test/bmpsuite/g08res21.bmp
index 61198e5..61198e5 100644
--- a/examples/bmpsuite/g08res21.bmp
+++ b/test/bmpsuite/g08res21.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08res22.bmp b/test/bmpsuite/g08res22.bmp
index 1af0ecc..1af0ecc 100644
--- a/examples/bmpsuite/g08res22.bmp
+++ b/test/bmpsuite/g08res22.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08rle.bmp b/test/bmpsuite/g08rle.bmp
index 082f7f4..082f7f4 100644
--- a/examples/bmpsuite/g08rle.bmp
+++ b/test/bmpsuite/g08rle.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08s0.bmp b/test/bmpsuite/g08s0.bmp
index 4b2c521..4b2c521 100644
--- a/examples/bmpsuite/g08s0.bmp
+++ b/test/bmpsuite/g08s0.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08w124.bmp b/test/bmpsuite/g08w124.bmp
index 1896035..1896035 100644
--- a/examples/bmpsuite/g08w124.bmp
+++ b/test/bmpsuite/g08w124.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08w125.bmp b/test/bmpsuite/g08w125.bmp
index b348a7c..b348a7c 100644
--- a/examples/bmpsuite/g08w125.bmp
+++ b/test/bmpsuite/g08w125.bmp
Binary files differ
diff --git a/examples/bmpsuite/g08w126.bmp b/test/bmpsuite/g08w126.bmp
index 3628d66..3628d66 100644
--- a/examples/bmpsuite/g08w126.bmp
+++ b/test/bmpsuite/g08w126.bmp
Binary files differ
diff --git a/examples/bmpsuite/g16bf555.bmp b/test/bmpsuite/g16bf555.bmp
index 639a57f..639a57f 100644
--- a/examples/bmpsuite/g16bf555.bmp
+++ b/test/bmpsuite/g16bf555.bmp
Binary files differ
diff --git a/examples/bmpsuite/g16bf565.bmp b/test/bmpsuite/g16bf565.bmp
index cb0ea24..cb0ea24 100644
--- a/examples/bmpsuite/g16bf565.bmp
+++ b/test/bmpsuite/g16bf565.bmp
Binary files differ
diff --git a/examples/bmpsuite/g16def555.bmp b/test/bmpsuite/g16def555.bmp
index a5a3195..a5a3195 100644
--- a/examples/bmpsuite/g16def555.bmp
+++ b/test/bmpsuite/g16def555.bmp
Binary files differ
diff --git a/examples/bmpsuite/g24.bmp b/test/bmpsuite/g24.bmp
index d6d9e6a..d6d9e6a 100644
--- a/examples/bmpsuite/g24.bmp
+++ b/test/bmpsuite/g24.bmp
Binary files differ
diff --git a/examples/bmpsuite/g32bf.bmp b/test/bmpsuite/g32bf.bmp
index 0f41534..0f41534 100644
--- a/examples/bmpsuite/g32bf.bmp
+++ b/test/bmpsuite/g32bf.bmp
Binary files differ
diff --git a/examples/bmpsuite/g32def.bmp b/test/bmpsuite/g32def.bmp
index 9524f76..9524f76 100644
--- a/examples/bmpsuite/g32def.bmp
+++ b/test/bmpsuite/g32def.bmp
Binary files differ
diff --git a/examples/bmpsuite/png/01bg.png b/test/bmpsuite/png/01bg.png
index 0b9cf9a..0b9cf9a 100644
--- a/examples/bmpsuite/png/01bg.png
+++ b/test/bmpsuite/png/01bg.png
Binary files differ
diff --git a/examples/bmpsuite/png/01bw.png b/test/bmpsuite/png/01bw.png
index 9f2e57a..9f2e57a 100644
--- a/examples/bmpsuite/png/01bw.png
+++ b/test/bmpsuite/png/01bw.png
Binary files differ
diff --git a/examples/bmpsuite/png/01p1.png b/test/bmpsuite/png/01p1.png
index 0103e79..0103e79 100644
--- a/examples/bmpsuite/png/01p1.png
+++ b/test/bmpsuite/png/01p1.png
Binary files differ
diff --git a/examples/bmpsuite/png/04.png b/test/bmpsuite/png/04.png
index 14beb91..14beb91 100644
--- a/examples/bmpsuite/png/04.png
+++ b/test/bmpsuite/png/04.png
Binary files differ
diff --git a/examples/bmpsuite/png/04p4.png b/test/bmpsuite/png/04p4.png
index 8dbcafa..8dbcafa 100644
--- a/examples/bmpsuite/png/04p4.png
+++ b/test/bmpsuite/png/04p4.png
Binary files differ
diff --git a/examples/bmpsuite/png/08.png b/test/bmpsuite/png/08.png
index 06545a0..06545a0 100644
--- a/examples/bmpsuite/png/08.png
+++ b/test/bmpsuite/png/08.png
Binary files differ
diff --git a/examples/bmpsuite/png/08p64.png b/test/bmpsuite/png/08p64.png
index 49f0802..49f0802 100644
--- a/examples/bmpsuite/png/08p64.png
+++ b/test/bmpsuite/png/08p64.png
Binary files differ
diff --git a/examples/bmpsuite/png/08w124.png b/test/bmpsuite/png/08w124.png
index 8da58fb..8da58fb 100644
--- a/examples/bmpsuite/png/08w124.png
+++ b/test/bmpsuite/png/08w124.png
Binary files differ
diff --git a/examples/bmpsuite/png/08w125.png b/test/bmpsuite/png/08w125.png
index 6ebb4f8..6ebb4f8 100644
--- a/examples/bmpsuite/png/08w125.png
+++ b/test/bmpsuite/png/08w125.png
Binary files differ
diff --git a/examples/bmpsuite/png/08w126.png b/test/bmpsuite/png/08w126.png
index ca9c9b9..ca9c9b9 100644
--- a/examples/bmpsuite/png/08w126.png
+++ b/test/bmpsuite/png/08w126.png
Binary files differ
diff --git a/examples/bmpsuite/png/16bf555.png b/test/bmpsuite/png/16bf555.png
index aaa0dff..aaa0dff 100644
--- a/examples/bmpsuite/png/16bf555.png
+++ b/test/bmpsuite/png/16bf555.png
Binary files differ
diff --git a/examples/bmpsuite/png/16bf565.png b/test/bmpsuite/png/16bf565.png
index 52d90e3..52d90e3 100644
--- a/examples/bmpsuite/png/16bf565.png
+++ b/test/bmpsuite/png/16bf565.png
Binary files differ
diff --git a/examples/bmpsuite/png/24.png b/test/bmpsuite/png/24.png
index e9fc4db..e9fc4db 100644
--- a/examples/bmpsuite/png/24.png
+++ b/test/bmpsuite/png/24.png
Binary files differ
diff --git a/examples/bmpsuite/png/reference.html b/test/bmpsuite/png/reference.html
index 7117b6c..7117b6c 100644
--- a/examples/bmpsuite/png/reference.html
+++ b/test/bmpsuite/png/reference.html
diff --git a/examples/bmpsuite/readme.txt b/test/bmpsuite/readme.txt
index 347aded..347aded 100644
--- a/examples/bmpsuite/readme.txt
+++ b/test/bmpsuite/readme.txt
diff --git a/examples/bmpsuite/test.html b/test/bmpsuite/test.html
index 8abb614..8abb614 100644
--- a/examples/bmpsuite/test.html
+++ b/test/bmpsuite/test.html
diff --git a/examples/decode_bmp.c b/test/decode_bmp.c
index e5dc572..e5dc572 100644
--- a/examples/decode_bmp.c
+++ b/test/decode_bmp.c
diff --git a/examples/decode_ico.c b/test/decode_ico.c
index 935001c..935001c 100644
--- a/examples/decode_ico.c
+++ b/test/decode_ico.c
diff --git a/examples/monitor.ico b/test/icons/monitor.ico
index 2997dc3..2997dc3 100644
--- a/examples/monitor.ico
+++ b/test/icons/monitor.ico
Binary files differ
diff --git a/test/runtest.sh b/test/runtest.sh
new file mode 100755
index 0000000..65d7f45
--- a/dev/null
+++ b/test/runtest.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+TEST_PATH=$1
+TEST_OUT=${TEST_PATH}/ppm
+
+mkdir -p ${TEST_OUT}
+
+bmpdecode()
+{
+ OUTF=$(basename ${1} .bmp)
+ ${TEST_PATH}/test_decode_bmp ${1} > ${TEST_OUT}/${OUTF}.ppm
+}
+
+icodecode()
+{
+ OUTF=$(basename ${1} .ico)
+ ${TEST_PATH}/test_decode_ico ${1} > ${TEST_OUT}/${OUTF}.ppm
+}
+
+for BMP in $(ls test/bmpsuite/*.bmp);do
+ bmpdecode ${BMP}
+done
+
+#for ICO in $(ls test/icons/*.ico);do
+# icodecode ${BMP}
+#done