summaryrefslogtreecommitdiff
path: root/tests/giomm_simple/main.cc
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2011-02-24 13:48:19 +0100
committerMurray Cumming <murrayc@murrayc.com>2011-02-24 13:48:19 +0100
commitc4729dc272de46881feb6bd2ac7d7a47ba22423d (patch)
treea42d03a906b4f37bef7fc3bebcdd3efff7a81751 /tests/giomm_simple/main.cc
parentab38520b659d5d66d19eb83fb80c41ddc8391eb8 (diff)
downloadglibmm-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.
Diffstat (limited to 'tests/giomm_simple/main.cc')
-rw-r--r--tests/giomm_simple/main.cc9
1 files changed, 8 insertions, 1 deletions
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;