Commit 8eb910b0e5838d6fef6ef0afe2113d35b047660d

Edward Thomson 2019-06-23T11:26:10

largefile tests: only write 2GB on 32-bit platforms Don't try to feed 4 GB of data to APIs that only take a `size_t` on 32-bit platforms.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tests/object/tree/read.c b/tests/object/tree/read.c
index 4c4636b..6fe224b 100644
--- a/tests/object/tree/read.c
+++ b/tests/object/tree/read.c
@@ -75,7 +75,11 @@ void test_object_tree_read__two(void)
 }
 
 #define BIGFILE "bigfile"
-#define BIGFILE_SIZE (off_t)4 * 1024 * 1024 * 1024 /* 4 GiB */
+#ifdef GIT_ARCH_64
+# define BIGFILE_SIZE (size_t)4 * 1024 * 1024 * 1024 /* 4 GiB */
+#else
+# define BIGFILE_SIZE SIZE_MAX
+#endif
 
 void test_object_tree_read__largefile(void)
 {