diff options
author | Joe Orton <jorton@apache.org> | 2004-05-24 09:33:27 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-05-24 09:33:27 +0000 |
commit | 90105ae4fdecbe640358b65f6147780cc8ffc102 (patch) | |
tree | 3fb1cc72bb6ee54bba3d7600e3f7251593e72134 /test/teststr.c | |
parent | 65cb7376d568fb285a71415166535e61c5c14461 (diff) | |
download | apr-90105ae4fdecbe640358b65f6147780cc8ffc102.tar.gz |
* configure.in, include/arch/win32/apr_private.h,
include/arch/netware/apr_private.h: Define APR_OFF_T_STRFN.
* include/apr_strings.h, strings/apr_strings.c: Add apr_strtoff()
function.
* test/teststr.c (string_strtoff): Add test.
Submitted by: Andr�� Malo, Joe Orton
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65120 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/teststr.c')
-rw-r--r-- | test/teststr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/teststr.c b/test/teststr.c index 02ede380f..a01bce07b 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -246,6 +246,20 @@ static void string_strtoi64(abts_case *tc, void *data) } } +static void string_strtoff(abts_case *tc, void *data) +{ + apr_off_t off; + + ABTS_ASSERT(tc, "strtoff fails on out-of-range integer", + apr_strtoff(&off, "999999999999999999999999999999", + NULL, 10) != APR_SUCCESS); + + ABTS_ASSERT(tc, "strtoff does not fail on 1234", + apr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS); + + ABTS_ASSERT(tc, "strtoff parsed 1234 correctly,", off == 1234); +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -257,6 +271,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, string_error, NULL); abts_run_test(suite, string_long, NULL); abts_run_test(suite, string_strtoi64, NULL); + abts_run_test(suite, string_strtoff, NULL); return suite; } |