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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Aug 30 11:29:13 CDT 2010


branch "master" has been updated
       via  27582ddfbf97cda771d5ad551430416ce2935d91 (commit)
      from  2b55882009f8a821bfacd0b40ede6cffce324881 (commit)

Summary of changes:
 test/TestRTPpjmedia.cpp |   49 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit 27582ddfbf97cda771d5ad551430416ce2935d91
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Aug 30 13:38:53 2010 -0300

    Add a test case for writing frames to a sink that has no remote destination details yet.

diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index db34eea..1e74843 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -482,6 +482,55 @@ BOOST_AUTO_TEST_CASE(PushPayloadMappings)
 }
 
 /**
+ * Attempt to send a frame to an RTP session sink that has no destination yet
+ */
+BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
+{
+	bool graceful = false;
+
+	try
+	{
+		AudioFormatPtr format = new AudioFormat();
+		format->name = "test_format";
+		format->frameSize = 20;
+
+		AudioFramePtr frame = new AudioFrame();
+		frame->mediaformat = format;
+
+		/* Populate the payload with some useless data, but enough to confirm the payload passes unaltered. */
+		frame->payload.push_back('a');
+		frame->payload.push_back('b');
+		frame->payload.push_back('c');
+		frame->payload.push_back('d');
+		frame->payload.push_back('e');
+		frame->payload.push_back('f');
+		frame->payload.push_back('g');
+		frame->payload.push_back('h');
+		frame->payload.push_back('i');
+		frame->payload.push_back('j');
+
+		FrameSeq frames;
+		frames.push_back(frame);
+
+		StreamSinkSeq sinks = Testbed.session->getSinks();
+		StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
+		sink->write(frames);
+
+		graceful = true;
+	}
+	catch (const Ice::Exception &e)
+	{
+		BOOST_TEST_MESSAGE(e.ice_name());
+		BOOST_TEST_MESSAGE(e.what());
+	}
+	catch (...)
+	{
+	}
+
+	BOOST_CHECK(graceful);
+}
+
+/**
  * Setup RTP loopback from the session to, well, the session
  */
 BOOST_AUTO_TEST_CASE(SetupLoopback)

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list