hlsdemux: tests: pass test name into test setup function

All hlsdemux tests create a GstStructure called "state" that can be used
by test cases to store information during a test. The name of this
structure is arbitrary. When the code was written, the intention was
to use the name of the test, to aid debugging. However, during
development this was lost, so that the state GstStructure is always
given the name "setup_test_variables".

This commit changes this so that the name of the test is used.

https://bugzilla.gnome.org/show_bug.cgi?id=762684
This commit is contained in:
Alex Ashley 2016-01-18 08:50:34 +00:00 committed by Tim-Philipp Müller
parent dff4c6d499
commit 35e00becfe

View file

@ -76,7 +76,8 @@ generate_transport_stream (guint length)
}
static GByteArray *
setup_test_variables (GstHlsDemuxTestInputData * inputTestData,
setup_test_variables (const gchar * funcname,
GstHlsDemuxTestInputData * inputTestData,
GstAdaptiveDemuxTestExpectedOutput * outputTestData,
GstHlsDemuxTestCase * hlsTestCase,
GstAdaptiveDemuxTestCase * engineTestData, guint segment_size)
@ -98,7 +99,7 @@ setup_test_variables (GstHlsDemuxTestInputData * inputTestData,
}
}
hlsTestCase->input = inputTestData;
hlsTestCase->state = gst_structure_new_empty (__FUNCTION__);
hlsTestCase->state = gst_structure_new_empty (funcname);
return mpeg_ts;
}
@ -110,7 +111,7 @@ setup_test_variables (GstHlsDemuxTestInputData * inputTestData,
GByteArray *mpeg_ts=NULL; \
engineTestData = gst_adaptive_demux_test_case_new(); \
fail_unless (engineTestData!=NULL); \
mpeg_ts = setup_test_variables(inputTestData, outputTestData, \
mpeg_ts = setup_test_variables(__FUNCTION__, inputTestData, outputTestData, \
&hlsTestCase, engineTestData, segment_size); \
#define TESTCASE_UNREF_BOILERPLATE do{ \
@ -369,7 +370,7 @@ GST_START_TEST (testSeek)
GByteArray *mpeg_ts = NULL;
engineTestData = gst_adaptive_demux_test_case_new ();
mpeg_ts = setup_test_variables (inputTestData, outputTestData,
mpeg_ts = setup_test_variables (__FUNCTION__, inputTestData, outputTestData,
&hlsTestCase, engineTestData, segment_size);
http_src_callbacks.src_start = gst_hlsdemux_test_src_start;
@ -425,7 +426,7 @@ run_seek_position_test (gdouble rate, GstSeekType start_type,
GByteArray *mpeg_ts = NULL;
engineTestData = gst_adaptive_demux_test_case_new ();
mpeg_ts = setup_test_variables (inputTestData, outputTestData,
mpeg_ts = setup_test_variables (__FUNCTION__, inputTestData, outputTestData,
&hlsTestCase, engineTestData, segment_size);
http_src_callbacks.src_start = gst_hlsdemux_test_src_start;