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

[PATCH revised] git_mkstemps: add test suite test

From
Dale R. Worley <worley@alum.mit.edu>
Date
Aug 6, 2013, 18:05 UTC
Message-ID
<201308061805.r76I51If026086@freeze.ariadne.com>

Commit a2cb86 ("git_mkstemps: correctly test return value of open()", 12 Jul 2013) fixes a bug regarding testing the return of an open() call for success/failure. Add a testsuite test for that fix. The test exercises a situation where that open() is known to return 0.

Signed-off-by: Dale Worley <worley@ariadne.com>
---
This version of the patch cleans up a number of errors in my previous
version (which were ultimately due to my faulty updating of my master
branch).  The commit that added the open() test is now correctly
described.  Since the test was not present in the test suite at all,
the patch is described as adding the test rather than improving it.

a2cb86 is on branch tr/fd-gotcha-fixes, but that has been merged into master now.

(Thanks for your patience with this.)
Dale
 t/t0070-fundamental.sh | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh
index 986b2a8..d427f3a 100755
--- a/t/t0070-fundamental.sh
+++ b/t/t0070-fundamental.sh
@@ -25,6 +25,13 @@ test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints file
 	grep "cannotwrite/test" err
 '
 
+test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
+	git init &&
+	echo Test. >test-file &&
+	git add test-file &&
+	git commit -m Message. <&-
+'
+
 test_expect_success 'check for a bug in the regex routines' '
 	# if this test fails, re-build git with NO_REGEX=1
 	test-regex
-- 
1.8.4.rc1.24.gd407a5c
Next: Junio C Hamano
Message 1 of 5 in “git_mkstemps: add test suite test”
  1. git_mkstemps: add test suite testDale R. Worley, Aug 6, 2013
  2. Junio C HamanoAug 6, 2013
  3. Dale R. WorleyAug 6, 2013
  4. Dale R. WorleyAug 6, 2013
  5. Junio C HamanoAug 6, 2013

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.