summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-05-01 03:16:30 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-05-01 03:16:30 +0000
commitd1cd5dbccdeb73f57e251b216f3e238960861ce6 (patch)
tree4bc0d25765671b41d8ce1a2686fd3530059b4a70 /test
parentecfdcc37ceb07a86da28f3500def444b7d8f8027 (diff)
downloadlibapr-d1cd5dbccdeb73f57e251b216f3e238960861ce6.tar.gz
apr_file_gets(): Return APR_SUCCESS if any characters are
returned. Any I/O errors or EOF will be reported on the next call. Callers that are coded to expect returned data + APR_EOF when there is no final newline are affected by this change. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64498 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/testfile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/testfile.c b/test/testfile.c
index 4dd30e725..0c350f46e 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -372,12 +372,15 @@ static void test_gets(CuTest *tc)
CuAssertIntEquals(tc, APR_SUCCESS, rv);
rv = apr_file_gets(str, 256, f);
- /* Only one line in the test file, so we should get the EOF on the first
- * call to gets.
+ /* Only one line in the test file, so APR will encounter EOF on the first
+ * call to gets, but we should get APR_SUCCESS on this call and
+ * APR_EOF on the next.
*/
- CuAssertIntEquals(tc, APR_EOF, rv);
+ CuAssertIntEquals(tc, APR_SUCCESS, rv);
CuAssertStrEquals(tc, TESTSTR, str);
-
+ rv = apr_file_gets(str, 256, f);
+ CuAssertIntEquals(tc, APR_EOF, rv);
+ CuAssertStrEquals(tc, "", str);
apr_file_close(f);
}