From 3fcc19cac0f3a1f2b7322f40478c524c64c31dd4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 18 Oct 2005 11:13:34 +0000 Subject: [PATCH] check/: Add future test for clock selection. Original commit message from CVS: * check/Makefile.am: * check/clocks/selection.c: (GST_START_TEST), (volume_suite), (main): Add future test for clock selection. --- ChangeLog | 7 +++ check/Makefile.am | 1 + check/clocks/selection.c | 71 +++++++++++++++++++++++++++ tests/check/Makefile.am | 1 + tests/check/generic/clock-selection.c | 71 +++++++++++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 check/clocks/selection.c create mode 100644 tests/check/generic/clock-selection.c diff --git a/ChangeLog b/ChangeLog index 0d1f4b529d..4121c737c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-18 Wim Taymans + + * check/Makefile.am: + * check/clocks/selection.c: (GST_START_TEST), (volume_suite), + (main): + Add future test for clock selection. + 2005-10-18 Wim Taymans * ext/alsa/gstalsasink.c: (gst_alsasink_init), diff --git a/check/Makefile.am b/check/Makefile.am index 9b5c44f2b8..0975bdbbf7 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -32,6 +32,7 @@ check_PROGRAMS = \ elements/audioresample \ elements/volume \ pipelines/simple_launch_lines \ + clocks/selection \ $(check_vorbis) # tests to fix leaks in diff --git a/check/clocks/selection.c b/check/clocks/selection.c new file mode 100644 index 0000000000..8d5a1562cc --- /dev/null +++ b/check/clocks/selection.c @@ -0,0 +1,71 @@ +/* GStreamer + * + * unit test for clock selection + * + * Copyright (C) <2005> Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + +#include + +GST_START_TEST (test_add) +{ + GstElement *pipeline; + GstStateChangeReturn ret; + + pipeline = gst_pipeline_new ("pipeline"); + fail_unless (pipeline != NULL, "could not create pipeline"); + + ret = gst_element_set_state (pipeline, GST_STATE_READY); + fail_unless (ret == GST_STATE_CHANGE_SUCCESS, "could not set to READY"); + + /* cleanup */ + gst_object_unref (pipeline); +} + +GST_END_TEST; + +Suite * +volume_suite (void) +{ + Suite *s = suite_create ("clocks"); + TCase *tc_chain = tcase_create ("general"); + + suite_add_tcase (s, tc_chain); + tcase_add_test (tc_chain, test_add); + + return s; +} + +int +main (int argc, char **argv) +{ + int nf; + + Suite *s = volume_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; +} diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 9b5c44f2b8..0975bdbbf7 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -32,6 +32,7 @@ check_PROGRAMS = \ elements/audioresample \ elements/volume \ pipelines/simple_launch_lines \ + clocks/selection \ $(check_vorbis) # tests to fix leaks in diff --git a/tests/check/generic/clock-selection.c b/tests/check/generic/clock-selection.c new file mode 100644 index 0000000000..8d5a1562cc --- /dev/null +++ b/tests/check/generic/clock-selection.c @@ -0,0 +1,71 @@ +/* GStreamer + * + * unit test for clock selection + * + * Copyright (C) <2005> Wim Taymans + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + +#include + +GST_START_TEST (test_add) +{ + GstElement *pipeline; + GstStateChangeReturn ret; + + pipeline = gst_pipeline_new ("pipeline"); + fail_unless (pipeline != NULL, "could not create pipeline"); + + ret = gst_element_set_state (pipeline, GST_STATE_READY); + fail_unless (ret == GST_STATE_CHANGE_SUCCESS, "could not set to READY"); + + /* cleanup */ + gst_object_unref (pipeline); +} + +GST_END_TEST; + +Suite * +volume_suite (void) +{ + Suite *s = suite_create ("clocks"); + TCase *tc_chain = tcase_create ("general"); + + suite_add_tcase (s, tc_chain); + tcase_add_test (tc_chain, test_add); + + return s; +} + +int +main (int argc, char **argv) +{ + int nf; + + Suite *s = volume_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; +}