summaryrefslogtreecommitdiff
path: root/include/test_libs_common
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2006-09-13 01:42:27 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2006-09-13 01:42:27 +0000
commit6b21f66784e1bcbe075b405668712e85eac39414 (patch)
treecd1dcbb7cfd5041532ff7ba73b907c7e3af6a80d /include/test_libs_common
parent461f3eb260107f60c4d7da1774075d09e5374d14 (diff)
downloadflac-6b21f66784e1bcbe075b405668712e85eac39414.tar.gz
merge down from merged-API-layer branch: cvs -q up -dP -j API_LAYER_MERGING_BASELINE -j API_LAYER_MERGING_BRANCH
Diffstat (limited to 'include/test_libs_common')
-rw-r--r--include/test_libs_common/Makefile.am13
-rw-r--r--include/test_libs_common/file_utils_flac.h32
-rw-r--r--include/test_libs_common/file_utils_oggflac.h34
-rw-r--r--include/test_libs_common/metadata_utils.h69
4 files changed, 148 insertions, 0 deletions
diff --git a/include/test_libs_common/Makefile.am b/include/test_libs_common/Makefile.am
new file mode 100644
index 00000000..8060b67f
--- /dev/null
+++ b/include/test_libs_common/Makefile.am
@@ -0,0 +1,13 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+if FLaC__HAS_OGG
+OGGFLAC_DIST = \
+ file_utils_oggflac.h
+endif
+
+EXTRA_DIST = \
+ file_utils_flac.h \
+ metadata_utils.h \
+ $(OGGFLAC_DIST)
diff --git a/include/test_libs_common/file_utils_flac.h b/include/test_libs_common/file_utils_flac.h
new file mode 100644
index 00000000..4b69568d
--- /dev/null
+++ b/include/test_libs_common/file_utils_flac.h
@@ -0,0 +1,32 @@
+/* test_libFLAC - Unit tester for libFLAC
+ * Copyright (C) 2002,2003,2004,2005,2006 Josh Coalson
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef FLAC__TEST_LIBFLAC_FILE_UTILS_H
+#define FLAC__TEST_LIBFLAC_FILE_UTILS_H
+
+/* needed because of off_t */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "FLAC/format.h"
+#include <sys/types.h> /* for off_t */
+
+FLAC__bool file_utils__generate_flacfile(const char *output_filename, off_t *output_filesize, unsigned length, const FLAC__StreamMetadata *streaminfo, FLAC__StreamMetadata **metadata, unsigned num_metadata);
+
+#endif
diff --git a/include/test_libs_common/file_utils_oggflac.h b/include/test_libs_common/file_utils_oggflac.h
new file mode 100644
index 00000000..d59127fb
--- /dev/null
+++ b/include/test_libs_common/file_utils_oggflac.h
@@ -0,0 +1,34 @@
+/* test_libOggFLAC - Unit tester for libOggFLAC
+ * Copyright (C) 2002,2003,2004,2005,2006 Josh Coalson
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef OggFLAC__TEST_LIBOGGFLAC_FILE_UTILS_H
+#define OggFLAC__TEST_LIBOGGFLAC_FILE_UTILS_H
+
+/* needed because of off_t */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "FLAC/format.h"
+#include <sys/types.h> /* for off_t */
+
+extern const long file_utils__serial_number;
+
+FLAC__bool file_utils__generate_oggflacfile(const char *output_filename, off_t *output_filesize, unsigned length, const FLAC__StreamMetadata *streaminfo, FLAC__StreamMetadata **metadata, unsigned num_metadata);
+
+#endif
diff --git a/include/test_libs_common/metadata_utils.h b/include/test_libs_common/metadata_utils.h
new file mode 100644
index 00000000..3d7af192
--- /dev/null
+++ b/include/test_libs_common/metadata_utils.h
@@ -0,0 +1,69 @@
+/* test_libFLAC - Unit tester for libFLAC
+ * Copyright (C) 2002,2003,2004,2005,2006 Josh Coalson
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef FLAC__TEST_LIBFLAC_METADATA_H
+#define FLAC__TEST_LIBFLAC_METADATA_H
+
+/*
+ * These are not tests, just utility functions used by the metadata tests
+ */
+
+#include "FLAC/format.h"
+#include <stdio.h>
+#include <stdlib.h> /* for malloc() */
+#include <string.h> /* for memcmp() */
+
+FLAC__bool mutils__compare_block_data_streaminfo(const FLAC__StreamMetadata_StreamInfo *block, const FLAC__StreamMetadata_StreamInfo *blockcopy);
+
+FLAC__bool mutils__compare_block_data_padding(const FLAC__StreamMetadata_Padding *block, const FLAC__StreamMetadata_Padding *blockcopy, unsigned block_length);
+
+FLAC__bool mutils__compare_block_data_application(const FLAC__StreamMetadata_Application *block, const FLAC__StreamMetadata_Application *blockcopy, unsigned block_length);
+
+FLAC__bool mutils__compare_block_data_seektable(const FLAC__StreamMetadata_SeekTable *block, const FLAC__StreamMetadata_SeekTable *blockcopy);
+
+FLAC__bool mutils__compare_block_data_vorbiscomment(const FLAC__StreamMetadata_VorbisComment *block, const FLAC__StreamMetadata_VorbisComment *blockcopy);
+
+FLAC__bool mutils__compare_block_data_cuesheet(const FLAC__StreamMetadata_CueSheet *block, const FLAC__StreamMetadata_CueSheet *blockcopy);
+
+FLAC__bool mutils__compare_block_data_unknown(const FLAC__StreamMetadata_Unknown *block, const FLAC__StreamMetadata_Unknown *blockcopy, unsigned block_length);
+
+FLAC__bool mutils__compare_block(const FLAC__StreamMetadata *block, const FLAC__StreamMetadata *blockcopy);
+
+void mutils__init_metadata_blocks(
+ FLAC__StreamMetadata *streaminfo,
+ FLAC__StreamMetadata *padding,
+ FLAC__StreamMetadata *seektable,
+ FLAC__StreamMetadata *application1,
+ FLAC__StreamMetadata *application2,
+ FLAC__StreamMetadata *vorbiscomment,
+ FLAC__StreamMetadata *cuesheet,
+ FLAC__StreamMetadata *unknown
+);
+
+void mutils__free_metadata_blocks(
+ FLAC__StreamMetadata *streaminfo,
+ FLAC__StreamMetadata *padding,
+ FLAC__StreamMetadata *seektable,
+ FLAC__StreamMetadata *application1,
+ FLAC__StreamMetadata *application2,
+ FLAC__StreamMetadata *vorbiscomment,
+ FLAC__StreamMetadata *cuesheet,
+ FLAC__StreamMetadata *unknown
+);
+
+#endif