[glom/gtkmm4v4] Don't return boolean literal from main().



commit 327c88df5aa243ae41b6f6db4cc426a3fc1f92cf
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            |   34 ++++++++++++++++----------------
 tests/test_document_load_and_change.cc |   32 +++++++++++++++---------------
 2 files changed, 33 insertions(+), 33 deletions(-)
---
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index 659fb7b..4ab19d4 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -262,7 +262,7 @@ int main()
   if(!module_names.empty()) //TODO: Test a document that actually has some?
   {
     std::cerr << G_STRFUNC << ": Failure: Unexpected library module names.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
 
@@ -272,32 +272,32 @@ int main()
   if(print_layout_names.size() != 1)
   {
     std::cerr << G_STRFUNC << ": Failure: Unexpected number of print layouts.\n";
-    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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   const auto print_layout = document->get_print_layout("contacts", "contact_details");
   if(!print_layout)
   {
     std::cerr << G_STRFUNC << ": Failure: Could not get an expected print layout.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   if(print_layout->get_title_original() != "Contact Details")
   {
     std::cerr << G_STRFUNC << ": Failure: Unexpected print layout title.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   if(!print_layout->get_layout_group())
   {
     std::cerr << G_STRFUNC << ": Failure: The print layout has no layout group.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
 
@@ -306,32 +306,32 @@ int main()
   if(report_names.size() != 2)
   {
     std::cerr << G_STRFUNC << ": Failure: Unexpected number of reports.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   if(!contains(report_names, "by_country"))
   {
     std::cerr << G_STRFUNC << ": Failure: Could not find the expected report name.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   const auto report = document->get_report("contacts", "by_country_by_town");
   if(!report)
   {
     std::cerr << G_STRFUNC << ": Failure: Could not get an expected report.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   if(report->get_title_original() != "By Country, By Town")
   {
     std::cerr << G_STRFUNC << ": Failure: Unexpected report title.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   if(!report->get_layout_group())
   {
     std::cerr << G_STRFUNC << ": Failure: The report has no layout group.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
 
@@ -356,13 +356,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.\n";
-    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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
 
@@ -375,7 +375,7 @@ int main()
   if(!portal)
   {
     std::cerr << G_STRFUNC << ": Failure: Could not get the portal from the layout.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   Glib::ustring navigation_table_name;
@@ -385,19 +385,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.\n";
-    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 6390409..590cb24 100644
--- a/tests/test_document_load_and_change.cc
+++ b/tests/test_document_load_and_change.cc
@@ -105,14 +105,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.\n";
-    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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   //Check that the original field name is no longer used in the relationship:
@@ -120,20 +120,20 @@ int main()
   if(!relationship)
   {
     std::cerr << G_STRFUNC << ": Failure: The relationship could not be found in the document.\n";
-    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.\n";
-    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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   {
@@ -146,13 +146,13 @@ int main()
     if(document->get_relationship(table_name, relationship_name_original))
     {
       std::cerr << G_STRFUNC << ": Failure: The original relationship name still exists.\n";
-      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.\n";
-      return false;
+      return EXIT_FAILURE;
     }
 
     //Check that the old relationship name is not used.
@@ -162,7 +162,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.\n";
-      return false;
+      return EXIT_FAILURE;
     }
   }
 
@@ -171,7 +171,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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   //Remove a relationship:
@@ -180,7 +180,7 @@ int main()
   if(relationship)
   {
     std::cerr << G_STRFUNC << ": Failure: The removed relationship still exists.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   //Change a table name:
@@ -189,27 +189,27 @@ int main()
   if(document->get_table("invoice_lines"))
   {
     std::cerr << G_STRFUNC << ": Failure: The renamed table still exists.\n";
-    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.\n";
-    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.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   document->remove_table("products");
   if(document->get_table("products"))
   {
     std::cerr << G_STRFUNC << ": Failure: The removed table still exists.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
 
@@ -219,7 +219,7 @@ int main()
   if(!print_layout)
   {
     std::cerr << G_STRFUNC << ": Failure: Could not get an expected print layout.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   document->remove_print_layout("contacts", "contact_details");
@@ -228,7 +228,7 @@ int main()
   if(print_layout)
   {
     std::cerr << G_STRFUNC << ": Failure: The removed print layotu still exists.\n";
-    return false;
+    return EXIT_FAILURE;
   }
 
   //Test user groups:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]