git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] fix multiple issues with t5300
@ 2010-02-04  3:48 Nicolas Pitre
  2010-02-04  3:48 ` [PATCH 2/3] pack-objects: fix pack generation when using pack_size_limit Nicolas Pitre
  2010-02-04  3:48 ` [PATCH 3/3] make --max-pack-size argument to 'git pack-object' count in bytes Nicolas Pitre
  0 siblings, 2 replies; 16+ messages in thread
From: Nicolas Pitre @ 2010-02-04  3:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

First of all, trying to run 'git verify-pack' on packs  produced by
the tests using pack.packSizeLimit always failed.  After lots of digging
and head scratching, it turns out that the preceeding test simulating
a SHA1 collision did leave the repository quite confused, impacting
subsequent tests.

So let's move that destructive test last, and add tests to run
verify-pack on the output from those packSizeLimit tests to catch such
goofage.

Finally, group those packSizeLimit tests together.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
---
 t/t5300-pack-object.sh |   54 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index e2aa254..ac81114 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -280,26 +280,8 @@ test_expect_success \
 
      :'
 
-test_expect_success \
-    'fake a SHA1 hash collision' \
-    'test -f	.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
-     cp -f	.git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
-		.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'
-
-test_expect_success \
-    'make sure index-pack detects the SHA1 collision' \
-    'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&
-     grep "SHA1 COLLISION FOUND" msg'
-
-test_expect_success \
-    'honor pack.packSizeLimit' \
-    'git config pack.packSizeLimit 200 &&
-     packname_4=$(git pack-objects test-4 <obj-list) &&
-     test 3 = $(ls test-4-*.pack | wc -l)'
-
 test_expect_success 'unpacking with --strict' '
 
-	git config --unset pack.packsizelimit &&
 	for j in a b c d e f g
 	do
 		for i in 0 1 2 3 4 5 6 7 8 9
@@ -392,10 +374,42 @@ test_expect_success 'index-pack with --strict' '
 	)
 '
 
+test_expect_success 'honor pack.packSizeLimit' '
+	git config pack.packSizeLimit 200 &&
+ 	packname_10=$(git pack-objects test-10 <obj-list) &&
+ 	test 3 = $(ls test-10-*.pack | wc -l)
+'
+
+test_expect_success 'verify resulting packs' '
+	git verify-pack test-10-*.pack
+'
+
 test_expect_success 'tolerate absurdly small packsizelimit' '
 	git config pack.packSizeLimit 2 &&
-	packname_9=$(git pack-objects test-9 <obj-list) &&
-	test $(wc -l <obj-list) = $(ls test-9-*.pack | wc -l)
+	packname_11=$(git pack-objects test-11 <obj-list) &&
+	test $(wc -l <obj-list) = $(ls test-11-*.pack | wc -l)
 '
 
+test_expect_success 'verify resulting packs' '
+	git verify-pack test-11-*.pack
+'
+
+#
+# WARNING!
+#
+# The following test is destructive.  Please keep the next
+# two tests at the end of this file.
+#
+
+test_expect_success \
+    'fake a SHA1 hash collision' \
+    'test -f	.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
+     cp -f	.git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
+		.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'
+
+test_expect_success \
+    'make sure index-pack detects the SHA1 collision' \
+    'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&
+     grep "SHA1 COLLISION FOUND" msg'
+
 test_done
-- 
1.7.0.rc1.149.g0b0b7

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-02-04 21:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04  3:48 [PATCH 1/3] fix multiple issues with t5300 Nicolas Pitre
2010-02-04  3:48 ` [PATCH 2/3] pack-objects: fix pack generation when using pack_size_limit Nicolas Pitre
2010-02-04  3:48 ` [PATCH 3/3] make --max-pack-size argument to 'git pack-object' count in bytes Nicolas Pitre
2010-02-04  4:00   ` Shawn O. Pearce
2010-02-04  4:38     ` Junio C Hamano
2010-02-04 17:11       ` Junio C Hamano
2010-02-04 17:24         ` Shawn O. Pearce
2010-02-04 17:58           ` Nicolas Pitre
2010-02-04 17:59             ` Shawn O. Pearce
2010-02-04 19:10               ` [PATCH] fast-import: count --max-pack-size " Junio C Hamano
2010-02-04 19:13                 ` Shawn O. Pearce
2010-02-04 20:03                 ` Ilari Liusvaara
2010-02-04 17:49         ` [PATCH 3/3] make --max-pack-size argument to 'git pack-object' count " Nicolas Pitre
2010-02-04 18:00           ` Shawn O. Pearce
2010-02-04 18:11             ` Nicolas Pitre
2010-02-04 21:20               ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).