From 70a6032ccaccc66402c517725ba3b2795516bb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 24 Sep 2011 19:55:25 +0100 Subject: [PATCH] tests: fix up cddabasesrc unit test for GstCddaBaseSrc -> GstAudioCdSrc renaming --- tests/check/Makefile.am | 9 ++- tests/check/libs/.gitignore | 2 +- .../libs/{cddabasesrc.c => audiocdsrc.c} | 62 +++++++++---------- tests/check/libs/gstlibscpp.cc | 3 +- tests/check/libs/libsabi.c | 2 +- tests/check/libs/struct_arm.h | 6 +- tests/check/libs/struct_i386.h | 6 +- tests/check/libs/struct_i386_osx.h | 6 +- tests/check/libs/struct_x86_64.h | 6 +- 9 files changed, 49 insertions(+), 53 deletions(-) rename tests/check/libs/{cddabasesrc.c => audiocdsrc.c} (90%) diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index dbb04e1344..4b2b781726 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -114,7 +114,7 @@ check_PROGRAMS = \ gst/typefindfunctions \ libs/libsabi \ libs/audio \ - libs/cddabasesrc \ + libs/audiocdsrc \ libs/discoverer \ libs/fft \ libs/mixer \ @@ -196,7 +196,6 @@ libs_libsabi_CFLAGS = \ libs_libsabi_LDADD = \ $(top_builddir)/gst-libs/gst/app/libgstapp-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \ - $(top_builddir)/gst-libs/gst/cdda/libgstcdda-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/fft/libgstfft-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \ @@ -218,13 +217,13 @@ libs_audio_LDADD = \ $(GST_BASE_LIBS) \ $(LDADD) -libs_cddabasesrc_CFLAGS = \ +libs_audiocdsrc_CFLAGS = \ $(GST_PLUGINS_BASE_CFLAGS) \ $(GST_BASE_CFLAGS) \ $(AM_CFLAGS) -libs_cddabasesrc_LDADD = \ - $(top_builddir)/gst-libs/gst/cdda/libgstcdda-@GST_MAJORMINOR@.la \ +libs_audiocdsrc_LDADD = \ + $(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_MAJORMINOR@.la \ $(GST_BASE_LIBS) \ $(LDADD) diff --git a/tests/check/libs/.gitignore b/tests/check/libs/.gitignore index d448ce30b9..a24beca6b1 100644 --- a/tests/check/libs/.gitignore +++ b/tests/check/libs/.gitignore @@ -1,6 +1,6 @@ .dirstamp audio -cddabasesrc +audiocdsrc discoverer fft gstlibscpp diff --git a/tests/check/libs/cddabasesrc.c b/tests/check/libs/audiocdsrc.c similarity index 90% rename from tests/check/libs/cddabasesrc.c rename to tests/check/libs/audiocdsrc.c index 1c60c11b3c..1f2e58b8fa 100644 --- a/tests/check/libs/cddabasesrc.c +++ b/tests/check/libs/audiocdsrc.c @@ -1,6 +1,6 @@ /* GStreamer * - * unit test for cddabasesrc + * unit test for the audiocdsrc base class * * Copyright (C) <2005> Tim-Philipp Müller * @@ -35,7 +35,7 @@ #include #include -#include +#include #include #define CD_FRAMESIZE_RAW 2352 @@ -52,7 +52,7 @@ typedef struct _GstCdFooSrcClass GstCdFooSrcClass; /* Neue Heimat (CD 2) */ -static GstCddaBaseSrcTrack nh_cd2_tracks[] = { +static GstAudioCdSrcTrack nh_cd2_tracks[] = { {TRUE, 1, 0, 20664, NULL,}, {TRUE, 2, 20665, 52377, NULL,}, {TRUE, 3, 52378, 84100, NULL,}, @@ -70,7 +70,7 @@ static GstCddaBaseSrcTrack nh_cd2_tracks[] = { }; /* Offspring - Smash */ -static GstCddaBaseSrcTrack offspring_tracks[] = { +static GstAudioCdSrcTrack offspring_tracks[] = { {TRUE, 1, 0, 1924, NULL,}, {TRUE, 2, 1925, 12947, NULL,}, {TRUE, 3, 12948, 29739, NULL,}, @@ -90,7 +90,7 @@ static GstCddaBaseSrcTrack offspring_tracks[] = { /* this matches the sample TOC from the DiscIDCalculation * page in the Musicbrainz wiki. It's a tricky one because * it's got a data track as well. */ -static GstCddaBaseSrcTrack mb_sample_tracks[] = { +static GstAudioCdSrcTrack mb_sample_tracks[] = { {TRUE, 1, 0, 18640, NULL,}, {TRUE, 2, 18641, 34666, NULL,}, {TRUE, 3, 34667, 56349, NULL,}, @@ -110,7 +110,7 @@ static GstCddaBaseSrcTrack mb_sample_tracks[] = { /* Nicola Conte - Other Directions (also * tricky due to the extra data track) */ -static GstCddaBaseSrcTrack nconte_odir_tracks[] = { +static GstAudioCdSrcTrack nconte_odir_tracks[] = { {TRUE, 1, 0, 17852, NULL,}, {TRUE, 2, 17853, 39956, NULL,}, {TRUE, 3, 39957, 68449, NULL,}, @@ -128,7 +128,7 @@ static GstCddaBaseSrcTrack nconte_odir_tracks[] = { }; /* Pink Martini - Sympathique (11 track version) */ -static GstCddaBaseSrcTrack pm_symp_tracks[] = { +static GstAudioCdSrcTrack pm_symp_tracks[] = { {TRUE, 1, 0, 21667, NULL,}, {TRUE, 2, 21668, 49576, NULL,}, {TRUE, 3, 49577, 62397, NULL,}, @@ -146,7 +146,7 @@ static GstCddaBaseSrcTrack pm_symp_tracks[] = { struct _test_disc { - GstCddaBaseSrcTrack *tracks; + GstAudioCdSrcTrack *tracks; guint num_tracks; guint32 cddb_discid; const gchar *musicbrainz_discid; @@ -171,7 +171,7 @@ static struct _test_disc test_discs[NUM_TEST_DISCS] = { struct _GstCdFooSrc { - GstCddaBaseSrc cddabasesrc; + GstAudioCdSrc audiocdsrc; struct _test_disc *cur_test; guint cur_disc; @@ -179,17 +179,15 @@ struct _GstCdFooSrc struct _GstCdFooSrcClass { - GstCddaBaseSrcClass parent_class; + GstAudioCdSrcClass parent_class; }; GType gst_cd_foo_src_get_type (void); -G_DEFINE_TYPE (GstCdFooSrc, gst_cd_foo_src, GST_TYPE_CDDA_BASE_SRC); +G_DEFINE_TYPE (GstCdFooSrc, gst_cd_foo_src, GST_TYPE_AUDIO_CD_SRC); -static GstBuffer *gst_cd_foo_src_read_sector (GstCddaBaseSrc * src, - gint sector); -static gboolean gst_cd_foo_src_open (GstCddaBaseSrc * src, - const gchar * device); -static void gst_cd_foo_src_close (GstCddaBaseSrc * src); +static GstBuffer *gst_cd_foo_src_read_sector (GstAudioCdSrc * src, gint sector); +static gboolean gst_cd_foo_src_open (GstAudioCdSrc * src, const gchar * device); +static void gst_cd_foo_src_close (GstAudioCdSrc * src); static void gst_cd_foo_src_init (GstCdFooSrc * src) @@ -200,26 +198,26 @@ gst_cd_foo_src_init (GstCdFooSrc * src) static void gst_cd_foo_src_class_init (GstCdFooSrcClass * klass) { - GstCddaBaseSrcClass *cddabasesrc_class = GST_CDDA_BASE_SRC_CLASS (klass); + GstAudioCdSrcClass *audiocdsrc_class = GST_AUDIO_CD_SRC_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_set_details_simple (element_class, "CD Audio (cdda) Source, FooBar", "Source/File", "Read audio from CD", "Foo Bar "); - cddabasesrc_class->open = gst_cd_foo_src_open; - cddabasesrc_class->close = gst_cd_foo_src_close; - cddabasesrc_class->read_sector = gst_cd_foo_src_read_sector; + audiocdsrc_class->open = gst_cd_foo_src_open; + audiocdsrc_class->close = gst_cd_foo_src_close; + audiocdsrc_class->read_sector = gst_cd_foo_src_read_sector; } static gboolean -gst_cd_foo_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device) +gst_cd_foo_src_open (GstAudioCdSrc * audiocdsrc, const gchar * device) { - GstCddaBaseSrcTrack *tracks; + GstAudioCdSrcTrack *tracks; GstCdFooSrc *src; gint i; - src = GST_CD_FOO_SRC (cddabasesrc); + src = GST_CD_FOO_SRC (audiocdsrc); /* if this fails, the test is wrong */ g_assert (src->cur_disc < NUM_TEST_DISCS); @@ -229,29 +227,29 @@ gst_cd_foo_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device) /* add tracks */ tracks = src->cur_test->tracks; for (i = 0; i < src->cur_test->num_tracks; ++i) { - gst_cdda_base_src_add_track (GST_CDDA_BASE_SRC (src), &tracks[i]); + gst_audio_cd_src_add_track (GST_AUDIO_CD_SRC (src), &tracks[i]); } return TRUE; } static void -gst_cd_foo_src_close (GstCddaBaseSrc * cddabasesrc) +gst_cd_foo_src_close (GstAudioCdSrc * audiocdsrc) { - GstCdFooSrc *src = GST_CD_FOO_SRC (cddabasesrc); + GstCdFooSrc *src = GST_CD_FOO_SRC (audiocdsrc); if (src->cur_test->cddb_discid != 0) { - g_assert (cddabasesrc->discid == src->cur_test->cddb_discid); + g_assert (audiocdsrc->discid == src->cur_test->cddb_discid); } if (src->cur_test->musicbrainz_discid != NULL) { - g_assert (g_str_equal (cddabasesrc->mb_discid, + g_assert (g_str_equal (audiocdsrc->mb_discid, src->cur_test->musicbrainz_discid)); } } static GstBuffer * -gst_cd_foo_src_read_sector (GstCddaBaseSrc * cddabasesrc, gint sector) +gst_cd_foo_src_read_sector (GstAudioCdSrc * audiocdsrc, gint sector) { GstBuffer *buf; guint8 *data; @@ -495,9 +493,9 @@ GST_START_TEST (test_properties) GST_END_TEST; static Suite * -cddabasesrc_suite (void) +audiocdsrc_suite (void) { - Suite *s = suite_create ("cddabasesrc"); + Suite *s = suite_create ("audiocdsrc"); TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); @@ -509,4 +507,4 @@ cddabasesrc_suite (void) return s; } -GST_CHECK_MAIN (cddabasesrc) +GST_CHECK_MAIN (audiocdsrc) diff --git a/tests/check/libs/gstlibscpp.cc b/tests/check/libs/gstlibscpp.cc index b9fb8a32c0..a51ef2d625 100644 --- a/tests/check/libs/gstlibscpp.cc +++ b/tests/check/libs/gstlibscpp.cc @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -40,8 +41,6 @@ #include #include -#include - #include #include #include diff --git a/tests/check/libs/libsabi.c b/tests/check/libs/libsabi.c index 6f03e86ef9..3801936553 100644 --- a/tests/check/libs/libsabi.c +++ b/tests/check/libs/libsabi.c @@ -26,13 +26,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/tests/check/libs/struct_arm.h b/tests/check/libs/struct_arm.h index 7feda58c9f..cf8cb8a7a6 100644 --- a/tests/check/libs/struct_arm.h +++ b/tests/check/libs/struct_arm.h @@ -6,6 +6,9 @@ GstCheckABIStruct list[] = { {"GstAppSrcCallbacks", sizeof (GstAppSrcCallbacks), 28}, {"GstAppSrcClass", sizeof (GstAppSrcClass), 412}, {"GstAppSrc", sizeof (GstAppSrc), 416}, + {"GstAudioCdSrcClass", sizeof (GstAudioCdSrcClass), 432}, + {"GstAudioCdSrc", sizeof (GstAudioCdSrc), 528}, + {"GstAudioCdSrcTrack", sizeof (GstAudioCdSrcTrack), 36}, {"GstAudioClockClass", sizeof (GstAudioClockClass), 192}, {"GstAudioClock", sizeof (GstAudioClock), 232}, {"GstAudioFilterClass", sizeof (GstAudioFilterClass), 396}, @@ -24,9 +27,6 @@ GstCheckABIStruct list[] = { {"GstBaseRTPDepayload", sizeof (GstBaseRTPDepayload), 328}, {"GstBaseRTPPayloadClass", sizeof (GstBaseRTPPayloadClass), 272}, {"GstBaseRTPPayload", sizeof (GstBaseRTPPayload), 336}, - {"GstCddaBaseSrcClass", sizeof (GstCddaBaseSrcClass), 432}, - {"GstCddaBaseSrc", sizeof (GstCddaBaseSrc), 528}, - {"GstCddaBaseSrcTrack", sizeof (GstCddaBaseSrcTrack), 36}, {"GstColorBalanceChannelClass", sizeof (GstColorBalanceChannelClass), 88}, {"GstColorBalanceChannel", sizeof (GstColorBalanceChannel), 24}, {"GstColorBalanceInterface", sizeof (GstColorBalanceInterface), 44}, diff --git a/tests/check/libs/struct_i386.h b/tests/check/libs/struct_i386.h index e8b681aafd..fad9f93512 100644 --- a/tests/check/libs/struct_i386.h +++ b/tests/check/libs/struct_i386.h @@ -6,6 +6,9 @@ GstCheckABIStruct list[] = { {"GstAppSrcCallbacks", sizeof (GstAppSrcCallbacks), 28}, {"GstAppSrcClass", sizeof (GstAppSrcClass), 412}, {"GstAppSrc", sizeof (GstAppSrc), 396}, + {"GstAudioCdSrcClass", sizeof (GstAudioCdSrcClass), 432}, + {"GstAudioCdSrc", sizeof (GstAudioCdSrc), 508}, + {"GstAudioCdSrcTrack", sizeof (GstAudioCdSrcTrack), 36}, {"GstAudioClockClass", sizeof (GstAudioClockClass), 192}, {"GstAudioClock", sizeof (GstAudioClock), 228}, {"GstAudioFilterClass", sizeof (GstAudioFilterClass), 396}, @@ -24,9 +27,6 @@ GstCheckABIStruct list[] = { {"GstBaseRTPDepayload", sizeof (GstBaseRTPDepayload), 304}, {"GstBaseRTPPayloadClass", sizeof (GstBaseRTPPayloadClass), 272}, {"GstBaseRTPPayload", sizeof (GstBaseRTPPayload), 324}, - {"GstCddaBaseSrcClass", sizeof (GstCddaBaseSrcClass), 432}, - {"GstCddaBaseSrc", sizeof (GstCddaBaseSrc), 508}, - {"GstCddaBaseSrcTrack", sizeof (GstCddaBaseSrcTrack), 36}, {"GstColorBalanceChannelClass", sizeof (GstColorBalanceChannelClass), 88}, {"GstColorBalanceChannel", sizeof (GstColorBalanceChannel), 24}, {"GstColorBalanceInterface", sizeof (GstColorBalanceInterface), 44}, diff --git a/tests/check/libs/struct_i386_osx.h b/tests/check/libs/struct_i386_osx.h index e0056bdc53..98c7ff026c 100644 --- a/tests/check/libs/struct_i386_osx.h +++ b/tests/check/libs/struct_i386_osx.h @@ -8,6 +8,9 @@ GstCheckABIStruct list[] = { {"GstAppSrcCallbacks", sizeof (GstAppSrcCallbacks), 28}, {"GstAppSrcClass", sizeof (GstAppSrcClass), 412}, {"GstAppSrc", sizeof (GstAppSrc), 396}, + {"GstAudioCdSrcClass", sizeof (GstAudioCdSrcClass), 432}, + {"GstAudioCdSrc", sizeof (GstAudioCdSrc), 508}, + {"GstAudioCdSrcTrack", sizeof (GstAudioCdSrcTrack), 36}, {"GstAudioClockClass", sizeof (GstAudioClockClass), 192}, {"GstAudioClock", sizeof (GstAudioClock), 228}, {"GstAudioFilterClass", sizeof (GstAudioFilterClass), 396}, @@ -26,9 +29,6 @@ GstCheckABIStruct list[] = { {"GstBaseRTPDepayload", sizeof (GstBaseRTPDepayload), 324}, {"GstBaseRTPPayloadClass", sizeof (GstBaseRTPPayloadClass), 272}, {"GstBaseRTPPayload", sizeof (GstBaseRTPPayload), 324}, - {"GstCddaBaseSrcClass", sizeof (GstCddaBaseSrcClass), 432}, - {"GstCddaBaseSrc", sizeof (GstCddaBaseSrc), 508}, - {"GstCddaBaseSrcTrack", sizeof (GstCddaBaseSrcTrack), 36}, {"GstColorBalanceChannelClass", sizeof (GstColorBalanceChannelClass), 88}, {"GstColorBalanceChannel", sizeof (GstColorBalanceChannel), 24}, {"GstColorBalanceInterface", sizeof (GstColorBalanceInterface), 44}, diff --git a/tests/check/libs/struct_x86_64.h b/tests/check/libs/struct_x86_64.h index a651b77773..8091ed208e 100644 --- a/tests/check/libs/struct_x86_64.h +++ b/tests/check/libs/struct_x86_64.h @@ -6,6 +6,9 @@ GstCheckABIStruct list[] = { {"GstAppSrcCallbacks", sizeof (GstAppSrcCallbacks), 56}, {"GstAppSrcClass", sizeof (GstAppSrcClass), 816}, {"GstAppSrc", sizeof (GstAppSrc), 640}, + {"GstAudioCdSrcClass", sizeof (GstAudioCdSrcClass), 856}, + {"GstAudioCdSrc", sizeof (GstAudioCdSrc), 792}, + {"GstAudioCdSrcTrack", sizeof (GstAudioCdSrcTrack), 48}, {"GstAudioClockClass", sizeof (GstAudioClockClass), 384}, {"GstAudioClock", sizeof (GstAudioClock), 344}, {"GstAudioFilterClass", sizeof (GstAudioFilterClass), 784}, @@ -24,9 +27,6 @@ GstCheckABIStruct list[] = { {"GstBaseRTPDepayload", sizeof (GstBaseRTPDepayload), 488}, {"GstBaseRTPPayloadClass", sizeof (GstBaseRTPPayloadClass), 536}, {"GstBaseRTPPayload", sizeof (GstBaseRTPPayload), 480}, - {"GstCddaBaseSrcClass", sizeof (GstCddaBaseSrcClass), 856}, - {"GstCddaBaseSrc", sizeof (GstCddaBaseSrc), 792}, - {"GstCddaBaseSrcTrack", sizeof (GstCddaBaseSrcTrack), 48}, {"GstColorBalanceChannelClass", sizeof (GstColorBalanceChannelClass), 176}, {"GstColorBalanceChannel", sizeof (GstColorBalanceChannel), 40}, {"GstColorBalanceInterface", sizeof (GstColorBalanceInterface), 88},