From: Eric S. Raymond Date: Mon, 3 Dec 2012 22:31:58 +0000 (-0500) Subject: Add a regression test. X-Git-Tag: 1.8~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=7149b9d8cea6d8c8d87a2e79612132a822e97233;p=hexdump.git Add a regression test. --- diff --git a/Makefile b/Makefile index b85bdab..2547db8 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,10 @@ clean: cppcheck: cppcheck --template gcc --enable=all hexdump.c +test: hexdump + @hexdump hexdump.png | diff -u hexdump.chk - + @echo "No diff output is good news." + dist: hexdump-$(VERS).tar.gz release: hexdump-$(VERS).tar.gz hexdump.html diff --git a/NEWS b/NEWS index 4787388..e48784a 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ hexdump news 1.8: 2012-12-03 - Use C99 bools. Code passes cppcheck audit. + Use C99 bools. Code passes cppcheck audit. Added a regression test. 1.7: 2010-10-20 Code fully ANSIfied. License changed to BSD. RPM spec removed. diff --git a/README b/README index 144b2b1..e8b5530 100644 --- a/README +++ b/README @@ -17,6 +17,9 @@ resembles a CP/M or MS/DOS DEBUG dump screen. There is nothing UNIX-specific in the source, it should work OK under any C with a stdio.h library. And, in fact, I'm told it has been used under Windows NT. +To test the program, "make test". This checks to make sure dumping of +the PNG logo included with the distribution is stable. + I wrote the original of this in 1983. I'm not certain, but I think it may have been my very first C program, and I believe it was the first code I wrote under Unix (4.1BSD on a Vax). It's certainly the oldest diff --git a/hexdump.chk b/hexdump.chk new file mode 100644 index 0000000..1e972e6 --- /dev/null +++ b/hexdump.chk @@ -0,0 +1,38 @@ +0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 .PNG.... ....IHDR +0010 00 00 00 20 00 00 00 20 08 00 00 00 00 56 11 25 ... ... .....V.% +0020 28 00 00 00 02 74 52 4e 53 00 00 76 93 cd 38 00 (....tRN S..v..8. +0030 00 00 02 62 4b 47 44 00 ff 87 8f cc bf 00 00 00 ...bKGD. ........ +0040 09 70 48 59 73 00 00 00 48 00 00 00 48 00 46 c9 .pHYs... H...H.F. +0050 6b 3e 00 00 01 92 49 44 41 54 38 cb ad 93 21 c2 k>....ID AT8...!. +0060 2b 21 0c 84 73 af 9a 3d c0 8a ca 95 48 64 6c 1c +!..s..= ....Hdl. +0070 72 2d 12 8b c4 62 90 58 24 72 1d 12 c9 11 5e 86 r-...b.X $r....^. +0080 3e df 5f 14 53 32 a4 21 5f 86 25 fa ba 2e 73 db >._.S2.! _.%...s. +0090 e3 21 0a c7 71 5c b7 0a e1 8e 2f 51 a1 c8 78 1f .!..q\.. ../Q..x. +00a0 88 af db ce 45 f4 bc 46 ca 56 05 6b 27 fb 46 34 ....E..F .V.k'.F4 +00b0 ec b2 13 b1 b8 e8 75 93 4e f3 66 51 e1 76 f9 44 ......u. N.fQ.v.D +00c0 05 e7 86 0f 1a f7 3e 67 47 85 ae 0b ff 98 73 74 ......>g G.....st +00d0 3d a7 81 83 ef 2d fe 61 59 9b dc 35 88 e2 75 5d =....-.a Y..5..u] +00e0 c6 a8 90 d3 7c 47 fd f5 d7 73 27 50 28 26 7a 18 ....|G.. .s'P(&z. +00f0 af 1e b9 7f 28 de 0d cd b9 a7 20 d1 05 71 55 9b ....(... .. ..qU. +0100 6b 66 dd de a9 20 32 83 db b5 47 00 4d 8a cf 8a kf... 2. ..G.M... +0110 9a 50 e3 4a 11 25 9f 87 1a 68 a8 3d 31 fe 04 43 .P.J.%.. .h.=1..C +0120 b8 46 8c 34 5a 66 2e a8 5c 93 c5 9d 33 36 96 f9 .F.4Zf.. \...36.. +0130 f1 a2 4c 50 d4 50 b6 17 3c 39 b4 6d 96 7d b4 db ..LP.P.. <9.m.}.. +0140 58 19 32 0d a9 be fc 37 4b 60 56 4e 6b 27 38 6e X.2....7 K`VNk'8n +0150 13 95 22 0b 4b 05 7f 4b 0c fe c4 45 dc 4f bc 08 ..".K..K ...E.O.. +0160 a1 97 a0 57 94 e0 27 20 d4 f7 85 f7 41 d5 8f 81 ...W..' ....A... +0170 91 df ea 45 50 b3 da 11 b2 40 50 36 d6 98 a2 74 ...EP... .@P6...t +0180 66 54 88 f2 a1 b0 2d b9 b4 29 96 20 81 78 59 9c fT....-. .). .xY. +0190 b0 cd 9d 41 61 4c 0b 78 49 25 27 c3 d8 78 dd fe ...AaL.x I%'..x.. +01a0 84 a2 d5 f1 e0 3d f4 5a 27 0a d3 1c 0b 31 a9 3a .....=.Z '....1.: +01b0 31 38 56 0a a3 4d e5 83 33 83 c2 b9 89 27 48 f7 18V..M.. 3....'H. +01c0 d5 25 6e 1a f7 a1 78 8f 22 65 77 bd dc a6 90 71 .%n...x. "ew....q +01d0 e1 3b 31 c6 97 ed ea 79 66 d7 f7 e4 d2 69 71 99 .;1....y f....iq. +01e0 90 f1 3f a1 f8 b2 fe 01 fa 7f 11 a9 27 3a b2 19 ..?..... ....':.. +01f0 00 00 00 25 74 45 58 74 64 61 74 65 3a 63 72 65 ...%tEXt date:cre +0200 61 74 65 00 32 30 31 32 2d 31 32 2d 30 33 54 31 ate.2012 -12-03T1 +0210 35 3a 35 33 3a 32 39 2d 30 35 3a 30 30 40 48 0b 5:53:29- 05:00@H. +0220 af 00 00 00 25 74 45 58 74 64 61 74 65 3a 6d 6f ....%tEX tdate:mo +0230 64 69 66 79 00 32 30 31 32 2d 31 32 2d 30 33 54 dify.201 2-12-03T +0240 31 35 3a 35 33 3a 32 39 2d 30 35 3a 30 30 31 15 15:53:29 -05:001. +0250 b3 13 00 00 00 00 49 45 4e 44 ae 42 60 82 ......IE ND.B`.