From 72006215cbdbd8dedf553c1b372b35e704548597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 16 May 2024 19:18:52 +0100 Subject: [PATCH] rtp: tests: add run_test_pipeline_full() that checks output caps too Part-of: --- net/rtp/src/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/rtp/src/tests.rs b/net/rtp/src/tests.rs index 7744573b..35379401 100644 --- a/net/rtp/src/tests.rs +++ b/net/rtp/src/tests.rs @@ -188,6 +188,17 @@ pub fn run_test_pipeline( depay: &str, expected_pay: Vec>, expected_depay: Vec>, +) { + run_test_pipeline_full(src, pay, depay, expected_pay, expected_depay, None); +} + +pub fn run_test_pipeline_full( + src: Source, + pay: &str, + depay: &str, + expected_pay: Vec>, + expected_depay: Vec>, + expected_depay_caps: Option, ) { let pipeline = Pipeline(gst::Pipeline::new()); @@ -448,6 +459,12 @@ pub fn run_test_pipeline( depay_samples.len() ); + if let Some(expected_depay_caps) = expected_depay_caps { + if let Some(first_depay_sample) = depay_samples.first() { + assert_eq!(expected_depay_caps, *first_depay_sample.caps().unwrap()); + } + } + for (i, (expected_list, sample)) in Iterator::zip(expected_depay.into_iter(), depay_samples.into_iter()).enumerate() {