summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-12-18 23:11:42 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-02-01 16:50:30 -0800
commit27078e582ed9deee6ed0dac1f8ecabb6bac66c67 (patch)
tree876eef09cc08aea8e9b528854cba4abecf7c7581 /tests
parente118231b02a0744a6b87c65d9e3487c5931ef3a4 (diff)
downloadlibgit2-27078e582ed9deee6ed0dac1f8ecabb6bac66c67.tar.gz
odb_loose: test read_header on large blobs
Test that we can read_header on large blobs. This should succeed on all platforms since we read only a few bytes into memory to be able to parse the header.
Diffstat (limited to 'tests')
-rw-r--r--tests/odb/largefiles.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/odb/largefiles.c b/tests/odb/largefiles.c
index 5a1ec5e2b..762f184b4 100644
--- a/tests/odb/largefiles.c
+++ b/tests/odb/largefiles.c
@@ -158,3 +158,19 @@ void test_odb_largefiles__read_into_memory_rejected_on_32bit(void)
git_odb_object_free(obj);
}
+
+void test_odb_largefiles__read_header(void)
+{
+ git_oid oid;
+ size_t len;
+ git_otype type;
+
+ if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE"))
+ cl_skip();
+
+ writefile(&oid);
+ cl_git_pass(git_odb_read_header(&len, &type, odb, &oid));
+
+ cl_assert_equal_sz(LARGEFILE_SIZE, len);
+ cl_assert_equal_i(GIT_OBJ_BLOB, type);
+}