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:27:24 +02:00 committed by Edward Hervey
parent 647eefea67
commit d524439b35
35 changed files with 66 additions and 593 deletions

View file

@ -240,6 +240,11 @@ aacparse_suite (void)
Suite *s = suite_create ("aacparse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "aacparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
suite_add_tcase (s, tc_chain);
/* ADIF tests */
tcase_add_test (tc_chain, test_parse_adif_normal);
@ -267,25 +272,4 @@ aacparse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = aacparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "aacparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (aacparse);

View file

@ -122,6 +122,11 @@ ac3parse_suite (void)
Suite *s = suite_create ("ac3parse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "ac3parse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_normal);
tcase_add_test (tc_chain, test_parse_drain_single);
@ -139,25 +144,4 @@ ac3parse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = ac3parse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "ac3parse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (ac3parse);

View file

@ -408,19 +408,4 @@ apev2mux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = apev2mux_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 (apev2mux);

View file

@ -172,19 +172,4 @@ aspectratiocrop_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = aspectratiocrop_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 (aspectratiocrop);

View file

@ -464,19 +464,4 @@ amplify_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = amplify_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 (amplify);

View file

@ -1667,19 +1667,4 @@ audiochebband_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = audiochebband_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 (audiochebband);

View file

@ -1083,19 +1083,4 @@ audiocheblimit_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = audiocheblimit_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 (audiocheblimit);

View file

@ -439,19 +439,4 @@ dynamic_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = dynamic_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 (dynamic);

View file

@ -281,19 +281,4 @@ invert_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = invert_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 (invert);

View file

@ -1134,19 +1134,4 @@ audiowsincband_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = audiowsincband_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 (audiowsincband);

View file

@ -785,19 +785,4 @@ audiowsinclimit_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = audiowsinclimit_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 (audiowsinclimit);

View file

@ -266,19 +266,4 @@ avimux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = avimux_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 (avimux);

View file

@ -377,19 +377,4 @@ equalizer_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = equalizer_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 (equalizer);

View file

@ -250,6 +250,19 @@ flacparse_suite (void)
Suite *s = suite_create ("flacparse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "flacparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_discard = 3;
ctx_headers[0].data = streaminfo_header;
ctx_headers[0].size = sizeof (streaminfo_header);
ctx_headers[1].data = comment_header;
ctx_headers[1].size = sizeof (comment_header);
/* custom offsets, and ts always repeatedly 0 */
ctx_no_metadata = TRUE;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_flac_normal);
tcase_add_test (tc_chain, test_parse_flac_drain_single);
@ -269,32 +282,4 @@ flacparse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = flacparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "flacparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
ctx_discard = 3;
ctx_headers[0].data = streaminfo_header;
ctx_headers[0].size = sizeof (streaminfo_header);
ctx_headers[1].data = comment_header;
ctx_headers[1].size = sizeof (comment_header);
/* custom offsets, and ts always repeatedly 0 */
ctx_no_metadata = TRUE;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (flacparse);

View file

@ -518,19 +518,4 @@ id3v2mux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = id3v2mux_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 (id3v2mux);

View file

@ -138,19 +138,4 @@ jpegdec_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = jpegdec_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 (jpegdec);

View file

@ -236,19 +236,4 @@ jpegenc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = jpegenc_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 (jpegenc);

View file

@ -477,19 +477,4 @@ matroskamux_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = matroskamux_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 (matroskamux);

View file

@ -129,6 +129,12 @@ mpegaudioparse_suite (void)
Suite *s = suite_create ("mpegaudioparse");
TCase *tc_chain = tcase_create ("general");
/* init test context */
ctx_factory = "mpegaudioparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_parse_normal);
tcase_add_test (tc_chain, test_parse_drain_single);
@ -146,25 +152,4 @@ mpegaudioparse_suite (void)
* - Both push- and pull-modes need to be tested
* * Pull-mode & EOS
*/
int
main (int argc, char **argv)
{
int nf;
Suite *s = mpegaudioparse_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
/* init test context */
ctx_factory = "mpegaudioparse";
ctx_sink_template = &sinktemplate;
ctx_src_template = &srctemplate;
srunner_run_all (sr, CK_NORMAL);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (mpegaudioparse);

View file

@ -1976,19 +1976,4 @@ rganalysis_suite (void)
return s;
}
int
main (int argc, char **argv)
{
gint nf;
Suite *s = rganalysis_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_ENV);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (rganalysis);

View file

@ -274,19 +274,4 @@ rglimiter_suite (void)
return s;
}
int
main (int argc, char **argv)
{
gint nf;
Suite *s = rglimiter_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_ENV);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (rglimiter);

View file

@ -669,19 +669,4 @@ rgvolume_suite (void)
return s;
}
int
main (int argc, char **argv)
{
gint nf;
Suite *s = rgvolume_suite ();
SRunner *sr = srunner_create (s);
gst_check_init (&argc, &argv);
srunner_run_all (sr, CK_ENV);
nf = srunner_ntests_failed (sr);
srunner_free (sr);
return nf;
}
GST_CHECK_MAIN (rgvolume);

View file

@ -687,7 +687,7 @@ GST_START_TEST (test_aux_receiver)
GST_END_TEST;
static Suite *
gstrtpbin_suite (void)
rtpbin_suite (void)
{
Suite *s = suite_create ("rtpbin");
TCase *tc_chain = tcase_create ("general");
@ -706,19 +706,4 @@ gstrtpbin_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = gstrtpbin_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 (rtpbin);

View file

@ -566,7 +566,7 @@ GST_START_TEST (test_internal_sources_timeout)
GST_END_TEST;
static Suite *
gstrtpsession_suite (void)
rtpsession_suite (void)
{
Suite *s = suite_create ("rtpsession");
TCase *tc_chain = tcase_create ("general");
@ -579,19 +579,4 @@ gstrtpsession_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = gstrtpsession_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 (rtpsession);

View file

@ -538,19 +538,4 @@ spectrum_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = spectrum_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 (spectrum);

View file

@ -220,19 +220,4 @@ videobox_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = videobox_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 (videobox);

View file

@ -816,19 +816,4 @@ videocrop_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = videocrop_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 (videocrop);

View file

@ -263,19 +263,4 @@ videofilter_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = videofilter_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 (videofilter);

View file

@ -240,19 +240,4 @@ wavpackdec_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = wavpackdec_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 (wavpackdec);

View file

@ -179,19 +179,4 @@ wavpackenc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = wavpackenc_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 (wavpackenc);

View file

@ -231,19 +231,4 @@ wavpackparse_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = wavpackparse_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 (wavpackparse);

View file

@ -165,19 +165,4 @@ y4menc_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = y4menc_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 (y4menc);

View file

@ -303,19 +303,4 @@ simple_launch_lines_suite (void)
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

@ -353,20 +353,4 @@ metadata_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = metadata_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 (metadata);

View file

@ -202,18 +202,4 @@ wavpack_suite (void)
return s;
}
int
main (int argc, char **argv)
{
int nf;
Suite *s = wavpack_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 (wavpack);