[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 24 13:50:47 CDT 2011


branch "master" has been updated
       via  9ebdc19da47c48de3c9ae080431dec36817c29b7 (commit)
      from  e8164ed94af4df2f2d74b568cdaf7be78f666aba (commit)

Summary of changes:
 src/MediaRTPpjmedia.cpp |    2 +-
 test/TestRTPpjmedia.cpp |   23 ++++++++++++++++++++---
 2 files changed, 21 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 9ebdc19da47c48de3c9ae080431dec36817c29b7
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 24 15:50:08 2011 -0300

    Use correct logic for determining if pjlib has been built with IPv6 support and add a test for confirming the RTP service can not be found if IPv6 is requested but is not supported.

diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index 93d6eae..b11f220 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -192,7 +192,7 @@ public:
 	// This is done on purpose for additional checks in the future
 	if (params->ipv6 == true)
 	{
-#ifdef PJ_HAS_IPV6
+#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
 	    result = true;
 #else
 	    result = false;
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 3f5e06e..ce1e069 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -310,7 +310,7 @@ private:
 
 BOOST_GLOBAL_FIXTURE(GlobalIceFixture);
 
-#if !defined(IPV6_TEST) || defined(PJ_HAS_IPV6)
+#if !defined(IPV6_TEST) || (defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0)
 
 /**
  * Confirm that we find the rtp media session service based on category
@@ -1117,10 +1117,27 @@ BOOST_AUTO_TEST_CASE(ReleaseRTPSession)
 #else
 
 /**
- * Dummy test in case IPv6 is not supported
+ * Test used to confirm the RTP component can not be found when IPv6 is requested but not supported
  */
-BOOST_AUTO_TEST_CASE(DummyTest)
+BOOST_AUTO_TEST_CASE(IPv6ServiceNotFoundUsingName)
 {
+    bool found = false;
+
+    try {
+        RTPServiceLocatorParamsPtr params = new RTPServiceLocatorParams();
+        params->category = "rtp";
+	params->ipv6 = true;
+
+        Testbed.locator->locate(params);
+
+        found = true;
+    } catch (const Ice::Exception &e) {
+        BOOST_TEST_MESSAGE(e.ice_name());
+        BOOST_TEST_MESSAGE(e.what());
+    } catch (...) {
+    }
+
+    BOOST_CHECK(!found);
 }
 
 #endif

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


-- 
asterisk-scf/release/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list