Commit d524439b authored by Edward Hervey's avatar Edward Hervey Committed by Edward Hervey
Browse files

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 ...)
parent 647eefea
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment