check: Use GST_CHECK_MAIN () macro everywhere

Makes source code smaller, and ensures we go through common initialization
path (like the one that sets up XML unit test output ...)
This commit is contained in:
Edward Hervey 2015-06-02 16:02:37 +02:00 committed by Edward Hervey
parent 0905746c0c
commit e899abea14
23 changed files with 55 additions and 406 deletions

View file

@ -202,19 +202,4 @@ asfmux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = asfmux_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (asfmux);

View file

@ -242,19 +242,4 @@ faac_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = faac_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (faac);

View file

@ -206,19 +206,4 @@ faad_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = faad_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (faad);

View file

@ -134,6 +134,13 @@ h263parse_suite (void)
Suite *s = suite_create ("h263parse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "h263parse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
/* no timing info to parse */
ctx_no_metadata = TRUE;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_normal);
tcase_add_test (tc_chain, test_parse_drain_single);
@ -149,27 +156,4 @@ h263parse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = h263parse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "h263parse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
/* no timing info to parse */
ctx_no_metadata = TRUE;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (h263parse);

View file

@ -1307,6 +1307,9 @@ hlsdemux_suite (void)
Suite *s = suite_create ("hlsdemux_m3u8");
TCase *tc_m3u8 = tcase_create ("m3u8client");
GST_DEBUG_CATEGORY_INIT (fragmented_debug, "hlsdemux_m3u", 0,
"hlsdemux m3u test");
suite_add_tcase (s, tc_m3u8);
tcase_add_test (tc_m3u8, test_load_main_playlist_invalid);
tcase_add_test (tc_m3u8, test_load_main_playlist_rendition);
@ -1342,22 +1345,4 @@ hlsdemux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = hlsdemux_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
GST_DEBUG_CATEGORY_INIT (fragmented_debug, "hlsdemux_m3u", 0,
"hlsdemux m3u test");
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (hlsdemux);

View file

@ -382,19 +382,4 @@ jpegparse_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = jpegparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (jpegparse);

View file

@ -880,19 +880,4 @@ kate_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = kate_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (kate);

View file

@ -192,19 +192,4 @@ mpeg2enc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = mpeg2enc_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpeg2enc);

View file

@ -156,6 +156,16 @@ mpeg4videoparse_suite (void)
Suite *s = suite_create ("mpeg4videoparse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "mpeg4videoparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_headers[0].data = mpeg4_config;
ctx_headers[0].size = sizeof (mpeg4_config);
ctx_verify_buffer = verify_buffer;
/* no timing info to parse */
ctx_no_metadata = TRUE;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_normal);
tcase_add_test (tc_chain, test_parse_drain_single);
@ -171,30 +181,4 @@ mpeg4videoparse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = mpeg4videoparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "mpeg4videoparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_headers[0].data = mpeg4_config;
ctx_headers[0].size = sizeof (mpeg4_config);
ctx_verify_buffer = verify_buffer;
/* no timing info to parse */
ctx_no_metadata = TRUE;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpeg4videoparse);

View file

@ -240,6 +240,16 @@ mpegvideoparse_suite (void)
Suite *s = suite_create ("mpegvideoparse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "mpegvideoparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_headers[0].data = mpeg2_seq;
ctx_headers[0].size = sizeof (mpeg2_seq);
ctx_verify_buffer = verify_buffer;
ctx_setup = setup_element;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_normal);
tcase_add_test (tc_chain, test_parse_drain_single);
@ -257,29 +267,4 @@ mpegvideoparse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = mpegvideoparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "mpegvideoparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_headers[0].data = mpeg2_seq;
ctx_headers[0].size = sizeof (mpeg2_seq);
ctx_verify_buffer = verify_buffer;
ctx_setup = setup_element;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpegvideoparse);

View file

@ -298,19 +298,4 @@ mplex_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = mplex_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mplex);

View file

@ -375,19 +375,4 @@ opus_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = opus_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (opus);

View file

@ -436,18 +436,4 @@ onviftimestamp_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = onviftimestamp_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (onviftimestamp);

View file

@ -71,19 +71,4 @@ timidity_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = timidity_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (timidity);

View file

@ -245,19 +245,4 @@ voaacenc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = voaacenc_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (voaacenc);

View file

@ -176,19 +176,4 @@ voamrwbenc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = voamrwbenc_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (voamrwbenc);

View file

@ -225,20 +225,4 @@ h264parser_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = h264parser_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (h264parser);

View file

@ -581,20 +581,4 @@ mpegts_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = mpegts_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpegts);

View file

@ -164,7 +164,7 @@ GST_START_TEST (test_mis_identified_datas)
GST_END_TEST;
static Suite *
videoparsers_suite (void)
mpegvideoparsers_suite (void)
{
Suite *s = suite_create ("Video Parsers library");
@ -179,20 +179,4 @@ videoparsers_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = videoparsers_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpegvideoparsers);

View file

@ -1273,20 +1273,4 @@ vc1parser_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = vc1parser_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (vc1parser);

View file

@ -212,7 +212,7 @@ GST_START_TEST (test_vp8_parse_inter_frame)
GST_END_TEST;
static Suite *
videoparsers_suite (void)
vp8parsers_suite (void)
{
Suite *s = suite_create ("VP8 Parser library");
@ -225,20 +225,4 @@ videoparsers_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = videoparsers_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (vp8parsers);

View file

@ -349,19 +349,4 @@ GST_END_TEST
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = simple_launch_lines_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (simple_launch_lines);

View file

@ -261,19 +261,4 @@ streamheader_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = streamheader_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (streamheader);