diff options
Diffstat (limited to 'tests/giomm_ioerror/main.cc')
-rw-r--r-- | tests/giomm_ioerror/main.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/giomm_ioerror/main.cc b/tests/giomm_ioerror/main.cc index a375e940..0a44d330 100644 --- a/tests/giomm_ioerror/main.cc +++ b/tests/giomm_ioerror/main.cc @@ -6,6 +6,13 @@ #include <iostream> #include <string.h> +//Use this line if you want debug output: +//std::ostream& ostr = std::cout; + +//This seems nicer and more useful than putting an ifdef around the use of ostr: +std::stringstream debug; +std::ostream& ostr = debug; + // This is just to test a workaround in the error.h header. We save and #undef // HOST_NOT_FOUND if it was defined by another header, and then restore it at // the end of the header. Here I'm just making sure that our temporary value @@ -40,7 +47,7 @@ int main(int, char**) const gsize bytes_read = stream->read(buffer, sizeof buffer - 1); if(bytes_read) - std::cout << "File contents read: " << buffer << std::endl; + ostr << "File contents read: " << buffer << std::endl; else { std::cerr << "Gio::InputStream::read() read 0 bytes." << std::endl; |