aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'libtests')
-rw-r--r--libtests/closed_file_input_source.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/libtests/closed_file_input_source.cc b/libtests/closed_file_input_source.cc
index f3e4f2ac..2d58cf80 100644
--- a/libtests/closed_file_input_source.cc
+++ b/libtests/closed_file_input_source.cc
@@ -27,22 +27,10 @@ void do_tests(InputSource* is)
check("tell after findAndSkipNextEOL", 522 == is->tell());
char b[1];
b[0] = '\0';
-#ifdef _WIN32
- // Empirical evidence, and the passage of the rest of the qpdf
- // test suite, suggest that this is working on Windows in the way
- // that it needs to work. If this ifdef is made to be true on
- // Windows, it passes with ClosedFileInputSource but not with
- // FileInputSource, which doesn't make any sense since
- // ClosedFileInputSource is calling FileInputSource to do its
- // work.
- is->seek(521, SEEK_SET);
- is->read(b, 1);
-#else
- is->unreadCh('\n');
- check("read unread character", 1 == is->read(b, 1));
+ is->seek(-1, SEEK_CUR);
+ check("read previous character", 1 == is->read(b, 1));
check("got character", '\n' == b[0]);
-#endif
- check("last offset after read unread", 521 == is->getLastOffset());
+ check("last offset after read previous", 521 == is->getLastOffset());
is->seek(0, SEEK_END);
check("tell at end", 556 == is->tell());
is->seek(-25, SEEK_END);