From: <tho...@fr...> - 2005-08-20 12:39:27
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: thomasvs Date: Sat Aug 20 2005 05:39:17 PDT Log message: valgrind more tests Modified files: . : ChangeLog check : Makefile.am check/gst : gstiterator.c gstsystemclock.c gsttag.c gst : gstclock.c gstiterator.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1366&r2=1.1367 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/check/Makefile.am.diff?r1=1.36&r2=1.37 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/check/gst/gstiterator.c.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/check/gst/gstsystemclock.c.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/check/gst/gsttag.c.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstclock.c.diff?r1=1.54&r2=1.55 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstiterator.c.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1366 retrieving revision 1.1367 diff -u -d -r1.1366 -r1.1367 --- ChangeLog 20 Aug 2005 12:14:26 -0000 1.1366 +++ ChangeLog 20 Aug 2005 12:39:04 -0000 1.1367 @@ -1,5 +1,15 @@ 2005-08-20 Thomas Vander Stichele <thomas at apestaart dot org> + * check/Makefile.am: + * check/gst/gstiterator.c: (GST_START_TEST): + * check/gst/gstsystemclock.c: (GST_START_TEST), + (gst_systemclock_suite): + * check/gst/gsttag.c: (GST_START_TEST), (gst_tag_suite): + * gst/gstclock.c: + valgrind more tests + +2005-08-20 Thomas Vander Stichele <thomas at apestaart dot org> * check/elements/.cvsignore: * check/elements/gstfakesrc.c: rename to name of element Index: Makefile.am RCS file: /cvs/gstreamer/gstreamer/check/Makefile.am,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Makefile.am 20 Aug 2005 12:14:27 -0000 1.36 +++ Makefile.am 20 Aug 2005 12:39:04 -0000 1.37 @@ -75,14 +75,8 @@ $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la # valgrind testing - -# these just need fixing, period +# these just need valgrind fixing, period TESTS_TO_FIX = \ - gst/gstghostpad \ - gst/gstiterator \ - gst/gstmessage \ - gst/gstsystemclock \ - gst/gsttag \ pipelines/cleanup \ pipelines/simple_launch_lines Index: gstiterator.c RCS file: /cvs/gstreamer/gstreamer/check/gst/gstiterator.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gstiterator.c 20 Aug 2005 12:14:27 -0000 1.4 +++ gstiterator.c 20 Aug 2005 12:39:05 -0000 1.5 @@ -52,25 +52,28 @@ iter = gst_iterator_new_list (m, &cookie, &l, NULL, NULL, NULL); - g_return_if_fail (iter != NULL); + fail_unless (iter != NULL); while (1) { res = gst_iterator_next (iter, &item); if (i < NUM_ELEMENTS) { - g_return_if_fail (res == GST_ITERATOR_OK); - g_return_if_fail (GPOINTER_TO_INT (item) == i); + fail_unless (res == GST_ITERATOR_OK); + fail_unless (GPOINTER_TO_INT (item) == i); i++; continue; } else { - g_return_if_fail (res == GST_ITERATOR_DONE); + fail_unless (res == GST_ITERATOR_DONE); break; } } + /* clean up */ gst_iterator_free (iter); + g_mutex_free (m); } -GST_END_TEST +GST_END_TEST; GST_START_TEST (test_resync) { GList *l; @@ -87,35 +90,40 @@ if (i < NUM_ELEMENTS / 2) { } else if (!hacked_list) { /* here's where we test resync */ l = g_list_prepend (l, GINT_TO_POINTER (-1)); cookie++; hacked_list = TRUE; - g_return_if_fail (res == GST_ITERATOR_RESYNC); + fail_unless (res == GST_ITERATOR_RESYNC); gst_iterator_resync (iter); res = gst_iterator_next (iter, &item); - g_return_if_fail (GPOINTER_TO_INT (item) == -1); + fail_unless (GPOINTER_TO_INT (item) == -1); -GST_END_TEST static gboolean +static gboolean add_fold_func (gpointer item, GValue * ret, gpointer user_data) g_value_set_int (ret, g_value_get_int (ret) + GPOINTER_TO_INT (item)); @@ -135,7 +143,7 @@ l = make_list_of_ints (NUM_ELEMENTS); m = g_mutex_new (); expected = 0; for (i = 0; i < NUM_ELEMENTS; i++) @@ -146,10 +154,17 @@ res = gst_iterator_fold (iter, add_fold_func, &ret, NULL); - g_return_if_fail (res == GST_ITERATOR_DONE); - g_return_if_fail (g_value_get_int (&ret) == expected); + fail_unless (res == GST_ITERATOR_DONE); + fail_unless (g_value_get_int (&ret) == expected); + gst_iterator_free (iter); -GST_END_TEST Suite * +Suite * gstiterator_suite (void) Suite *s = suite_create ("GstIterator"); Index: gstsystemclock.c RCS file: /cvs/gstreamer/gstreamer/check/gst/gstsystemclock.c,v --- gstsystemclock.c 20 Aug 2005 12:14:27 -0000 1.4 +++ gstsystemclock.c 20 Aug 2005 12:39:05 -0000 1.5 @@ -37,7 +37,7 @@ GST_END_TEST -#define TIME_UNIT GST_SECOND +#define TIME_UNIT (GST_SECOND / 5) static void gst_clock_debug (GstClock * clock) @@ -97,14 +97,14 @@ result = gst_clock_id_wait_async (id, ok_callback, NULL); gst_clock_id_unref (id); fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK"); - g_usleep (2 * G_USEC_PER_SEC); + g_usleep (TIME_UNIT / (2 * 1000)); id = gst_clock_new_single_shot_id (clock, base + 5 * TIME_UNIT); g_message ("waiting one second async, with cancel on id %p\n", id); result = gst_clock_id_wait_async (id, error_callback, NULL); - g_usleep (G_USEC_PER_SEC / 2); - g_message ("cancel id %p after 0.5 seconds\n", id); + g_message ("cancel id %p after half a time unit\n", id); gst_clock_id_unschedule (id); g_message ("canceled id %p\n", id); @@ -119,13 +119,12 @@ g_message ("waiting id %p\n", id2); result = gst_clock_id_wait_async (id2, error_callback, NULL); - g_message ("cancel id %p after 0.5 seconds\n", id2); + g_message ("cancel id %p after half a time unit\n", id2); gst_clock_id_unschedule (id2); g_message ("canceled id %p\n", id2); gst_clock_id_unref (id2); @@ -142,11 +141,11 @@ gst_clock_debug (clock); base = gst_clock_get_time (clock); - /* signal every half a second */ + /* signal every half a time unit */ id = gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT / 2); fail_unless (id != NULL, "Could not create periodic id"); - g_message ("waiting one second\n"); + g_message ("waiting one time unit\n"); result = gst_clock_id_wait (id, NULL); @@ -159,12 +158,12 @@ g_message ("waiting for the next async %p\n", id); g_message ("waiting some more for the next async %p\n", id); id2 = gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT / 2); fail_unless (id2 != NULL, "Could not create second periodic id"); @@ -172,7 +171,7 @@ g_message ("waiting some more for another async %p\n", id2); result = gst_clock_id_wait_async (id2, ok_callback, NULL); g_message ("unschedule %p\n", id); @@ -184,7 +183,10 @@ fail_unless (result == GST_CLOCK_UNSCHEDULED, "Waiting did not return UNSCHEDULED"); + gst_clock_id_unref (id); GST_END_TEST Suite * gst_systemclock_suite (void) @@ -192,9 +194,6 @@ Suite *s = suite_create ("GstSystemClock"); TCase *tc_chain = tcase_create ("waiting"); - /* increase timeout */ - tcase_set_timeout (tc_chain, 20); suite_add_tcase (s, tc_chain); tcase_add_test (tc_chain, test_signedness); tcase_add_test (tc_chain, test_single_shot); Index: gsttag.c RCS file: /cvs/gstreamer/gstreamer/check/gst/gsttag.c,v retrieving revision 1.3 diff -u -d -r1.3 -r1.4 --- gsttag.c 20 Aug 2005 12:14:27 -0000 1.3 +++ gsttag.c 20 Aug 2005 12:39:05 -0000 1.4 @@ -171,6 +171,14 @@ check_tags (merge, FTAG, FIXED1, NULL); NEW_LISTS_FIXED (GST_TAG_MERGE_KEEP_ALL); + if (list) + gst_tag_list_free (list); + if (list2) + gst_tag_list_free (list2); + if (merge) + gst_tag_list_free (merge); GST_END_TEST Suite * Index: gstclock.c RCS file: /cvs/gstreamer/gstreamer/gst/gstclock.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- gstclock.c 5 May 2005 09:28:01 -0000 1.54 +++ gstclock.c 20 Aug 2005 12:39:05 -0000 1.55 @@ -148,7 +148,7 @@ * @clock: The clockid to get a single shot notification from * @time: the requested time * - * Get an ID from the given clock to trigger a single shot + * Get an ID from the given clock to trigger a single shot * notification at the requested time. The single shot id should be * unreffed after usage. RCS file: /cvs/gstreamer/gstreamer/gst/gstiterator.c,v --- gstiterator.c 9 Mar 2005 16:10:58 -0000 1.4 @@ -55,7 +55,7 @@ * For each item retrieved, the @item function is called with the lock * held. The @free function is called when the iterator is freed. - * + * * Returns: the new #GstIterator. * MT safe. @@ -130,8 +130,8 @@ * @item: function to call for each item * @free: function to call when the iterator is freed - * Create a new iterator designed for iterating @list. + * Create a new iterator designed for iterating @list. * Returns: the new #GstIterator for @list. @@ -263,8 +263,8 @@ * gst_iterator_free: * @it: The #GstIterator to free - * Free the iterator. + * Free the iterator. */ void |