diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-02-01 06:22:36 -0800 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-02-09 10:58:22 +0000 |
commit | 619f61a8f110de71422d62e14e22c84865c3091c (patch) | |
tree | cd2f7b43b95a9406f7c2bfb331753099c7492555 /tests | |
parent | 7ec7aa4a7396c80bfe557590bfae83b7a51458d3 (diff) | |
download | libgit2-619f61a8f110de71422d62e14e22c84865c3091c.tar.gz |
odb: error when we can't create object header
Return an error to the caller when we can't create an object header for
some reason (printf failure) instead of simply asserting.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/odb/largefiles.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/odb/largefiles.c b/tests/odb/largefiles.c index cd3651b4a..a5b982e14 100644 --- a/tests/odb/largefiles.c +++ b/tests/odb/largefiles.c @@ -87,10 +87,10 @@ void test_odb_largefiles__streamread(void) git_odb_stream *stream; char buf[10240]; char hdr[64]; - size_t len, total = 0; + size_t len, hdr_len, total = 0; git_hash_ctx hash; git_otype type; - int hdr_len, ret; + int ret; #ifndef GIT_ARCH_64 cl_skip(); @@ -108,7 +108,7 @@ void test_odb_largefiles__streamread(void) cl_assert_equal_i(GIT_OBJ_BLOB, type); cl_git_pass(git_hash_ctx_init(&hash)); - hdr_len = git_odb__format_object_header(hdr, sizeof(hdr), len, type); + cl_git_pass(git_odb__format_object_header(&hdr_len, hdr, sizeof(hdr), len, type)); cl_git_pass(git_hash_update(&hash, hdr, hdr_len)); |