diff options
author | Krishna Ram Prakash R <krp@gtux.in> | 2016-06-28 20:19:52 +0530 |
---|---|---|
committer | Krishna Ram Prakash R <krp@gtux.in> | 2016-06-29 13:32:18 +0530 |
commit | 70b9b8417910c97307e1c5dd5886ce76e68e201c (patch) | |
tree | 952bfc2ea686ff2531416719dd3feca6579996ff /tests | |
parent | 20302aa43738a972e0bd2e2ee6ae479208427b31 (diff) | |
download | libgit2-70b9b8417910c97307e1c5dd5886ce76e68e201c.tar.gz |
Fixed bug while parsing INT64_MIN
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/strtol.c | 8 |
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); } |