summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-27 12:57:50 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-27 13:05:50 +0900
commit6cd4180bc97f5b54ad88c69d3eef1dfe9199fbca (patch)
treea983e693f967318bb826a56786556d0efd097f6e
parent05f02fd4a9ccf7ba2209be18ae9abaccd9dae767 (diff)
downloadgit-6cd4180bc97f5b54ad88c69d3eef1dfe9199fbca.tar.gz
-rw-r--r--Makefile2
-rw-r--r--t/helper/test-print-larger-than-ssize.c10
-rw-r--r--t/helper/test-print-values.c10
-rwxr-xr-xt/t5560-http-backend-noserver.sh4
4 files changed, 13 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index e61f8319b3..3380f68040 100644
--- a/Makefile
+++ b/Makefile
@@ -661,7 +661,7 @@ TEST_PROGRAMS_NEED_X += test-mktemp
TEST_PROGRAMS_NEED_X += test-online-cpus
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-path-utils
-TEST_PROGRAMS_NEED_X += test-print-values
+TEST_PROGRAMS_NEED_X += test-print-larger-than-ssize
TEST_PROGRAMS_NEED_X += test-prio-queue
TEST_PROGRAMS_NEED_X += test-read-cache
TEST_PROGRAMS_NEED_X += test-write-cache
diff --git a/t/helper/test-print-larger-than-ssize.c b/t/helper/test-print-larger-than-ssize.c
new file mode 100644
index 0000000000..b9852c493d
--- /dev/null
+++ b/t/helper/test-print-larger-than-ssize.c
@@ -0,0 +1,10 @@
+#include "cache.h"
+
+int cmd_main(int argc, const char **argv)
+{
+ size_t large = ~0;
+
+ large = ~(large & ~(large >> 1)) + 1;
+ printf("%" PRIuMAX "\n", (uintmax_t) large);
+ return 0;
+}
diff --git a/t/helper/test-print-values.c b/t/helper/test-print-values.c
deleted file mode 100644
index 8f7e5af319..0000000000
--- a/t/helper/test-print-values.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-
-int cmd_main(int argc, const char **argv)
-{
- if (argc == 2 && strcmp(argv[1], "(size_t)(-20)") == 0)
- printf("%zu", (ssize_t)(-20));
-
- return 0;
-}
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index f452090216..112b5d6eb2 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -72,7 +72,7 @@ test_expect_success 'http-backend blocks bad PATH_INFO' '
'
# overrides existing definition for further cases
-run_backend() {
+run_backend () {
CONTENT_LENGTH="${#2}" && export CONTENT_LENGTH &&
( echo "$2" && cat /dev/zero ) |
QUERY_STRING="${1#*[?]}" \
@@ -89,7 +89,7 @@ test_expect_success 'CONTENT_LENGTH set and infinite input' '
'
test_expect_success 'CONTENT_LENGTH overflow ssite_t' '
- NOT_FIT_IN_SSIZE=`"$GIT_BUILD_DIR/t/helper/test-print-values" "(size_t)(-20)"` &&
+ NOT_FIT_IN_SSIZE=$("$GIT_BUILD_DIR/t/helper/test-print-larger-than-ssize") &&
env \
CONTENT_TYPE=application/x-git-upload-pack-request \
QUERY_STRING=/repo.git/git-upload-pack \