[glom/glom-1-30] Don't return boolean literal from main().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-30] Don't return boolean literal from main().
- Date: Tue, 20 Jun 2017 19:13:53 +0000 (UTC)
commit c8aca2bbacbb8d5a3e336e734819973f5538202f
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jun 19 20:16:36 2017 +0200
Don't return boolean literal from main().
Noticed by a g++ warning.
tests/test_document_load.cc | 52 ++++++++++++++++----------------
tests/test_document_load_and_change.cc | 32 ++++++++++----------
2 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index b01390f..81e15d1 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -265,79 +265,79 @@ int main()
if(!module_names.empty()) //TODO: Test a document that actually has some?
{
std::cerr << G_STRFUNC << ": Failure: Unexpected library module names." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
- //Test print layouts:
- const std::vector<Glib::ustring> print_layout_names =
+ //Test print layouts:
+ const std::vector<Glib::ustring> print_layout_names =
document.get_print_layout_names("contacts");
if(print_layout_names.size() != 1)
{
std::cerr << G_STRFUNC << ": Failure: Unexpected number of print layouts." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(!contains(print_layout_names, "contact_details"))
{
std::cerr << G_STRFUNC << ": Failure: Could not find the expected print layout name." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
const std::shared_ptr<const Glom::PrintLayout> print_layout = document.get_print_layout("contacts",
"contact_details");
if(!print_layout)
{
std::cerr << G_STRFUNC << ": Failure: Could not get an expected print layout." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
if(print_layout->get_title_original() != "Contact Details")
{
std::cerr << G_STRFUNC << ": Failure: Unexpected print layout title." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
if(!print_layout->get_layout_group())
{
std::cerr << G_STRFUNC << ": Failure: The print layout has no layout group." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
- const std::vector<Glib::ustring> report_names =
+ const std::vector<Glib::ustring> report_names =
document.get_report_names("contacts");
if(report_names.size() != 2)
{
std::cerr << G_STRFUNC << ": Failure: Unexpected number of reports." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(!contains(report_names, "by_country"))
{
std::cerr << G_STRFUNC << ": Failure: Could not find the expected report name." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
const std::shared_ptr<const Glom::Report> report = document.get_report("contacts", "by_country_by_town");
if(!report)
{
std::cerr << G_STRFUNC << ": Failure: Could not get an expected report." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
if(report->get_title_original() != "By Country, By Town")
{
std::cerr << G_STRFUNC << ": Failure: Unexpected report title." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
if(!report->get_layout_group())
{
std::cerr << G_STRFUNC << ": Failure: The report has no layout group." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
-
+
//Test user groups:
Glom::Document::type_list_groups user_groups = document.get_groups();
Glom::GroupInfo group_info_ignored;
@@ -359,13 +359,13 @@ int main()
if(!needs_navigation(document, "scenes", "location_id"))
{
std::cerr << G_STRFUNC << ": Failure: DbUtils::layout_field_should_have_navigation() did not return the
expected result." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(needs_navigation(document, "scenes", "description"))
{
std::cerr << G_STRFUNC << ": Failure: DbUtils::layout_field_should_have_navigation() did not return the
expected result." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
@@ -378,7 +378,7 @@ int main()
if(!portal)
{
std::cerr << G_STRFUNC << ": Failure: Could not get the portal from the layout." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
Glib::ustring navigation_table_name;
@@ -388,19 +388,19 @@ int main()
if(navigation_table_name != "characters")
{
std::cerr << G_STRFUNC << ": Failure: get_suitable_table_to_view_details() returned an unexpected table
name: " << navigation_table_name << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(!navigation_relationship)
{
std::cerr << G_STRFUNC << ": Failure: get_suitable_table_to_view_details() returned an empty
navigation_relationship." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(navigation_relationship->get_relationship_name() != "cast")
{
std::cerr << G_STRFUNC << ": Failure: get_suitable_table_to_view_details() returned an unexpected
navigation_relationship name: " << navigation_relationship->get_relationship_name() << std::endl;
- return false;
+ return EXIT_FAILURE;
}
Glom::libglom_deinit();
diff --git a/tests/test_document_load_and_change.cc b/tests/test_document_load_and_change.cc
index 303613a..ff51a25 100644
--- a/tests/test_document_load_and_change.cc
+++ b/tests/test_document_load_and_change.cc
@@ -106,14 +106,14 @@ int main()
if(document.get_field(table_name, field_name_original))
{
std::cerr << G_STRFUNC << ": Failure: The document should have forgotten about the original field name."
<< std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Check that the new field name is known to the document:
if(!(document.get_field(table_name, field_name_new)))
{
std::cerr << G_STRFUNC << ": Failure: The document does not know about the new field name." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Check that the original field name is no longer used in the relationship:
@@ -121,20 +121,20 @@ int main()
if(!relationship)
{
std::cerr << G_STRFUNC << ": Failure: The relationship could not be found in the document." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(relationship->get_to_field() == field_name_original)
{
std::cerr << G_STRFUNC << ": Failure: The relationship still uses the original field name." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Check that the original field name is no longer used on a layout:
if(field_is_on_a_layout(document, table_name, field_name_original))
{
std::cerr << G_STRFUNC << ": Failure: The original field name is still used on a layout." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
{
@@ -147,13 +147,13 @@ int main()
if(document.get_relationship(table_name, relationship_name_original))
{
std::cerr << G_STRFUNC << ": Failure: The original relationship name still exists." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(!document.get_relationship(table_name, relationship_name_new))
{
std::cerr << G_STRFUNC << ": Failure: The new relationship name does not exist." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Check that the old relationship name is not used.
@@ -163,7 +163,7 @@ int main()
if(field_on_layout->get_relationship_name() != relationship_name_new)
{
std::cerr << G_STRFUNC << ": Failure: A layout item does not use the new relationship name as
expected." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
}
@@ -172,7 +172,7 @@ int main()
if(field_is_on_a_layout(document, "publisher", "publisher_id"))
{
std::cerr << G_STRFUNC << ": Failure: The removed field name is still used on a layout." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Remove a relationship:
@@ -181,7 +181,7 @@ int main()
if(relationship)
{
std::cerr << G_STRFUNC << ": Failure: The removed relationship still exists." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Change a table name:
@@ -190,27 +190,27 @@ int main()
if(document.get_table("invoice_lines"))
{
std::cerr << G_STRFUNC << ": Failure: The renamed table still exists." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
relationship = document.get_relationship("invoices", "invoice_lines");
if(!relationship)
{
std::cerr << G_STRFUNC << ": Failure: The expected relationship does not exist." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
if(relationship->get_to_table() != table_renamed)
{
std::cerr << G_STRFUNC << ": Failure: The relationship's to_table does have been renamed." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
document.remove_table("products");
if(document.get_table("products"))
{
std::cerr << G_STRFUNC << ": Failure: The removed table still exists." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
@@ -220,7 +220,7 @@ int main()
if(!print_layout)
{
std::cerr << G_STRFUNC << ": Failure: Could not get an expected print layout." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
document.remove_print_layout("contacts", "contact_details");
@@ -229,7 +229,7 @@ int main()
if(print_layout)
{
std::cerr << G_STRFUNC << ": Failure: The removed print layotu still exists." << std::endl;
- return false;
+ return EXIT_FAILURE;
}
//Test user groups:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]