git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Alexander Strasser <eclipse7@gmx.net>
Cc: git@vger.kernel.org,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH 7/6?] t4012: use 'printf' instead of 'dd' to generate a binary file
Date: Thu, 12 Jul 2012 09:13:23 +0200	[thread overview]
Message-ID: <4FFE7913.3090500@viscovery.net> (raw)
In-Reply-To: <20120711221140.GA21303@akuma>

From: Johannes Sixt <j6t@kdbg.org>

For some reason, 'echo X | dd bs=1k seek=1' creates a file with 2050 bytes
on Windows instead of the expected 1026 bytes, so that a test fails. Since
the actual contents of the file are irrelevant as long as there is at
least one zero byte so that the diff machinery recognizes it as binary,
use printf to generate it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 While the focus is on t4012, maybe you can add this patch to the series.

 t/t4012-diff-binary.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh
index 6cebb39..8c018ab 100755
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
@@ -125,7 +125,7 @@ cat >expect <<EOF
 EOF
 
 test_expect_success 'diff --stat with binary files and big change count' '
-	echo X | dd of=binfile bs=1k seek=1 &&
+	printf "\01\00%1024d" 1 >binfile &&
 	git add binfile &&
 	i=0 &&
 	while test $i -lt 10000; do
-- 
1.7.11.1.1304.g11834c6

  reply	other threads:[~2012-07-12  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 22:11 [PATCH 0/6] Cleaning up t4012 Alexander Strasser
2012-07-12  7:13 ` Johannes Sixt [this message]
2012-07-12 22:25   ` [PATCH 7/6?] t4012: use 'printf' instead of 'dd' to generate a binary file Alexander Strasser
2012-07-16 20:40 ` [PATCH v2 0/8] Cleaning up t4012 Alexander Strasser
2012-07-16 20:43   ` [PATCH v2 1/8] t4012: modernize style for quoting Alexander Strasser
2012-07-16 20:43   ` [PATCH v2 2/8] t4012: Unquote git command fragment in test title Alexander Strasser
2012-07-16 20:43   ` [PATCH v2 3/8] t4012: Actually quote the sed script Alexander Strasser
2012-07-16 20:44   ` [PATCH v2 4/8] t4012: Break up pipe into serial redirections Alexander Strasser
2012-07-16 20:45   ` [PATCH v2 5/8] t4012: Make --shortstat test more robust Alexander Strasser
2012-07-16 20:45   ` [PATCH v2 6/8] t4012: Re-indent test snippets Alexander Strasser
2012-07-16 20:46   ` [PATCH v2 7/8] t4012: use 'printf' instead of 'dd' to generate a binary file Alexander Strasser
2012-07-16 20:47   ` [PATCH v2 8/8] t4012: Use test_must_fail instead of if-else Alexander Strasser
2012-07-16 21:11   ` [PATCH v2 0/8] Cleaning up t4012 Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFE7913.3090500@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=eclipse7@gmx.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).