diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-02-26 10:46:24 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-02-26 10:46:40 +0100 |
commit | 780b77a044ff7e5edda67d59088a33e06596c77b (patch) | |
tree | 9086c76e2c2d27559a7b87316e6af02665733685 /tests/giomm_simple/main.cc | |
parent | 249bdd539ab05aab98bc417f579524b4e988faef (diff) | |
download | glibmm-780b77a044ff7e5edda67d59088a33e06596c77b.tar.gz |
Run clang-format on tests.
Diffstat (limited to 'tests/giomm_simple/main.cc')
-rw-r--r-- | tests/giomm_simple/main.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/giomm_simple/main.cc b/tests/giomm_simple/main.cc index 175cadf3..7b1e8767 100644 --- a/tests/giomm_simple/main.cc +++ b/tests/giomm_simple/main.cc @@ -2,10 +2,10 @@ #include <iostream> #include <string.h> -//Use this line if you want debug output: -//std::ostream& ostr = std::cout; +// 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: +// This seems nicer and more useful than putting an ifdef around the use of ostr: std::stringstream debug; std::ostream& ostr = debug; @@ -15,7 +15,8 @@ std::ostream& ostr = debug; #define TEST_FILE "/etc/fstab" #endif -int main(int, char**) +int +main(int, char**) { Glib::init(); Gio::init(); @@ -23,37 +24,36 @@ int main(int, char**) try { auto file = Gio::File::create_for_path(TEST_FILE); - if(!file) + if (!file) { std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } auto stream = file->read(); - if(!stream) + if (!stream) { std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } - gchar buffer[1000]; //TODO: This is unpleasant. + gchar buffer[1000]; // TODO: This is unpleasant. memset(buffer, 0, sizeof buffer); const gsize bytes_read = stream->read(buffer, sizeof buffer - 1); - if(bytes_read) + if (bytes_read) ostr << "File contents read: " << buffer << std::endl; else { std::cerr << "Gio::InputStream::read() read 0 bytes." << std::endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } - catch(const Glib::Exception& ex) + catch (const Glib::Exception& ex) { std::cerr << "Exception caught: " << ex.what() << std::endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } return EXIT_SUCCESS; } - |