[glom] Use EXIT_* instead of 0 and -1.



commit b1b3a25bb0659b89fce436c13a3cd11f91cb9e3d
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Dec 6 20:23:59 2011 +0100

    Use EXIT_* instead of 0 and -1.
    
    	* glom/test_pyembed.cc:
    	* glom/test_pyembed_singleline.cc:
    	* tests/glade_toplevels_instantiation.cc:
    	* tests/test_parsing_time.cc: Use EXIT_SUCCESS and EXIT_FAILURE.

 ChangeLog                              |    9 +++++++++
 glom/test_pyembed.cc                   |    2 +-
 glom/test_pyembed_singleline.cc        |    2 +-
 tests/glade_toplevels_instantiation.cc |   12 ++++++------
 tests/test_parsing_time.cc             |    2 +-
 5 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3ebe72d..d9fec6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-12-06  Murray Cumming  <murrayc murrayc com>
 
+	Use EXIT_* instead of 0 and -1.
+
+	* glom/test_pyembed.cc:
+	* glom/test_pyembed_singleline.cc:
+	* tests/glade_toplevels_instantiation.cc:
+	* tests/test_parsing_time.cc: Use EXIT_SUCCESS and EXIT_FAILURE.
+
+2011-12-06  Murray Cumming  <murrayc murrayc com>
+
 	Document: Avoid useless autosave during constructor.
 
 	* glom/libglom/document/document.cc: Constructor: Avoid triggering
diff --git a/glom/test_pyembed.cc b/glom/test_pyembed.cc
index d7ab2ce..f2b323e 100644
--- a/glom/test_pyembed.cc
+++ b/glom/test_pyembed.cc
@@ -106,5 +106,5 @@ int main ()
   evaluate_function_implementation(func_impl);
 
 
-  return 0;
+  return EXIT_SUCCESS;
 }
diff --git a/glom/test_pyembed_singleline.cc b/glom/test_pyembed_singleline.cc
index e292c90..35dd7e2 100644
--- a/glom/test_pyembed_singleline.cc
+++ b/glom/test_pyembed_singleline.cc
@@ -53,5 +53,5 @@ int main ()
   evaluate_function_implementation(func_impl);
 
    
-  return 0;
+  return EXIT_SUCCESS;
 }
diff --git a/tests/glade_toplevels_instantiation.cc b/tests/glade_toplevels_instantiation.cc
index 7502f1f..c73e095 100644
--- a/tests/glade_toplevels_instantiation.cc
+++ b/tests/glade_toplevels_instantiation.cc
@@ -40,7 +40,7 @@ static bool attempt_instantiation(const std::string& filepath, const xmlpp::Elem
   {
     std::cerr << "Exception from Gtk::Builder::create_from_file() with id=" << id << " from file " << filepath << std::endl;
     std::cerr << "  Error: " << ex.what() << std::endl;
-    return -1;
+    return EXIT_FAILURE;
   }
 
   // Try to get the widget, checking that it has the correct type:
@@ -99,7 +99,7 @@ int main(int argc, char* argv[])
   else
   {
     std::cerr << "Usage: glade_toplevels_instantiation filepath" << std::endl;
-    return -1;
+    return EXIT_FAILURE;
   }
 
   #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
@@ -111,11 +111,11 @@ int main(int argc, char* argv[])
     parser.set_substitute_entities(); //We just want the text to be resolved/unescaped automatically.
     parser.parse_file(filepath);
     if(!parser)
-      return -1;
+      return EXIT_FAILURE;
 
     const xmlpp::Node* root = parser.get_document()->get_root_node(); //deleted by DomParser.
     if(!root)
-      return -1;
+      return EXIT_FAILURE;
 
     const xmlpp::Node::NodeList children = root->get_children("object");
     for(xmlpp::Node::NodeList::const_iterator iter = children.begin(); iter != children.end(); ++iter)
@@ -124,7 +124,7 @@ int main(int argc, char* argv[])
 
        //Try to instante the object with Gtk::Builder:
        if(child && !attempt_instantiation(filepath, child))
-         return -1;
+         return EXIT_FAILURE;
     }
 
   #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
@@ -135,5 +135,5 @@ int main(int argc, char* argv[])
   }
   #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
 
-  return 0;
+  return EXIT_SUCCESS;
 }
diff --git a/tests/test_parsing_time.cc b/tests/test_parsing_time.cc
index be51ed7..34bc575 100644
--- a/tests/test_parsing_time.cc
+++ b/tests/test_parsing_time.cc
@@ -37,7 +37,7 @@ int main()
   if(parsed_time.hour != 13)
   {
     std::cerr << "Failed: The parsed hour was " <<  parsed_time.hour << " instead of 13" << std::endl;
-    return -1; //Failed.
+    return EXIT_FAILURE; //Failed.
   }
 
   if(parsed_time.minute != 0)



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