aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-10-18 13:43:05 +0200
committerJay Berkenbilt <ejb@ql.org>2020-10-18 13:43:05 +0200
commitbed165c9fc070d2c483d8cc9bd0e7ac299b29e23 (patch)
tree8ce776a0d080bfcf28d42d91aa2e8e1cbfa0c6fa /libtests
parent1a888ee3b1eb296a610ddb8e5a28159b8c97ba99 (diff)
downloadqpdf-bed165c9fc070d2c483d8cc9bd0e7ac299b29e23.tar.zst
Stop using InputSource::unreadCh
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);