You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/03/18 18:15:03 UTC
svn commit: r924902 -
/subversion/trunk/subversion/tests/libsvn_subr/stream-test.c
Author: julianfoad
Date: Thu Mar 18 17:15:02 2010
New Revision: 924902
URL: http://svn.apache.org/viewvc?rev=924902&view=rev
Log:
* subversion/tests/libsvn_subr/stream-test.c
(test_stream_range): Fix a bug that meant the second time through the test
loop, nothing was read and the test didn't notice anything was wrong.
Modified:
subversion/trunk/subversion/tests/libsvn_subr/stream-test.c
Modified: subversion/trunk/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/stream-test.c?rev=924902&r1=924901&r2=924902&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/stream-test.c Thu Mar 18 17:15:02 2010
@@ -266,20 +266,20 @@ test_stream_range(apr_pool_t *pool)
/* Even when requesting more data than contained in the range,
* we should only receive data from the range. */
- len = strlen(now) + strlen(after);
-
for (i = 0; i < 2; i++)
{
- /* Read the range. */
+ /* Try to read from "Now", up to and past the end of the range. */
+ len = strlen(now) + 1;
SVN_ERR(svn_stream_read(stream, buf, &len));
- if (len > strlen(now))
+ if (len != strlen(now))
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
- "Read past range");
+ "Read past (or not all of) range");
if (strcmp(buf, now))
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
"Unexpected data");
- /* Reading past the end of the range should be impossible. */
+ /* Try to read from the end of the range - should be impossible. */
+ len = 1;
SVN_ERR(svn_stream_read(stream, buf, &len));
if (len != 0)
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,