From cdea3553ef02b463afb66c4251b8574ba1365ede Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 8 Jan 2007 18:36:47 +0100 Subject: [PATCH] Split the big verify-pack test into individual tests. This makes it easier to spot which of the tests failed. --- t/t5300-pack-object.sh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index f511547455..622c5f9968 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -134,49 +134,51 @@ test_expect_success \ 'git-verify-pack test-1-${packname_1}.idx test-2-${packname_2}.idx' test_expect_success \ - 'corrupt a pack and see if verify catches' \ + 'verify-pack catches mismatched .idx and .pack files' \ 'cp test-1-${packname_1}.idx test-3.idx && cp test-2-${packname_2}.pack test-3.pack && if git-verify-pack test-3.idx then false else :; - fi && + fi' - : PACK_SIGNATURE && - cp test-1-${packname_1}.pack test-3.pack && +test_expect_success \ + 'verify-pack catches a corrupted pack signature' \ + 'cp test-1-${packname_1}.pack test-3.pack && dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=2 && if git-verify-pack test-3.idx then false else :; - fi && + fi' - : PACK_VERSION && - cp test-1-${packname_1}.pack test-3.pack && +test_expect_success \ + 'verify-pack catches a corrupted pack version' \ + 'cp test-1-${packname_1}.pack test-3.pack && dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=7 && if git-verify-pack test-3.idx then false else :; - fi && + fi' - : TYPE/SIZE byte of the first packed object data && - cp test-1-${packname_1}.pack test-3.pack && +test_expect_success \ + 'verify-pack catches a corrupted type/size of the 1st packed object data' \ + 'cp test-1-${packname_1}.pack test-3.pack && dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=12 && if git-verify-pack test-3.idx then false else :; - fi && + fi' - : sum of the index file itself && - l=`wc -c