[glom] test_selfhosting_new_empty: Simplify the cleanup code.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] test_selfhosting_new_empty: Simplify the cleanup code.
- Date: Mon, 30 Jan 2012 19:56:44 +0000 (UTC)
commit c3a5feaba3549ae304055c0c1f337c87de5f25e9
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jan 30 20:55:25 2012 +0100
test_selfhosting_new_empty: Simplify the cleanup code.
* tests/test_selfhosting_new_empty.cc: Call cleanup if test() returns
false, like we in the other tests, to avoid calling it in too many
places.
ChangeLog | 8 ++++++++
tests/test_selfhosting_new_empty.cc | 8 +++-----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b896600..0b3e36c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2012-01-30 Murray Cumming <murrayc murrayc com>
+ test_selfhosting_new_empty: Simplify the cleanup code.
+
+ * tests/test_selfhosting_new_empty.cc: Call cleanup if test() returns
+ false, like we in the other tests, to avoid calling it in too many
+ places.
+
+2012-01-30 Murray Cumming <murrayc murrayc com>
+
Require the latest goocanvas because it has fixes that PrintLayout needs.
* configure.ac: Require goocanvas 2.0.1.
diff --git a/tests/test_selfhosting_new_empty.cc b/tests/test_selfhosting_new_empty.cc
index 2b1d794..3ef62dc 100644
--- a/tests/test_selfhosting_new_empty.cc
+++ b/tests/test_selfhosting_new_empty.cc
@@ -125,7 +125,6 @@ static bool test(Glom::Document::HostingMode hosting_mode)
if(db_name.empty())
{
std::cerr << "DbUtils::get_unused_database_name) failed." << std::endl;
- cleanup();
return false;
}
@@ -135,7 +134,6 @@ static bool test(Glom::Document::HostingMode hosting_mode)
if(!created)
{
std::cerr << "DbUtils::create_database() failed." << std::endl;
- cleanup();
return false;
}
@@ -151,12 +149,10 @@ static bool test(Glom::Document::HostingMode hosting_mode)
catch(const Glom::ExceptionConnection& ex)
{
std::cerr << "Exception: " << ex.what() << std::endl;
- cleanup();
return false;
}
-
+
cleanup();
-
return true;
}
@@ -167,12 +163,14 @@ int main()
if(!test(Glom::Document::HOSTING_MODE_POSTGRES_SELF))
{
std::cerr << "Failed with PostgreSQL" << std::endl;
+ cleanup();
return EXIT_FAILURE;
}
if(!test(Glom::Document::HOSTING_MODE_SQLITE))
{
std::cerr << "Failed with SQLite" << std::endl;
+ cleanup();
return EXIT_FAILURE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]