[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "regression-test-setLocalDestIds" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Apr 12 10:46:24 CDT 2011


branch "regression-test-setLocalDestIds" has been created
        at  cde90e906745caf559c47d75d3b65bce89a67091 (commit)

- Log -----------------------------------------------------------------
commit cde90e906745caf559c47d75d3b65bce89a67091
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Apr 12 10:43:31 2011 -0500

    Incorporated review feedback. Using BOOST_FAIL in exception blocks.

diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index b3751ff..c51eafc 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -287,34 +287,25 @@ public:
  */
 BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
 {
-    bool addLocatorSucceeded(true);
     try
     {
         SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
     }
     catch (...)
     {
-        addLocatorSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception adding EndpointLocator.");
+        BOOST_FAIL("Exception adding EndpointLocator.");
     }
 
-    BOOST_CHECK(addLocatorSucceeded);
-
-    bool removeLocatorSucceeded(true);
     try
     {
         SharedTestData::instance.locatorRegistry->removeEndpointLocator("TestChannel");
-
     }
     catch (...)
     {
-        removeLocatorSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception removing EndpointLocator.");
+        BOOST_FAIL("Exception removing EndpointLocator.");
     }
-    BOOST_CHECK(removeLocatorSucceeded);
 
     BOOST_TEST_MESSAGE("Completed AddAndRemoveEndpointLocator test.");
-
 }
 
 /**
@@ -324,7 +315,6 @@ BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
  */
 BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
 {
-    bool addLocatorSucceeded(true);
     try
     {
         SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
@@ -332,27 +322,19 @@ BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
     }
     catch (...)
     {
-        addLocatorSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception adding EndpointLocator the second time.");
+        BOOST_FAIL("Exception adding EndpointLocator the second time.");
     }
 
-    BOOST_CHECK(addLocatorSucceeded);
-
-    bool removeLocatorSucceeded(true);
     try
     {
         SharedTestData::instance.locatorRegistry->removeEndpointLocator("TestChannel");
-
     }
     catch (...)
     {
-        removeLocatorSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception removing EndpointLocator.");
+        BOOST_FAIL("Exception removing EndpointLocator.");
     }
-    BOOST_CHECK(removeLocatorSucceeded);
 
     BOOST_TEST_MESSAGE("Completed AddEndpointLocatorTwice test.");
-
 }
 
 /**
@@ -373,21 +355,16 @@ BOOST_FIXTURE_TEST_CASE(LookupOwnEndpoint, PerTestFixture)
     }
     catch(const IceUtil::Exception &ie)
     {
-        bool IceException(false);
         string msg = "Exception looking up our own endpoint:";
         msg += ie.what();
-        BOOST_TEST_MESSAGE(msg);
-        BOOST_CHECK(IceException);
+        BOOST_FAIL(msg);
     }
     catch (...)
     {
-        bool unknownException(false);
-        BOOST_TEST_MESSAGE("Exception looking up our own endpoint.");
-        BOOST_CHECK(unknownException);
+        BOOST_FAIL("Exception looking up our own endpoint.");
     }
 
     BOOST_TEST_MESSAGE("Completed LookupOwnEndpoint test.");
-
 }
 
 /**
@@ -434,17 +411,13 @@ BOOST_FIXTURE_TEST_CASE(RouteSession, PerTestFixture)
     }
     catch(const IceUtil::Exception &ie)
     {
-        bool IceException(false);
         string msg = "Exception in RouteSession:";
         msg += ie.what();
-        BOOST_TEST_MESSAGE(msg);
-        BOOST_CHECK(IceException);
+        BOOST_FAIL(msg);
     }
     catch (...)
     {
-        bool unknownException(false);
-        BOOST_TEST_MESSAGE("Exception in RouteSession:");
-        BOOST_CHECK(unknownException);
+        BOOST_FAIL("Exception in RouteSession:");
     }
 }
 
@@ -496,17 +469,13 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
     }
     catch(const IceUtil::Exception &ie)
     {
-        bool IceException(false);
         string msg = "Exception routing session:";
         msg += ie.what();
-        BOOST_TEST_MESSAGE(msg);
-        BOOST_CHECK(IceException);
+        BOOST_FAIL(msg);
     }
     catch (...)
     {
-        bool unknownException(false);
-        BOOST_TEST_MESSAGE("Exception routing session.");
-        BOOST_CHECK(unknownException);
+        BOOST_FAIL("Exception routing session.");
     }
 }
 
@@ -571,17 +540,13 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
     }
     catch(const IceUtil::Exception &ie)
     {
-        bool IceException(false);
         string msg = "Exception in AttendedTransfer:";
         msg += ie.what();
-        BOOST_TEST_MESSAGE(msg);
-        BOOST_CHECK(IceException);
+        BOOST_FAIL(msg);
     }
     catch (...)
     {
-        bool unknownException(false);
-        BOOST_TEST_MESSAGE("Exception in AttendedTransfer:");
-        BOOST_CHECK(unknownException);
+        BOOST_FAIL("Exception in AttendedTransfer:");
     }
 }
 
@@ -590,7 +555,6 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
  */
 BOOST_AUTO_TEST_CASE(ChangeLocatorIds)
 {
-    bool addLocatorSucceeded(true);
     try
     {
         SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", 
@@ -599,12 +563,9 @@ BOOST_AUTO_TEST_CASE(ChangeLocatorIds)
     }
     catch (...)
     {
-        addLocatorSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception adding EndpointLocator.");
+        BOOST_FAIL("Exception adding EndpointLocator.");
     }
 
-    BOOST_REQUIRE(addLocatorSucceeded);
-
     // Change the set of ids that our mock endpoint locator is supporting locally. 
     SharedTestData::instance.endpointLocator->clear();
 
@@ -616,7 +577,6 @@ BOOST_AUTO_TEST_CASE(ChangeLocatorIds)
     SharedTestData::instance.regExIds.push_back("def");  
 
     // Tell the routing service we have different destination ids
-    bool modSucceeded(true);
     try
     {
         std::vector<std::string> newvals;
@@ -626,13 +586,10 @@ BOOST_AUTO_TEST_CASE(ChangeLocatorIds)
     }
     catch (...)
     {
-        modSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception modifying EndpointLocator.");
+        BOOST_FAIL("Exception modifying EndpointLocator.");
     }
-    BOOST_REQUIRE(modSucceeded);
 
     // Now make sure we can do a lookup with the new ids. 
-    bool lookupSucceeded(true);
     try
     {
         BOOST_TEST_MESSAGE("Looking up endpoint via Routing Service...");
@@ -646,12 +603,8 @@ BOOST_AUTO_TEST_CASE(ChangeLocatorIds)
     }
     catch (...)
     {
-        lookupSucceeded = false;
-        BOOST_TEST_MESSAGE("Exception during lookup of modified EndpointLocator.");
+        BOOST_FAIL("Exception during lookup of modified EndpointLocator.");
     }
 
-    BOOST_CHECK(lookupSucceeded);
-
     BOOST_TEST_MESSAGE("Completed ChangeLocatorIds test.");
-
 }

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list