summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-07-05 12:46:27 -0400
committerGitHub <noreply@github.com>2016-07-05 12:46:27 -0400
commitb57c176aa94275e539b6673a3fef0bdfaa227e00 (patch)
treea172a2f56b25ee1f7b5c49cc664ef98f7646dce5 /tests
parentd8243465be6ae4c3d0482ec262da58276f3a4e58 (diff)
parent70b9b8417910c97307e1c5dd5886ce76e68e201c (diff)
downloadlibgit2-b57c176aa94275e539b6673a3fef0bdfaa227e00.tar.gz
Merge pull request #3846 from rkrp/fix_bug_parsing_int64min
Fixed bug while parsing INT64_MIN
Diffstat (limited to 'tests')
-rw-r--r--tests/core/strtol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/core/strtol.c b/tests/core/strtol.c
index 8765e042b..0d3b6a5e6 100644
--- a/tests/core/strtol.c
+++ b/tests/core/strtol.c
@@ -33,5 +33,13 @@ void test_core_strtol__int64(void)
cl_assert(i == 2147483657LL);
cl_git_pass(git__strtol64(&i, " -2147483657 ", NULL, 10));
cl_assert(i == -2147483657LL);
+ cl_git_pass(git__strtol64(&i, " 9223372036854775807 ", NULL, 10));
+ cl_assert(i == INT64_MAX);
+ cl_git_pass(git__strtol64(&i, " -9223372036854775808 ", NULL, 10));
+ cl_assert(i == INT64_MIN);
+ cl_git_pass(git__strtol64(&i, " 0x7fffffffffffffff ", NULL, 16));
+ cl_assert(i == INT64_MAX);
+ cl_git_pass(git__strtol64(&i, " -0x8000000000000000 ", NULL, 16));
+ cl_assert(i == INT64_MIN);
}