summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-05-24 14:12:11 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-05-24 14:12:11 +0000
commit787ed764d359e9e81e9e866c04c180c5182e9e11 (patch)
tree26ef95cfcdc63b96f442cad3713195fbf2a5a3d4 /test
parent033ca27e592f9bd154dca61636c4b0dfd5c6d6e6 (diff)
downloadlibapr-787ed764d359e9e81e9e866c04c180c5182e9e11.tar.gz
* test/testfile.c (test_readzero): New test.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65126 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/testfile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/testfile.c b/test/testfile.c
index 55814bd4c..98ef42fbc 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -90,6 +90,23 @@ static void test_read(abts_case *tc, void *data)
apr_file_close(filetest);
}
+static void test_readzero(abts_case *tc, void *data)
+{
+ apr_status_t rv;
+ apr_size_t nbytes = 0;
+ char *str = NULL;
+ apr_file_t *filetest;
+
+ rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p);
+ apr_assert_success(tc, "Opening test file " FILENAME, rv);
+
+ rv = apr_file_read(filetest, str, &nbytes);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ ABTS_INT_EQUAL(tc, 0, nbytes);
+
+ apr_file_close(filetest);
+}
+
static void test_filename(abts_case *tc, void *data)
{
const char *str;
@@ -536,6 +553,7 @@ abts_suite *testfile(abts_suite *suite)
abts_run_test(suite, test_open_read, NULL);
abts_run_test(suite, test_open_readwrite, NULL);
abts_run_test(suite, test_read, NULL);
+ abts_run_test(suite, test_readzero, NULL);
abts_run_test(suite, test_seek, NULL);
abts_run_test(suite, test_filename, NULL);
abts_run_test(suite, test_fileclose, NULL);