diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-02-24 13:42:57 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-02-24 13:42:57 +0100 |
commit | 6edb045a2ec86f67e8a0b3a217c00be6336c05d8 (patch) | |
tree | a26347bfb7a83dbf408dcc3df98903ed584e506a /tests/giomm_asyncresult_sourceobject | |
parent | ba29ea78537d2d41c6b6f54a6180a52ac3ae2937 (diff) | |
download | glibmm-6edb045a2ec86f67e8a0b3a217c00be6336c05d8.tar.gz |
Actually run all tests, and check some failures.
* tests/Makefile.am: Add all tests to TESTS so they are really run during
make check, instead of just built.
* tests/giomm_asyncresult_sourceobject/main.cc:
* tests/giomm_ioerror/main.cc:
* tests/giomm_simple/main.cc:
* tests/glibmm_bool_arrayhandle/main.cc:
* tests/glibmm_bool_vector/main.cc:
* tests/glibmm_buildfilename/main.cc:
* tests/glibmm_date/main.cc:
* tests/glibmm_ustring_compose/main.cc:
* tests/glibmm_valuearray/main.cc:
* tests/glibmm_variant/main.cc:
* tests/glibmm_vector/main.cc: Remove all use of std::cout by default,
allowing it to be renabled by changing a line.
Return (or) exit with EXIT_FAILURE after any use of std::cerr, so that
make check can report it.
Diffstat (limited to 'tests/giomm_asyncresult_sourceobject')
-rw-r--r-- | tests/giomm_asyncresult_sourceobject/main.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/giomm_asyncresult_sourceobject/main.cc b/tests/giomm_asyncresult_sourceobject/main.cc index 1c9f1a15..9c3bf70a 100644 --- a/tests/giomm_asyncresult_sourceobject/main.cc +++ b/tests/giomm_asyncresult_sourceobject/main.cc @@ -3,15 +3,24 @@ void on_read_async(const Glib::RefPtr<Gio::AsyncResult>& result) { - std::cout << "Testing result ... " - << (result ? "OK!" : "FAILED!") << std::endl; - - std::cout << "Testing get_source_object from gobj() ... " - << (g_async_result_get_source_object(result->gobj()) ? "OK!" : "FAILED!") << std::endl; - - std::cout << "Testing Gio::AsyncResult's get_source_object ... " - << (result->get_source_object_base() ? "OK!" : "FAILED!") << std::endl; - + if(!result) + { + std::cerr << G_STRFUNC << ": result is empty." << std::endl; + exit(EXIT_FAILURE); + } + + if(!g_async_result_get_source_object(result->gobj())) + { + std::cerr << G_STRFUNC << ": g_async_result_get_source_object() failed." << std::endl; + exit(EXIT_FAILURE); + } + + if(!result->get_source_object_base()) + { + std::cerr << G_STRFUNC << ": result->get_source_object_base() failed." << std::endl; + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); } |