tests: add ABI test suite for libs

This commit is contained in:
Stefan Kost 2011-02-28 10:10:22 +02:00
parent 4ac6f5ff83
commit fa300aee20
3 changed files with 245 additions and 3 deletions

View file

@ -131,6 +131,7 @@ check_PROGRAMS = \
generic/clock-selection \
generic/states \
gst/typefindfunctions \
libs/libsabi \
libs/audio \
libs/cddabasesrc \
libs/fft \
@ -160,6 +161,15 @@ VALGRIND_TO_FIX = \
# these tests don't even pass
noinst_PROGRAMS = $(check_libvisual)
noinst_HEADERS = \
libs/struct_i386.h
# libs/struct_arm.h \
# libs/struct_hppa.h \
# libs/struct_ppc32.h \
# libs/struct_ppc64.h \
# libs/struct_sparc.h \
# libs/struct_x86_64.h
AM_CFLAGS = $(GST_CFLAGS) $(GST_CHECK_CFLAGS) \
-DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \
-UG_DISABLE_ASSERT -UG_DISABLE_CAST_CHECKS
@ -170,6 +180,26 @@ VALGRIND_TESTS_DISABLE = $(VALGRIND_TO_FIX)
SUPPRESSIONS = $(top_srcdir)/common/gst.supp $(srcdir)/gst-plugins-base.supp
libs_libsabi_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(AM_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/netbuffer/libgstnetbuffer-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/rtp/libgstrtp-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/rtsp/libgstrtsp-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_MAJORMINOR@.la \
$(GST_BASE_LIBS) \
$(LDADD)
libs_audio_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \

112
tests/check/libs/libsabi.c Normal file
View file

@ -0,0 +1,112 @@
/* GStreamer
* Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
* 2011 Stefan Kost <ensonic@users.sf.net>
*
* libsabi.c: Unit test for ABI compatibility
*
* 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 <config.h>
#include <gst/check/gstcheck.h>
#include <gst/app/gstappbuffer.h>
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstaudioclock.h>
#include <gst/audio/gstaudiofilter.h>
#include <gst/audio/gstaudiosrc.h>
#include <gst/audio/gstaudiosink.h>
#include <gst/audio/gstringbuffer.h>
#include <gst/audio/multichannel.h>
#include <gst/cdda/gstcddabasesrc.h>
#include <gst/fft/gstfft.h>
#include <gst/fft/gstffts16.h>
#include <gst/fft/gstffts32.h>
#include <gst/fft/gstfftf32.h>
#include <gst/fft/gstfftf64.h>
#include <gst/interfaces/colorbalance.h>
#include <gst/interfaces/mixer.h>
#include <gst/interfaces/navigation.h>
#include <gst/interfaces/propertyprobe.h>
#include <gst/interfaces/streamvolume.h>
#include <gst/interfaces/tuner.h>
#include <gst/interfaces/videoorientation.h>
#include <gst/interfaces/xoverlay.h>
#include <gst/netbuffer/gstnetbuffer.h>
#include <gst/pbutils/pbutils.h>
#include <gst/riff/riff-media.h>
#include <gst/riff/riff-read.h>
#include <gst/rtp/gstbasertpaudiopayload.h>
#include <gst/rtp/gstbasertpdepayload.h>
#include <gst/rtp/gstbasertppayload.h>
#include <gst/rtp/gstrtpbuffer.h>
#include <gst/rtp/gstrtcpbuffer.h>
#include <gst/rtp/gstrtppayloads.h>
#include <gst/rtsp/gstrtsp.h>
#include <gst/rtsp/gstrtspconnection.h>
#include <gst/rtsp/gstrtspextension.h>
#include <gst/rtsp/gstrtspmessage.h>
#include <gst/rtsp/gstrtsprange.h>
#include <gst/rtsp/gstrtsptransport.h>
#include <gst/rtsp/gstrtspurl.h>
#include <gst/sdp/gstsdp.h>
#include <gst/sdp/gstsdpmessage.h>
#include <gst/tag/tag.h>
#include <gst/tag/gsttagdemux.h>
#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>
#include <gst/video/gstvideosink.h>
/* initial version of the file was generated using:
* grep -A1 "<STRUCT>" ../../docs/libs/gst-plugins-base-libs-decl.txt | \
* grep "<NAME>" | grep -v "Private" | sort | \
* sed -e 's/<NAME>\(.*\)<\/NAME>/\ {\"\1\", sizeof (\1), 0\},/'
*
* it needs a bit of editing to remove opaque structs
*/
#ifdef HAVE_CPU_I386
#include "struct_i386.h"
#define HAVE_ABI_SIZES TRUE
#else
/* in case someone wants to generate a new arch */
#include "struct_i386.h"
#define HAVE_ABI_SIZES FALSE
#endif
GST_START_TEST (test_ABI)
{
gst_check_abi_list (list, HAVE_ABI_SIZES);
}
GST_END_TEST;
static Suite *
libsabi_suite (void)
{
Suite *s = suite_create ("LibsABI");
TCase *tc_chain = tcase_create ("size check");
tcase_set_timeout (tc_chain, 0);
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_ABI);
return s;
}
GST_CHECK_MAIN (libsabi);

View file

@ -0,0 +1,100 @@
GstCheckABIStruct list[] = {
{"GstAppBufferClass", sizeof (GstAppBufferClass), 16},
{"GstAppBuffer", sizeof (GstAppBuffer), 88},
{"GstAppSinkCallbacks", sizeof (GstAppSinkCallbacks), 28},
{"GstAppSinkClass", sizeof (GstAppSinkClass), 404},
{"GstAppSink", sizeof (GstAppSink), 404},
{"GstAppSrcCallbacks", sizeof (GstAppSrcCallbacks), 28},
{"GstAppSrcClass", sizeof (GstAppSrcClass), 412},
{"GstAppSrc", sizeof (GstAppSrc), 396},
{"GstAudioClockClass", sizeof (GstAudioClockClass), 192},
{"GstAudioClock", sizeof (GstAudioClock), 228},
{"GstAudioFilterClass", sizeof (GstAudioFilterClass), 396},
{"GstAudioFilter", sizeof (GstAudioFilter), 480},
{"GstAudioSinkClass", sizeof (GstAudioSinkClass), 432},
{"GstAudioSink", sizeof (GstAudioSink), 456},
{"GstAudioSrcClass", sizeof (GstAudioSrcClass), 460},
{"GstAudioSrc", sizeof (GstAudioSrc), 460},
{"GstBaseAudioSinkClass", sizeof (GstBaseAudioSinkClass), 388},
{"GstBaseAudioSink", sizeof (GstBaseAudioSink), 436},
{"GstBaseAudioSrcClass", sizeof (GstBaseAudioSrcClass), 416},
{"GstBaseAudioSrc", sizeof (GstBaseAudioSrc), 440},
{"GstBaseRTPAudioPayloadClass", sizeof (GstBaseRTPAudioPayloadClass), 288},
{"GstBaseRTPAudioPayload", sizeof (GstBaseRTPAudioPayload), 364},
{"GstBaseRTPDepayloadClass", sizeof (GstBaseRTPDepayloadClass), 280},
{"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},
{"GstColorBalanceClass", sizeof (GstColorBalanceClass), 44},
{"GstDiscovererClass", sizeof (GstDiscovererClass), 96},
{"GstDiscoverer", sizeof (GstDiscoverer), 32},
{"GstFFTF32Complex", sizeof (GstFFTF32Complex), 8},
{"GstFFTF32", sizeof (GstFFTF32), 28},
{"GstFFTF64Complex", sizeof (GstFFTF64Complex), 16},
{"GstFFTF64", sizeof (GstFFTF64), 28},
{"GstFFTS16Complex", sizeof (GstFFTS16Complex), 4},
{"GstFFTS16", sizeof (GstFFTS16), 28},
{"GstFFTS32Complex", sizeof (GstFFTS32Complex), 8},
{"GstFFTS32", sizeof (GstFFTS32), 28},
{"GstMixerClass", sizeof (GstMixerClass), 72},
{"GstMixerOptionsClass", sizeof (GstMixerOptionsClass), 100},
{"GstMixerOptions", sizeof (GstMixerOptions), 52},
{"GstMixerTrackClass", sizeof (GstMixerTrackClass), 84},
{"GstMixerTrack", sizeof (GstMixerTrack), 32},
{"GstNavigationInterface", sizeof (GstNavigationInterface), 28},
{"GstNetAddress", sizeof (GstNetAddress), 40},
{"GstNetBufferClass", sizeof (GstNetBufferClass), 32},
{"GstNetBuffer", sizeof (GstNetBuffer), 176},
{"GstPropertyProbeInterface", sizeof (GstPropertyProbeInterface), 44},
{"gst_riff_acid", sizeof (gst_riff_acid), 24},
{"gst_riff_dmlh", sizeof (gst_riff_dmlh), 4},
{"gst_riff_index_entry", sizeof (gst_riff_index_entry), 16},
{"gst_riff_strf_auds", sizeof (gst_riff_strf_auds), 16},
{"gst_riff_strf_iavs", sizeof (gst_riff_strf_iavs), 32},
{"gst_riff_strf_vids", sizeof (gst_riff_strf_vids), 40},
{"gst_riff_strh", sizeof (gst_riff_strh), 48},
{"GstRingBufferClass", sizeof (GstRingBufferClass), 172},
{"GstRingBuffer", sizeof (GstRingBuffer), 220},
{"GstRingBufferSpec", sizeof (GstRingBufferSpec), 112},
{"GstRTCPPacket", sizeof (GstRTCPPacket), 36},
{"GstRTPPayloadInfo", sizeof (GstRTPPayloadInfo), 24},
{"GstRTSPExtensionInterface", sizeof (GstRTSPExtensionInterface), 60},
{"GstRTSPMessage", sizeof (GstRTSPMessage), 28},
{"GstRTSPRange", sizeof (GstRTSPRange), 8},
{"GstRTSPTime", sizeof (GstRTSPTime), 12},
{"GstRTSPTimeRange", sizeof (GstRTSPTimeRange), 28},
{"GstRTSPTransport", sizeof (GstRTSPTransport), 76},
{"GstRTSPUrl", sizeof (GstRTSPUrl), 32},
{"GstRTSPWatchFuncs", sizeof (GstRTSPWatchFuncs), 40},
{"GstSDPAttribute", sizeof (GstSDPAttribute), 8},
{"GstSDPBandwidth", sizeof (GstSDPBandwidth), 8},
{"GstSDPConnection", sizeof (GstSDPConnection), 20},
{"GstSDPKey", sizeof (GstSDPKey), 8},
{"GstSDPMedia", sizeof (GstSDPMedia), 44},
{"GstSDPMessage", sizeof (GstSDPMessage), 96},
{"GstSDPOrigin", sizeof (GstSDPOrigin), 24},
{"GstSDPTime", sizeof (GstSDPTime), 12},
{"GstSDPZone", sizeof (GstSDPZone), 8},
{"GstStreamVolumeInterface", sizeof (GstStreamVolumeInterface), 24},
{"GstTagDemuxClass", sizeof (GstTagDemuxClass), 284},
{"GstTagDemux", sizeof (GstTagDemux), 148},
{"GstTunerChannelClass", sizeof (GstTunerChannelClass), 92},
{"GstTunerChannel", sizeof (GstTunerChannel), 40},
{"GstTunerClass", sizeof (GstTunerClass), 76},
{"GstTunerNormClass", sizeof (GstTunerNormClass), 84},
{"GstTunerNorm", sizeof (GstTunerNorm), 36},
{"GstVideoFilterClass", sizeof (GstVideoFilterClass), 376},
{"GstVideoFilter", sizeof (GstVideoFilter), 356},
{"GstVideoOrientationInterface", sizeof (GstVideoOrientationInterface), 56},
{"GstVideoRectangle", sizeof (GstVideoRectangle), 16},
{"GstVideoSinkClass", sizeof (GstVideoSinkClass), 384},
{"GstVideoSink", sizeof (GstVideoSink), 408},
{"GstXOverlayClass", sizeof (GstXOverlayClass), 32},
{NULL, 0, 0}
};