a9e2fd6e97c502dcda21c06e280846eee70fa395
[platform/upstream/gstreamer.git] / tests / check / gst / gstabi.c
1 /* GStreamer
2  * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
3  *
4  * gstabi.c: Unit test for ABI compatibility
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #include <config.h>
23 #include <gst/check/gstcheck.h>
24
25 #ifdef HAVE_CPU_I386
26 #include "struct_i386.h"
27 #define HAVE_ABI_SIZES TRUE
28 #else
29 #ifdef __powerpc64__
30 #include "struct_ppc64.h"
31 #define HAVE_ABI_SIZES FALSE
32 #else
33 #ifdef __powerpc__
34 #include "struct_ppc32.h"
35 #define HAVE_ABI_SIZES TRUE
36 #else
37 #ifdef HAVE_CPU_X86_64
38 #include "struct_x86_64.h"
39 #define HAVE_ABI_SIZES TRUE
40 #else
41 #ifdef HAVE_CPU_HPPA
42 #include "struct_hppa.h"
43 #define HAVE_ABI_SIZES FALSE
44 #else
45 #ifdef HAVE_CPU_SPARC
46 #include "struct_sparc.h"
47 #define HAVE_ABI_SIZES FALSE
48 #else
49 #ifdef HAVE_CPU_ARM
50 #include "struct_arm.h"
51 #define HAVE_ABI_SIZES TRUE
52 #else
53 /* in case someone wants to generate a new arch */
54 #include "struct_i386.h"
55 #define HAVE_ABI_SIZES FALSE
56 #endif
57 #endif
58 #endif
59 #endif
60 #endif
61 #endif
62 #endif
63
64 GST_START_TEST (test_ABI)
65 {
66   gst_check_abi_list (list, HAVE_ABI_SIZES);
67 }
68
69 GST_END_TEST;
70
71 static Suite *
72 gstabi_suite (void)
73 {
74   Suite *s = suite_create ("GstABI");
75   TCase *tc_chain = tcase_create ("size check");
76
77   tcase_set_timeout (tc_chain, 0);
78
79   suite_add_tcase (s, tc_chain);
80   tcase_add_test (tc_chain, test_ABI);
81   return s;
82 }
83
84 GST_CHECK_MAIN (gstabi);