From bed165c9fc070d2c483d8cc9bd0e7ac299b29e23 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 18 Oct 2020 07:43:05 -0400 Subject: Stop using InputSource::unreadCh --- libtests/closed_file_input_source.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'libtests') 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); -- cgit v1.2.3-54-g00ecf