[gstreamermm: 131/167] fixed test-plugin-app{sink|src} tests (stupid bug in tests)
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gstreamermm: 131/167] fixed test-plugin-app{sink|src} tests (stupid bug in tests)
- Date: Tue, 3 Sep 2013 19:30:05 +0000 (UTC)
commit ee96ccbdf570a3e798b9b199541e7e105e122c15
Author: Marcin Kolny [loganek] <marcin kolny gmail com>
Date: Mon Aug 5 03:10:09 2013 +0200
fixed test-plugin-app{sink|src} tests (stupid bug in tests)
tests/plugins/test-plugin-appsink.cc | 15 ++++-----------
tests/plugins/test-plugin-appsrc.cc | 7 +++++++
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/tests/plugins/test-plugin-appsink.cc b/tests/plugins/test-plugin-appsink.cc
index 1bad5c0..8a21db1 100644
--- a/tests/plugins/test-plugin-appsink.cc
+++ b/tests/plugins/test-plugin-appsink.cc
@@ -22,8 +22,10 @@ protected:
void CreatePipelineWithElements()
{
- sink = Gst::ElementFactory::create_element("appsink", "sink");
+ pipeline = Gst::Pipeline::create();
+
source = ElementFactory::create_element("appsrc", "source");
+ sink = ElementFactory::create_element("appsink", "sink");
ASSERT_TRUE(sink);
ASSERT_TRUE(source);
@@ -40,12 +42,9 @@ TEST_F(AppSinkPluginTest, CreatePipelineWithAppsink)
TEST_F(AppSinkPluginTest, UseAppSinkDuringDataFlowInPipeline)
{
- sink = Gst::ElementFactory::create_element("appsink", "sink");
+ CreatePipelineWithElements();
RefPtr<AppSink> appsink = appsink.cast_static(sink);
- source = ElementFactory::create_element("appsrc", "source");
RefPtr<AppSrc> appsrc = appsrc.cast_static(source);
- pipeline->add(source)->add(sink);
- source->link(sink);
pipeline->set_state(STATE_PLAYING);
@@ -59,12 +58,6 @@ TEST_F(AppSinkPluginTest, UseAppSinkDuringDataFlowInPipeline)
appsrc->push_buffer(buf);
- {
- State state;
- StateChangeReturn ret = pipeline->get_state(state, state, 1*Gst::SECOND);
- ASSERT_EQ(STATE_CHANGE_SUCCESS, ret);
- }
-
RefPtr<Buffer> buf_out;
RefPtr<Sample> sample = appsink->pull_sample();
ASSERT_TRUE(sample);
diff --git a/tests/plugins/test-plugin-appsrc.cc b/tests/plugins/test-plugin-appsrc.cc
index ebbf303..3217a9f 100644
--- a/tests/plugins/test-plugin-appsrc.cc
+++ b/tests/plugins/test-plugin-appsrc.cc
@@ -20,9 +20,14 @@ protected:
void CreatePipelineWithElements()
{
+ pipeline = Gst::Pipeline::create();
+
RefPtr<Element> sink = Gst::ElementFactory::create_element("fakesink", "sink");
source_element = ElementFactory::create_element("appsrc", "source");
+ ASSERT_TRUE(sink);
+ ASSERT_TRUE(source_element);
+
ASSERT_NO_THROW(pipeline->add(source_element)->add(sink));
ASSERT_NO_THROW(source_element->link(sink));
}
@@ -47,6 +52,8 @@ TEST_F(AppSrcPluginTest, CreatePipelineWithAppSrcElement)
TEST_F(AppSrcPluginTest, SimpleDataFlowInPipelineWitAppSrcElement)
{
+ CreatePipelineWithElements();
+
pipeline->set_state(Gst::STATE_PLAYING);
std::string data = "hello world";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]