diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-02-24 13:48:19 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-02-24 13:48:19 +0100 |
commit | c4729dc272de46881feb6bd2ac7d7a47ba22423d (patch) | |
tree | a42d03a906b4f37bef7fc3bebcdd3efff7a81751 | |
parent | ab38520b659d5d66d19eb83fb80c41ddc8391eb8 (diff) | |
download | glibmm-c4729dc272de46881feb6bd2ac7d7a47ba22423d.tar.gz |
tests: Remove remaining use of std::cout.
* tests/giomm_ioerror/main.cc:
* tests/giomm_simple/main.cc: Hid some use of std::cout that I missed in my
previous commit.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | tests/giomm_ioerror/main.cc | 9 | ||||
-rw-r--r-- | tests/giomm_simple/main.cc | 9 |
3 files changed, 24 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2011-02-24 Murray Cumming <murrayc@murrayc.com> + tests: Remove remaining use of std::cout. + + * tests/giomm_ioerror/main.cc: + * tests/giomm_simple/main.cc: Hid some use of std::cout that I missed in my + previous commit. + +2011-02-24 Murray Cumming <murrayc@murrayc.com> + tests: Use EXIT_* for clarity. * tests/*.cc: Use EXIT_SUCCESS rather than 0 because I think that is clearer. 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; diff --git a/tests/giomm_simple/main.cc b/tests/giomm_simple/main.cc index 274fb662..35f5cbfe 100644 --- a/tests/giomm_simple/main.cc +++ b/tests/giomm_simple/main.cc @@ -2,6 +2,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; + int main(int, char**) { Glib::init(); @@ -28,7 +35,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; |