testsuite/elements/: A little test to keep distcheck from working if someone changes a structure size accidentally.

Original commit message from CVS:
* testsuite/elements/Makefile.am:
* testsuite/elements/struct_i386.h:
* testsuite/elements/struct_size.c: (main):  A little test
to keep distcheck from working if someone changes a structure
size accidentally.
This commit is contained in:
David Schleef 2004-07-28 19:16:44 +00:00
parent 3030cec8b5
commit 2c4c302945
7 changed files with 448 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2004-07-28 David Schleef <ds@schleef.org>
* testsuite/elements/Makefile.am:
* testsuite/elements/struct_i386.h:
* testsuite/elements/struct_size.c: (main): A little test
to keep distcheck from working if someone changes a structure
size accidentally.
2004-07-28 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/libs/Makefile.am:

View file

@ -1,7 +1,7 @@
include ../Rules
# disable gst-compprep-check until it doesn't leave stray files for distcheck
tests_pass = name tee property fake gst-inspect-check
tests_pass = name tee property fake gst-inspect-check struct_size
tests_fail =
tests_ignore =

View file

@ -0,0 +1,150 @@
/* Generated by GStreamer-0.8.4.1 */
Struct list[] = {
{"GstPoptOption", sizeof (GstPoptOption), 28}
,
{"GstAtomicInt", sizeof (GstAtomicInt), 8}
,
{"GstBuffer", sizeof (GstBuffer), 108}
,
{"GstCaps", sizeof (GstCaps), 28}
,
{"GstStaticCaps", sizeof (GstStaticCaps), 48}
,
{"GstClockEntry", sizeof (GstClockEntry), 36}
,
{"GstClock", sizeof (GstClock), 128}
,
{"GstClockClass", sizeof (GstClockClass), 172}
,
{"GstData", sizeof (GstData), 40}
,
{"GstElementDetails", sizeof (GstElementDetails), 32}
,
{"GstElementFactory", sizeof (GstElementFactory), 112}
,
{"GstElementFactoryClass", sizeof (GstElementFactoryClass), 104}
,
{"GstFormatDefinition", sizeof (GstFormatDefinition), 12}
,
{"GstIndexEntry", sizeof (GstIndexEntry), 20}
,
{"GstIndexGroup", sizeof (GstIndexGroup), 16}
,
{"GstIndex", sizeof (GstIndex), 100}
,
{"GstIndexClass", sizeof (GstIndexClass), 156}
,
{"GstIndexAssociation", sizeof (GstIndexAssociation), 12}
,
{"GstIndexFactory", sizeof (GstIndexFactory), 64}
,
{"GstIndexFactoryClass", sizeof (GstIndexFactoryClass), 104}
,
{"GstDebugCategory", sizeof (GstDebugCategory), 16}
,
{"GstRealPad", sizeof (GstRealPad), 196}
,
{"GstRealPadClass", sizeof (GstRealPadClass), 168}
,
{"GstGhostPad", sizeof (GstGhostPad), 88}
,
{"GstGhostPadClass", sizeof (GstGhostPadClass), 152}
,
{"GstStaticPadTemplate", sizeof (GstStaticPadTemplate), 60}
,
{"GstPipeline", sizeof (GstPipeline), 180}
,
{"GstPipelineClass", sizeof (GstPipelineClass), 328}
,
{"GstPlugin", sizeof (GstPlugin), 92}
,
{"GstPluginDesc", sizeof (GstPluginDesc), 56}
,
{"GstPluginFeature", sizeof (GstPluginFeature), 40}
,
{"GstPluginFeatureClass", sizeof (GstPluginFeatureClass), 88}
,
{"GstProbe", sizeof (GstProbe), 12}
,
{"GstProbeDispatcher", sizeof (GstProbeDispatcher), 8}
,
{"GstQueryTypeDefinition", sizeof (GstQueryTypeDefinition), 12}
,
{"GstQueue", sizeof (GstQueue), 252}
,
{"GstQueueSize", sizeof (GstQueueSize), 16}
,
{"GstQueueClass", sizeof (GstQueueClass), 300}
,
{"GstRegistry", sizeof (GstRegistry), 56}
,
{"GstRegistryClass", sizeof (GstRegistryClass), 116}
,
{"GstSchedulerFactory", sizeof (GstSchedulerFactory), 64}
,
{"GstSchedulerFactoryClass", sizeof (GstSchedulerFactoryClass), 104}
,
{"GstStructure", sizeof (GstStructure), 28}
,
{"GstSystemClock", sizeof (GstSystemClock), 152}
,
{"GstSystemClockClass", sizeof (GstSystemClockClass), 188}
,
{"GstTagSetterIFace", sizeof (GstTagSetterIFace), 8}
,
{"GstThread", sizeof (GstThread), 196}
,
{"GstThreadClass", sizeof (GstThreadClass), 332}
,
{"GstTrace", sizeof (GstTrace), 20}
,
{"GstTraceEntry", sizeof (GstTraceEntry), 128}
,
{"GstAllocTrace", sizeof (GstAllocTrace), 16}
,
{"GstTrashStack", sizeof (GstTrashStack), 12}
,
{"GstTrashStackElement", sizeof (GstTrashStackElement), 4}
,
{"GstTypeFind", sizeof (GstTypeFind), 32}
,
{"GstTypeFindFactory", sizeof (GstTypeFindFactory), 72}
,
{"GstTypeFindFactoryClass", sizeof (GstTypeFindFactoryClass), 104}
,
{"GstObject", sizeof (GstObject), 44}
,
{"GstObjectClass", sizeof (GstObjectClass), 120}
,
{"GstPad", sizeof (GstPad), 68}
,
{"GstPadClass", sizeof (GstPadClass), 136}
,
{"GstPadTemplate", sizeof (GstPadTemplate), 76}
,
{"GstPadTemplateClass", sizeof (GstPadTemplateClass), 140}
,
{"GstElement", sizeof (GstElement), 124}
,
{"GstElementClass", sizeof (GstElementClass), 272}
,
{"GstBin", sizeof (GstBin), 164}
,
{"GstBinClass", sizeof (GstBinClass), 312}
,
{"GstScheduler", sizeof (GstScheduler), 92}
,
{"GstSchedulerClass", sizeof (GstSchedulerClass), 216}
,
{"GstEvent", sizeof (GstEvent), 176}
,
{"GstURIHandlerInterface", sizeof (GstURIHandlerInterface), 44}
,
{"GstValueTable", sizeof (GstValueTable), 32}
,
{"GstXML", sizeof (GstXML), 68}
,
{"GstXMLClass", sizeof (GstXMLClass), 144}
,
{NULL, 0, 0}
};

View file

@ -0,0 +1,69 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/gstqueue.h>
#include <gst/gsttrashstack.h>
#include <stdlib.h>
typedef struct
{
char *name;
int size;
int abi_size;
}
Struct;
#ifdef HAVE_CPU_I386
#include "struct_i386.h"
#define HAVE_ABI_SIZES
#else
/* in case someone wants to generate a new arch */
#include "struct_i386.h"
#endif
int
main (int argc, char *argv[])
{
int i;
if (argc > 1) {
g_print ("/* Generated by GStreamer-%s */\n", GST_VERSION);
g_print ("Struct list[] = {\n");
for (i = 0; list[i].name; i++) {
g_print (" { \"%s\", sizeof (%s), %d },\n",
list[i].name, list[i].name, list[i].size);
}
g_print (" { NULL, 0, 0}\n");
g_print ("};\n");
} else {
g_print ("Run './struct_size regen' to regenerate structs.h\n");
#ifdef HAVE_ABI_SIZES
{
gboolean ok = TRUE;
for (i = 0; list[i].name; i++) {
if (list[i].size != list[i].abi_size) {
ok = FALSE;
g_print ("sizeof(%s) is %d, expected %d\n",
list[i].name, list[i].size, list[i].abi_size);
}
}
if (ok) {
g_print ("All structures expected size\n");
} else {
g_print ("failed\n");
exit (1);
}
}
#else
g_print ("No structure size list was generated for this architecture\n");
g_print ("ignoring\n");
#endif
}
exit (0);
}

View file

@ -1,7 +1,7 @@
include ../Rules
# disable gst-compprep-check until it doesn't leave stray files for distcheck
tests_pass = name tee property fake gst-inspect-check
tests_pass = name tee property fake gst-inspect-check struct_size
tests_fail =
tests_ignore =

View file

@ -0,0 +1,150 @@
/* Generated by GStreamer-0.8.4.1 */
Struct list[] = {
{"GstPoptOption", sizeof (GstPoptOption), 28}
,
{"GstAtomicInt", sizeof (GstAtomicInt), 8}
,
{"GstBuffer", sizeof (GstBuffer), 108}
,
{"GstCaps", sizeof (GstCaps), 28}
,
{"GstStaticCaps", sizeof (GstStaticCaps), 48}
,
{"GstClockEntry", sizeof (GstClockEntry), 36}
,
{"GstClock", sizeof (GstClock), 128}
,
{"GstClockClass", sizeof (GstClockClass), 172}
,
{"GstData", sizeof (GstData), 40}
,
{"GstElementDetails", sizeof (GstElementDetails), 32}
,
{"GstElementFactory", sizeof (GstElementFactory), 112}
,
{"GstElementFactoryClass", sizeof (GstElementFactoryClass), 104}
,
{"GstFormatDefinition", sizeof (GstFormatDefinition), 12}
,
{"GstIndexEntry", sizeof (GstIndexEntry), 20}
,
{"GstIndexGroup", sizeof (GstIndexGroup), 16}
,
{"GstIndex", sizeof (GstIndex), 100}
,
{"GstIndexClass", sizeof (GstIndexClass), 156}
,
{"GstIndexAssociation", sizeof (GstIndexAssociation), 12}
,
{"GstIndexFactory", sizeof (GstIndexFactory), 64}
,
{"GstIndexFactoryClass", sizeof (GstIndexFactoryClass), 104}
,
{"GstDebugCategory", sizeof (GstDebugCategory), 16}
,
{"GstRealPad", sizeof (GstRealPad), 196}
,
{"GstRealPadClass", sizeof (GstRealPadClass), 168}
,
{"GstGhostPad", sizeof (GstGhostPad), 88}
,
{"GstGhostPadClass", sizeof (GstGhostPadClass), 152}
,
{"GstStaticPadTemplate", sizeof (GstStaticPadTemplate), 60}
,
{"GstPipeline", sizeof (GstPipeline), 180}
,
{"GstPipelineClass", sizeof (GstPipelineClass), 328}
,
{"GstPlugin", sizeof (GstPlugin), 92}
,
{"GstPluginDesc", sizeof (GstPluginDesc), 56}
,
{"GstPluginFeature", sizeof (GstPluginFeature), 40}
,
{"GstPluginFeatureClass", sizeof (GstPluginFeatureClass), 88}
,
{"GstProbe", sizeof (GstProbe), 12}
,
{"GstProbeDispatcher", sizeof (GstProbeDispatcher), 8}
,
{"GstQueryTypeDefinition", sizeof (GstQueryTypeDefinition), 12}
,
{"GstQueue", sizeof (GstQueue), 252}
,
{"GstQueueSize", sizeof (GstQueueSize), 16}
,
{"GstQueueClass", sizeof (GstQueueClass), 300}
,
{"GstRegistry", sizeof (GstRegistry), 56}
,
{"GstRegistryClass", sizeof (GstRegistryClass), 116}
,
{"GstSchedulerFactory", sizeof (GstSchedulerFactory), 64}
,
{"GstSchedulerFactoryClass", sizeof (GstSchedulerFactoryClass), 104}
,
{"GstStructure", sizeof (GstStructure), 28}
,
{"GstSystemClock", sizeof (GstSystemClock), 152}
,
{"GstSystemClockClass", sizeof (GstSystemClockClass), 188}
,
{"GstTagSetterIFace", sizeof (GstTagSetterIFace), 8}
,
{"GstThread", sizeof (GstThread), 196}
,
{"GstThreadClass", sizeof (GstThreadClass), 332}
,
{"GstTrace", sizeof (GstTrace), 20}
,
{"GstTraceEntry", sizeof (GstTraceEntry), 128}
,
{"GstAllocTrace", sizeof (GstAllocTrace), 16}
,
{"GstTrashStack", sizeof (GstTrashStack), 12}
,
{"GstTrashStackElement", sizeof (GstTrashStackElement), 4}
,
{"GstTypeFind", sizeof (GstTypeFind), 32}
,
{"GstTypeFindFactory", sizeof (GstTypeFindFactory), 72}
,
{"GstTypeFindFactoryClass", sizeof (GstTypeFindFactoryClass), 104}
,
{"GstObject", sizeof (GstObject), 44}
,
{"GstObjectClass", sizeof (GstObjectClass), 120}
,
{"GstPad", sizeof (GstPad), 68}
,
{"GstPadClass", sizeof (GstPadClass), 136}
,
{"GstPadTemplate", sizeof (GstPadTemplate), 76}
,
{"GstPadTemplateClass", sizeof (GstPadTemplateClass), 140}
,
{"GstElement", sizeof (GstElement), 124}
,
{"GstElementClass", sizeof (GstElementClass), 272}
,
{"GstBin", sizeof (GstBin), 164}
,
{"GstBinClass", sizeof (GstBinClass), 312}
,
{"GstScheduler", sizeof (GstScheduler), 92}
,
{"GstSchedulerClass", sizeof (GstSchedulerClass), 216}
,
{"GstEvent", sizeof (GstEvent), 176}
,
{"GstURIHandlerInterface", sizeof (GstURIHandlerInterface), 44}
,
{"GstValueTable", sizeof (GstValueTable), 32}
,
{"GstXML", sizeof (GstXML), 68}
,
{"GstXMLClass", sizeof (GstXMLClass), 144}
,
{NULL, 0, 0}
};

View file

@ -0,0 +1,69 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/gstqueue.h>
#include <gst/gsttrashstack.h>
#include <stdlib.h>
typedef struct
{
char *name;
int size;
int abi_size;
}
Struct;
#ifdef HAVE_CPU_I386
#include "struct_i386.h"
#define HAVE_ABI_SIZES
#else
/* in case someone wants to generate a new arch */
#include "struct_i386.h"
#endif
int
main (int argc, char *argv[])
{
int i;
if (argc > 1) {
g_print ("/* Generated by GStreamer-%s */\n", GST_VERSION);
g_print ("Struct list[] = {\n");
for (i = 0; list[i].name; i++) {
g_print (" { \"%s\", sizeof (%s), %d },\n",
list[i].name, list[i].name, list[i].size);
}
g_print (" { NULL, 0, 0}\n");
g_print ("};\n");
} else {
g_print ("Run './struct_size regen' to regenerate structs.h\n");
#ifdef HAVE_ABI_SIZES
{
gboolean ok = TRUE;
for (i = 0; list[i].name; i++) {
if (list[i].size != list[i].abi_size) {
ok = FALSE;
g_print ("sizeof(%s) is %d, expected %d\n",
list[i].name, list[i].size, list[i].abi_size);
}
}
if (ok) {
g_print ("All structures expected size\n");
} else {
g_print ("failed\n");
exit (1);
}
}
#else
g_print ("No structure size list was generated for this architecture\n");
g_print ("ignoring\n");
#endif
}
exit (0);
}