You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2008/09/18 19:28:44 UTC

svn commit: r696728 - /incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp

Author: kpvdr
Date: Thu Sep 18 10:28:44 2008
New Revision: 696728

URL: http://svn.apache.org/viewvc?rev=696728&view=rev
Log:
Modified return codes for txtest: returns 1 if check fails; 2 if exception is thrown; 0 otherwise.

Modified:
    incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp

Modified: incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp?rev=696728&r1=696727&r2=696728&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/src/tests/txtest.cpp Thu Sep 18 10:28:44 2008
@@ -227,7 +227,7 @@
         }
     }
 
-    void check() 
+    int check() 
     {
         SubscriptionManager subs(session);
         subs.setFlowControl(SubscriptionManager::UNLIMITED, SubscriptionManager::UNLIMITED, false);
@@ -289,7 +289,8 @@
         set_difference(drained.begin(), drained.end(), ids.begin(), ids.end(), back_inserter(extra)); 
 
         if (missing.empty() && extra.empty()) {
-            std::cout << "All expected messages were retrieved." << std::endl;            
+            std::cout << "All expected messages were retrieved." << std::endl;
+            return 0;
         } else {
             if (!missing.empty()) {
                 std::cout << "The following ids were missing:" << std::endl;
@@ -303,6 +304,7 @@
                     std::cout << "    '" << *i << "'" << std::endl;     
                 }            
             }
+            return 1;
         }
     }
 };
@@ -314,10 +316,10 @@
         Controller controller;
         if (opts.init) controller.init(); 
         if (opts.transfer) controller.transfer();
-        if (opts.check) controller.check();
+        if (opts.check) return controller.check();
         return 0;
     } catch(const std::exception& e) {
 	std::cout << e.what() << std::endl;
     }
-    return 1;
+    return 2;
 }