git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 01/11] t5300-pack-object.sh: Split the big verify-pack test into smaller parts.

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Nov 13, 2007, 20:04 UTC
Message-ID
<1194984306-3181-2-git-send-email-johannes.sixt@telecom.at>
In-Reply-To
<1194984306-3181-1-git-send-email-johannes.sixt@telecom.at>
This makes it easier to spot which of the tests failed.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 t/t5300-pack-object.sh |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index ba7579c..f1106e6 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -187,49 +187,51 @@ test_expect_success \
 			test-3-${packname_3}.idx'
 
 test_expect_success \
-    'corrupt a pack and see if verify catches' \
+    'verify-pack catches mismatched .idx and .pack files' \
     'cat test-1-${packname_1}.idx >test-3.idx &&
      cat test-2-${packname_2}.pack >test-3.pack &&
      if git verify-pack test-3.idx
      then false
      else :;
-     fi &&
+     fi'
 
-     : PACK_SIGNATURE &&
-     cat test-1-${packname_1}.pack >test-3.pack &&
+test_expect_success \
+    'verify-pack catches a corrupted pack signature' \
+    'cat 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 &&
-     cat test-1-${packname_1}.pack >test-3.pack &&
+test_expect_success \
+    'verify-pack catches a corrupted pack version' \
+    'cat 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 &&
-     cat test-1-${packname_1}.pack >test-3.pack &&
+test_expect_success \
+    'verify-pack catches a corrupted type/size of the 1st packed object data' \
+    'cat 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 <test-3.idx` &&
+test_expect_success \
+    'verify-pack catches a corrupted sum of the index file itself' \
+    'l=`wc -c <test-3.idx` &&
      l=`expr $l - 20` &&
      cat test-1-${packname_1}.pack >test-3.pack &&
      dd if=/dev/zero of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
      if git verify-pack test-3.pack
      then false
      else :;
-     fi &&
-
-     :'
+     fi'
 
 test_expect_success \
     'build pack index for an existing pack' \
-- 
1.5.3.5.1592.g0d6db
Previous: Johannes SixtNext: Johannes Sixt
Message 2 of 35 in “Miscellaneous MinGW port fallout”
  1. 0/11 Miscellaneous MinGW port falloutJohannes Sixt, Nov 13, 2007
  2. 01/11 t5300-pack-object.sh: Split the big verify-pack test into smaller parts.Johannes Sixt, Nov 13, 2007
  3. 02/11 t7501-commit.sh: Not all seds understand option -iJohannes Sixt, Nov 13, 2007
  4. 03/11 t5302-pack-index: Skip tests of 64-bit offsets if necessary.Johannes Sixt, Nov 13, 2007
  5. 04/11 Skip t3902-quoted.sh if the file system does not support funny names.Johannes Sixt, Nov 13, 2007
  6. 05/11 Use is_absolute_path() in sha1_file.c.Johannes Sixt, Nov 13, 2007
  7. 06/11 Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h.Johannes Sixt, Nov 13, 2007
  8. 07/11 builtin run_command: do not exit with -1.Johannes Sixt, Nov 13, 2007
  9. 08/11 Close files opened by lock_file() before unlinking.Johannes Sixt, Nov 13, 2007
  10. 09/11 Allow a relative builtin template directory.Johannes Sixt, Nov 13, 2007
  11. 10/11 Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG.Johannes Sixt, Nov 13, 2007
  12. 11/11 Allow ETC_GITCONFIG to be a relative path.Johannes Sixt, Nov 13, 2007
  13. Steffen ProhaskaNov 15, 2007
  14. Johannes SixtNov 15, 2007
  15. Steffen ProhaskaNov 15, 2007
  16. Johannes SixtNov 15, 2007
  17. Steffen ProhaskaNov 15, 2007
  18. Johannes SchindelinNov 13, 2007
  19. Johannes SixtNov 13, 2007
  20. Johannes SchindelinNov 13, 2007
  21. Johannes SchindelinNov 13, 2007
  22. Johannes SchindelinNov 13, 2007
  23. Johannes SixtNov 13, 2007
  24. Johannes SchindelinNov 13, 2007
  25. Robin RosenbergNov 14, 2007
  26. Johannes SixtNov 13, 2007
  27. Junio C HamanoNov 13, 2007
  28. Johannes SixtNov 13, 2007
  29. Johannes SchindelinNov 13, 2007
  30. Johannes SixtNov 13, 2007
  31. Junio C HamanoNov 13, 2007
  32. Junio C HamanoNov 14, 2007
  33. Johannes SchindelinNov 14, 2007
  34. Junio C HamanoNov 14, 2007
  35. Johannes SchindelinNov 14, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.