1 /* GStreamer
2  * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
3  *               2011 Stefan Kost <ensonic@users.sf.net>
4  *
5  * libsabi.c: Unit test for ABI compatibility
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include <gst/check/gstcheck.h>
28 
29 #include <gst/app/gstappsrc.h>
30 #include <gst/app/gstappsink.h>
31 #include <gst/audio/audio.h>
32 #include <gst/audio/gstaudiocdsrc.h>
33 #include <gst/audio/gstaudioclock.h>
34 #include <gst/audio/gstaudiofilter.h>
35 #include <gst/audio/gstaudiosrc.h>
36 #include <gst/audio/gstaudiosink.h>
37 #include <gst/audio/gstaudioringbuffer.h>
38 #include <gst/audio/streamvolume.h>
39 #include <gst/fft/gstfft.h>
40 #include <gst/fft/gstffts16.h>
41 #include <gst/fft/gstffts32.h>
42 #include <gst/fft/gstfftf32.h>
43 #include <gst/fft/gstfftf64.h>
44 #include <gst/pbutils/pbutils.h>
45 #include <gst/riff/riff-media.h>
46 #include <gst/riff/riff-read.h>
47 #include <gst/rtp/gstrtpbaseaudiopayload.h>
48 #include <gst/rtp/gstrtpbasedepayload.h>
49 #include <gst/rtp/gstrtpbasepayload.h>
50 #include <gst/rtp/gstrtpbuffer.h>
51 #include <gst/rtp/gstrtcpbuffer.h>
52 #include <gst/rtp/gstrtppayloads.h>
53 #include <gst/rtsp/gstrtsp.h>
54 #include <gst/rtsp/gstrtspconnection.h>
55 #include <gst/rtsp/gstrtspextension.h>
56 #include <gst/rtsp/gstrtspmessage.h>
57 #include <gst/rtsp/gstrtsprange.h>
58 #include <gst/rtsp/gstrtsptransport.h>
59 #include <gst/rtsp/gstrtspurl.h>
60 #include <gst/sdp/gstsdp.h>
61 #include <gst/sdp/gstsdpmessage.h>
62 #include <gst/tag/tag.h>
63 #include <gst/tag/gsttagdemux.h>
64 #include <gst/video/video.h>
65 #include <gst/video/gstvideofilter.h>
66 #include <gst/video/gstvideosink.h>
67 #include <gst/video/colorbalance.h>
68 #include <gst/video/videodirection.h>
69 #include <gst/video/videoorientation.h>
70 #include <gst/video/videooverlay.h>
71 #include <gst/video/navigation.h>
72 
73 /* initial version of the file was generated using:
74  * grep -A1 "<STRUCT>" ../../docs/libs/gst-plugins-base-libs-decl.txt | \
75  * grep "<NAME>" | grep -v "Private" | sort | \
76  * sed -e 's/<NAME>\(.*\)<\/NAME>/\  {\"\1\", sizeof (\1), 0\},/'
77  *
78  * it needs a bit of editing to remove opaque structs
79  */
80 
81 #ifdef HAVE_CPU_I386
82 # ifdef __APPLE__
83 #   include "struct_i386_osx.h"
84 #   define HAVE_ABI_SIZES FALSE
85 # else
86 #   include "struct_i386.h"
87 #   define HAVE_ABI_SIZES TRUE
88 # endif
89 #elif defined HAVE_CPU_X86_64
90 # include "struct_x86_64.h"
91 # define HAVE_ABI_SIZES TRUE
92 #elif defined HAVE_CPU_ARM
93 # include "struct_arm.h"
94 # define HAVE_ABI_SIZES FALSE
95 #elif defined HAVE_CPU_PPC
96 # include "struct_ppc32.h"
97 # define HAVE_ABI_SIZES TRUE
98 #elif defined HAVE_CPU_PPC64
99 # include "struct_ppc64.h"
100 # define HAVE_ABI_SIZES TRUE
101 #else /* in case someone wants to generate a new arch */
102 # include "struct_i386.h"
103 # define HAVE_ABI_SIZES FALSE
104 #endif
105 
GST_START_TEST(test_ABI)106 GST_START_TEST (test_ABI)
107 {
108   gst_check_abi_list (list, HAVE_ABI_SIZES);
109 }
110 
111 GST_END_TEST;
112 
113 static Suite *
libsabi_suite(void)114 libsabi_suite (void)
115 {
116   Suite *s = suite_create ("LibsABI");
117   TCase *tc_chain = tcase_create ("size check");
118 
119   tcase_set_timeout (tc_chain, 0);
120 
121   suite_add_tcase (s, tc_chain);
122   tcase_add_test (tc_chain, test_ABI);
123   return s;
124 }
125 
126 GST_CHECK_MAIN (libsabi);
127