summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-05 13:14:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-05 13:14:37 +0000
commitfd3b2704efc2b206784615c1a23eb25501842259 (patch)
tree61ba3a8af2a0ae2ac9ec362bbf18b038f5dc0448 /test
parentInitial commit. (diff)
downloadflac-fd3b2704efc2b206784615c1a23eb25501842259.tar.xz
flac-fd3b2704efc2b206784615c1a23eb25501842259.zip
Adding upstream version 1.4.3+ds.upstream/1.4.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--test/CMakeLists.txt103
-rw-r--r--test/Makefile.am62
-rw-r--r--test/Makefile.in720
-rw-r--r--test/common.sh.in87
-rw-r--r--test/cuesheet.ok94
-rw-r--r--test/cuesheets/Makefile.am69
-rw-r--r--test/cuesheets/Makefile.in549
-rw-r--r--test/cuesheets/bad.000.CATALOG_multiple.cue5
-rw-r--r--test/cuesheets/bad.001.CATALOG_missing_number.cue4
-rw-r--r--test/cuesheets/bad.002.CATALOG_number_too_long.cue4
-rw-r--r--test/cuesheets/bad.003.CATALOG_not_13_digits.cue4
-rw-r--r--test/cuesheets/bad.030.FLAGS_multiple.cue5
-rw-r--r--test/cuesheets/bad.031.FLAGS_wrong_place_1.cue4
-rw-r--r--test/cuesheets/bad.032.FLAGS_wrong_place_2.cue4
-rw-r--r--test/cuesheets/bad.060.INDEX_wrong_place.cue5
-rw-r--r--test/cuesheets/bad.061.INDEX_missing_number.cue4
-rw-r--r--test/cuesheets/bad.062.INDEX_invalid_number_1.cue4
-rw-r--r--test/cuesheets/bad.063.first_INDEX_not_0_or_1.cue4
-rw-r--r--test/cuesheets/bad.064.INDEX_num_non_sequential.cue5
-rw-r--r--test/cuesheets/bad.065.INDEX_num_out_of_range.cue104
-rw-r--r--test/cuesheets/bad.066.INDEX_missing_offset.cue4
-rw-r--r--test/cuesheets/bad.067.INDEX_illegal_offset.cue4
-rw-r--r--test/cuesheets/bad.068.INDEX_cdda_illegal_offset.cue4
-rw-r--r--test/cuesheets/bad.069.nonzero_first_INDEX.cue4
-rw-r--r--test/cuesheets/bad.070.INDEX_offset_not_ascending_1.cue5
-rw-r--r--test/cuesheets/bad.071.INDEX_offset_not_ascending_2.cue6
-rw-r--r--test/cuesheets/bad.110.ISRC_multiple.cue5
-rw-r--r--test/cuesheets/bad.111.ISRC_wrong_place_1.cue4
-rw-r--r--test/cuesheets/bad.112.ISRC_wrong_place_2.cue4
-rw-r--r--test/cuesheets/bad.113.ISRC_missing_number.cue4
-rw-r--r--test/cuesheets/bad.114.ISRC_invalid_number.cue4
-rw-r--r--test/cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue2
-rw-r--r--test/cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue3
-rw-r--r--test/cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue4
-rw-r--r--test/cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue5
-rw-r--r--test/cuesheets/bad.134.TRACK_missing_number.cue2
-rw-r--r--test/cuesheets/bad.135.TRACK_invalid_number_1.cue2
-rw-r--r--test/cuesheets/bad.136.TRACK_invalid_number_2.cue2
-rw-r--r--test/cuesheets/bad.137.TRACK_cdda_out_of_range.cue2
-rw-r--r--test/cuesheets/bad.138.TRACK_num_non_sequential.cue6
-rw-r--r--test/cuesheets/bad.139.TRACK_missing_type.cue2
-rw-r--r--test/cuesheets/bad.140.no_TRACKs.cue1
-rw-r--r--test/cuesheets/bad.200.FLAC_leadin_missing_offset.cue1
-rw-r--r--test/cuesheets/bad.201.FLAC_leadin_illegal_offset.cue1
-rw-r--r--test/cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue1
-rw-r--r--test/cuesheets/bad.230.FLAC_leadout_multiple.cue3
-rw-r--r--test/cuesheets/bad.231.FLAC_leadout_missing_track.cue1
-rw-r--r--test/cuesheets/bad.232.FLAC_leadout_illegal_track.cue1
-rw-r--r--test/cuesheets/bad.233.FLAC_leadout_missing_offset.cue1
-rw-r--r--test/cuesheets/bad.234.FLAC_leadout_illegal_offset.cue1
-rw-r--r--test/cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue1
-rw-r--r--test/cuesheets/good.000.cue4
-rw-r--r--test/cuesheets/good.001.cue184
-rw-r--r--test/cuesheets/good.002.dos_format.cue4
-rw-r--r--test/cuesheets/good.003.missing_final_newline.cue4
-rw-r--r--test/cuesheets/good.004.dos_format.missing_final_newline.cue4
-rw-r--r--test/cuesheets/good.005.quoted.isrc.cue6
-rw-r--r--test/flac-to-flac-metadata-test-files/Makefile.am49
-rw-r--r--test/flac-to-flac-metadata-test-files/Makefile.in529
-rw-r--r--test/flac-to-flac-metadata-test-files/Prøve.flacbin0 -> 1257 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/case00a-expect.meta84
-rw-r--r--test/flac-to-flac-metadata-test-files/case01a-expect.meta79
-rw-r--r--test/flac-to-flac-metadata-test-files/case01b-expect.meta75
-rw-r--r--test/flac-to-flac-metadata-test-files/case01c-expect.meta79
-rw-r--r--test/flac-to-flac-metadata-test-files/case01d-expect.meta79
-rw-r--r--test/flac-to-flac-metadata-test-files/case01e-expect.meta79
-rw-r--r--test/flac-to-flac-metadata-test-files/case02a-expect.meta73
-rw-r--r--test/flac-to-flac-metadata-test-files/case02b-expect.meta74
-rw-r--r--test/flac-to-flac-metadata-test-files/case02c-expect.meta79
-rw-r--r--test/flac-to-flac-metadata-test-files/case03a-expect.meta84
-rw-r--r--test/flac-to-flac-metadata-test-files/case03b-expect.meta84
-rw-r--r--test/flac-to-flac-metadata-test-files/case03c-expect.meta41
-rw-r--r--test/flac-to-flac-metadata-test-files/case04a-expect.meta26
-rw-r--r--test/flac-to-flac-metadata-test-files/case04b-expect.meta36
-rw-r--r--test/flac-to-flac-metadata-test-files/case04c-expect.meta32
-rw-r--r--test/flac-to-flac-metadata-test-files/case04d-expect.meta60
-rw-r--r--test/flac-to-flac-metadata-test-files/case04e-expect.meta70
-rw-r--r--test/flac-to-flac-metadata-test-files/input-SCPAP.flacbin0 -> 4021 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input-SCVA.flacbin0 -> 1015 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input-SCVAUP.flacbin0 -> 4224 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input-SCVPAP.flacbin0 -> 4228 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input-SVAUP.flacbin0 -> 3680 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input-VA.flacbin0 -> 287 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/input0.cue7
-rw-r--r--test/flac-to-flac-metadata-test-files/שלום.flacbin0 -> 3926 bytes
-rw-r--r--test/flac-to-flac-metadata-test-files/🤔.flacbin0 -> 1708 bytes
-rw-r--r--test/foreign-metadata-test-files/24bit-WaveFmtPCM.wavbin0 -> 1368 bytes
-rw-r--r--test/foreign-metadata-test-files/AIFF-C-sowt-compression-type-name.aifcbin0 -> 372 bytes
-rw-r--r--test/foreign-metadata-test-files/AIFF-C-sowt-tag.aifcbin0 -> 3120 bytes
-rw-r--r--test/foreign-metadata-test-files/AIFF-ID3.aiffbin0 -> 4580 bytes
-rwxr-xr-xtest/foreign-metadata-test-files/BWF-WaveFmtEx.wavbin0 -> 11402 bytes
-rw-r--r--test/foreign-metadata-test-files/Makefile.am24
-rw-r--r--test/foreign-metadata-test-files/Makefile.in504
-rwxr-xr-xtest/generate_streams.sh29
-rw-r--r--test/metaflac-test-files/Makefile.am90
-rw-r--r--test/metaflac-test-files/Makefile.in570
-rw-r--r--test/metaflac-test-files/case00-expect.meta24
-rw-r--r--test/metaflac-test-files/case01-expect.meta9
-rw-r--r--test/metaflac-test-files/case02-expect.meta28
-rw-r--r--test/metaflac-test-files/case03-expect.meta25
-rw-r--r--test/metaflac-test-files/case04-expect.meta26
-rw-r--r--test/metaflac-test-files/case05-expect.meta27
-rw-r--r--test/metaflac-test-files/case06-expect.meta28
-rw-r--r--test/metaflac-test-files/case07-expect.meta4
-rw-r--r--test/metaflac-test-files/case08-expect.meta27
-rw-r--r--test/metaflac-test-files/case09-expect.meta25
-rw-r--r--test/metaflac-test-files/case10-expect.meta6
-rw-r--r--test/metaflac-test-files/case11-expect.meta9
-rw-r--r--test/metaflac-test-files/case12-expect.meta12
-rw-r--r--test/metaflac-test-files/case13-expect.meta10
-rw-r--r--test/metaflac-test-files/case14-expect.meta13
-rw-r--r--test/metaflac-test-files/case15-expect.meta16
-rw-r--r--test/metaflac-test-files/case16-expect.meta33
-rw-r--r--test/metaflac-test-files/case17-expect.meta25
-rw-r--r--test/metaflac-test-files/case18-expect.meta29
-rw-r--r--test/metaflac-test-files/case19-expect.meta25
-rw-r--r--test/metaflac-test-files/case20-expect.meta29
-rw-r--r--test/metaflac-test-files/case21-expect.meta24
-rw-r--r--test/metaflac-test-files/case22-expect.meta18
-rw-r--r--test/metaflac-test-files/case23-expect.meta18
-rw-r--r--test/metaflac-test-files/case24-expect.meta18
-rw-r--r--test/metaflac-test-files/case25-expect.meta14
-rw-r--r--test/metaflac-test-files/case26-expect.meta22
-rw-r--r--test/metaflac-test-files/case27-expect.meta13
-rw-r--r--test/metaflac-test-files/case28-expect.meta13
-rw-r--r--test/metaflac-test-files/case29-expect.meta9
-rw-r--r--test/metaflac-test-files/case30-expect.meta9
-rw-r--r--test/metaflac-test-files/case31-expect.meta15
-rw-r--r--test/metaflac-test-files/case32-expect.meta15
-rw-r--r--test/metaflac-test-files/case33-expect.meta19
-rw-r--r--test/metaflac-test-files/case34-expect.meta19
-rw-r--r--test/metaflac-test-files/case35-expect.meta19
-rw-r--r--test/metaflac-test-files/case36-expect.meta15
-rw-r--r--test/metaflac-test-files/case37-expect.meta19
-rw-r--r--test/metaflac-test-files/case38-expect.meta19
-rw-r--r--test/metaflac-test-files/case39-expect.meta20
-rw-r--r--test/metaflac-test-files/case40-expect.meta22
-rw-r--r--test/metaflac-test-files/case41-expect.meta27
-rw-r--r--test/metaflac-test-files/case42-expect.meta22
-rw-r--r--test/metaflac-test-files/case43-expect.meta49
-rw-r--r--test/metaflac-test-files/case44-expect.meta28
-rw-r--r--test/metaflac-test-files/case45-expect.meta49
-rw-r--r--test/metaflac-test-files/case46-expect.meta62
-rw-r--r--test/metaflac-test-files/case47-expect.meta75
-rw-r--r--test/metaflac-test-files/case48-expect.meta88
-rw-r--r--test/metaflac-test-files/case49-expect.meta101
-rw-r--r--test/metaflac-test-files/case50-expect.meta114
-rw-r--r--test/metaflac-test-files/case51-expect.meta127
-rw-r--r--test/metaflac-test-files/case52-expect.meta140
-rw-r--r--test/metaflac-test-files/case53-expect.meta153
-rw-r--r--test/metaflac-test-files/case54-expect.meta166
-rw-r--r--test/metaflac-test-files/case55-expect.meta179
-rw-r--r--test/metaflac-test-files/case56-expect.meta192
-rw-r--r--test/metaflac-test-files/case57-expect.meta205
-rw-r--r--test/metaflac-test-files/case58-expect.meta218
-rw-r--r--test/metaflac-test-files/case59-expect.meta231
-rw-r--r--test/metaflac-test-files/case60-expect.meta49
-rw-r--r--test/metaflac-test-files/case61-expect.meta62
-rw-r--r--test/metaflac-test-files/case62-expect.meta75
-rw-r--r--test/metaflac-test-files/case63-expect.meta74
-rw-r--r--test/metaflac-test-files/case64-expect.meta3
-rw-r--r--test/metaflac-test-files/case65-expect.metabin0 -> 1672 bytes
-rw-r--r--test/metaflac-test-files/case66-expect.meta62
-rw-r--r--test/metaflac-test-files/case67-expect.meta95
-rw-r--r--test/metaflac.flac.inbin0 -> 667 bytes
-rw-r--r--test/metaflac.flac.okbin0 -> 617 bytes
-rw-r--r--test/picture.ok42
-rw-r--r--test/pictures/0.gifbin0 -> 95 bytes
-rw-r--r--test/pictures/0.jpgbin0 -> 330 bytes
-rw-r--r--test/pictures/0.pngbin0 -> 446 bytes
-rw-r--r--test/pictures/1.gifbin0 -> 871 bytes
-rw-r--r--test/pictures/1.pngbin0 -> 462 bytes
-rw-r--r--test/pictures/2.gifbin0 -> 532 bytes
-rw-r--r--test/pictures/2.pngbin0 -> 292 bytes
-rw-r--r--test/pictures/3.pngbin0 -> 308 bytes
-rw-r--r--test/pictures/4.jpgbin0 -> 567 bytes
-rw-r--r--test/pictures/4.pngbin0 -> 1800 bytes
-rw-r--r--test/pictures/5.pngbin0 -> 1816 bytes
-rw-r--r--test/pictures/6.pngbin0 -> 543 bytes
-rw-r--r--test/pictures/7.pngbin0 -> 559 bytes
-rw-r--r--test/pictures/8.pngbin0 -> 244 bytes
-rw-r--r--test/pictures/Makefile.am33
-rw-r--r--test/pictures/Makefile.in513
-rwxr-xr-xtest/test_compression.sh46
-rwxr-xr-xtest/test_flac.sh1338
-rwxr-xr-xtest/test_grabbag.sh128
-rwxr-xr-xtest/test_libFLAC++.sh35
-rwxr-xr-xtest/test_libFLAC.sh35
-rwxr-xr-xtest/test_metaflac.sh478
-rwxr-xr-xtest/test_replaygain.sh146
-rwxr-xr-xtest/test_seeking.sh141
-rwxr-xr-xtest/test_streams.sh331
-rwxr-xr-xtest/write_iff.pl211
193 files changed, 11965 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..1699e17
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,103 @@
+if(WIN32)
+ set(EXEEXT .exe)
+endif()
+
+if(NOT UNIX)
+ find_program(BUSYBOX_EXE busybox)
+ if(NOT BUSYBOX_EXE)
+ message(STATUS "Could NOT find busybox, only basic tests are enabled")
+ add_test(NAME libFLAC
+ COMMAND $<TARGET_FILE:test_libFLAC>
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ if(BUILD_CXXLIBS)
+ add_test(NAME libFLAC++
+ COMMAND $<TARGET_FILE:test_libFLAC++>
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ endif()
+ if(BUILD_PROGRAMS)
+ add_test(NAME flac_help
+ COMMAND $<TARGET_FILE:flacapp> --help
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ add_test(NAME flac_utf8_test COMMAND $<TARGET_FILE:flacapp> -t
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/שלום.flac"
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/Prøve.flac"
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/🤔.flac")
+ add_test(NAME metaflac_help
+ COMMAND $<TARGET_FILE:metaflac> --help
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ endif()
+ return()
+ else()
+ set(BUSYBOX_CMD "sh")
+ endif()
+endif()
+
+set(top_srcdir "${PROJECT_SOURCE_DIR}")
+set(top_builddir "${PROJECT_BINARY_DIR}")
+if(NOT GIT_COMMIT_TAG AND GIT_COMMIT_HASH AND GIT_COMMIT_DATE)
+ set(GIT_COMMIT_VERSION_HASH yes)
+endif()
+
+configure_file(common.sh.in common.sh @ONLY)
+
+set(ALL_TESTS libFLAC grabbag)
+
+add_test(NAME libFLAC
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_libFLAC.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+if(BUILD_CXXLIBS)
+ add_test(NAME libFLAC++
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_libFLAC++.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ list(APPEND ALL_TESTS libFLAC++)
+ set_tests_properties(libFLAC++ PROPERTIES DEPENDS libFLAC)
+endif()
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cuesheets")
+add_test(NAME grabbag
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_grabbag.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+if(BUILD_PROGRAMS)
+ add_test(NAME generate_streams
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/generate_streams.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ add_test(NAME flac
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_flac.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ # UTF-8 must be tested separately on Windows because busybox-w32 doesn't support UTF-8
+ if(BUSYBOX_EXE)
+ add_test(NAME flac_utf8_test COMMAND $<TARGET_FILE:flacapp> -t
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/שלום.flac"
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/Prøve.flac"
+ "${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/🤔.flac")
+ list(APPEND ALL_TESTS flac_utf8_test)
+ endif()
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/metaflac-test-files")
+ add_test(NAME metaflac
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_metaflac.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ add_test(NAME replaygain
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_replaygain.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ add_test(NAME seeking
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_seeking.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ add_test(NAME streams
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_streams.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ # increase this if standard 1500 seconds are not enough
+ # set_tests_properties(streams PROPERTIES TIMEOUT 1500)
+ add_test(NAME compression
+ COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_compression.sh"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ set_tests_properties(flac metaflac replaygain seeking streams compression PROPERTIES DEPENDS generate_streams)
+ list(APPEND ALL_TESTS generate_streams flac metaflac replaygain seeking streams compression)
+endif()
+
+
+set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT FLAC__TEST_LEVEL=1)
+if(BUSYBOX_EXE)
+ set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT ECHO_N=-n)
+ set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT WIN32BUSYBOX=yes)
+else()
+ set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT ECHO_C=\\c)
+endif()
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..2d69fea
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,62 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+TESTS_ENVIRONMENT = FLAC__TEST_LEVEL=@FLAC__TEST_LEVEL@ FLAC__TEST_WITH_VALGRIND=@FLAC__TEST_WITH_VALGRIND@ ECHO_N="@ECHO_N@" ECHO_C="@ECHO_C@"
+
+SUBDIRS = cuesheets foreign-metadata-test-files flac-to-flac-metadata-test-files metaflac-test-files pictures
+
+check_SCRIPTS = \
+ test_libFLAC.sh \
+ test_libFLAC++.sh \
+ test_grabbag.sh \
+ test_flac.sh \
+ test_metaflac.sh \
+ test_replaygain.sh \
+ test_seeking.sh \
+ test_streams.sh \
+ test_compression.sh
+
+# This one should pass when building out-of-tree (e.g. 'make distcheck').
+check: $(check_SCRIPTS)
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_libFLAC.sh
+if FLaC__WITH_CPPLIBS
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_libFLAC++.sh
+endif
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_grabbag.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_flac.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_metaflac.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_replaygain.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_seeking.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_streams.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_compression.sh
+ @echo "----------------"
+ @echo "All tests passed"
+ @echo "----------------"
+
+EXTRA_DIST = \
+ CMakeLists.txt \
+ cuesheet.ok \
+ generate_streams.sh \
+ metaflac.flac.in \
+ metaflac.flac.ok \
+ picture.ok \
+ $(check_SCRIPTS) \
+ write_iff.pl
+
+clean-local:
+ -rm -f *.raw *.flac *.oga *.ogg *.cmp *.aiff *.wav *.w64 *.rf64 *.diff *.log *.cue core
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..e9e76ac
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,720 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = common.sh
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/common.sh.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TESTS_ENVIRONMENT = FLAC__TEST_LEVEL=@FLAC__TEST_LEVEL@ FLAC__TEST_WITH_VALGRIND=@FLAC__TEST_WITH_VALGRIND@ ECHO_N="@ECHO_N@" ECHO_C="@ECHO_C@"
+SUBDIRS = cuesheets foreign-metadata-test-files flac-to-flac-metadata-test-files metaflac-test-files pictures
+check_SCRIPTS = \
+ test_libFLAC.sh \
+ test_libFLAC++.sh \
+ test_grabbag.sh \
+ test_flac.sh \
+ test_metaflac.sh \
+ test_replaygain.sh \
+ test_seeking.sh \
+ test_streams.sh \
+ test_compression.sh
+
+EXTRA_DIST = \
+ CMakeLists.txt \
+ cuesheet.ok \
+ generate_streams.sh \
+ metaflac.flac.in \
+ metaflac.flac.ok \
+ picture.ok \
+ $(check_SCRIPTS) \
+ write_iff.pl
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+common.sh: $(top_builddir)/config.status $(srcdir)/common.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-libtool clean-local \
+ cscopelist-am ctags ctags-am distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# This one should pass when building out-of-tree (e.g. 'make distcheck').
+check: $(check_SCRIPTS)
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_libFLAC.sh
+@FLaC__WITH_CPPLIBS_TRUE@ $(TESTS_ENVIRONMENT) $(srcdir)/test_libFLAC++.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_grabbag.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_flac.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_metaflac.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_replaygain.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_seeking.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_streams.sh
+ $(TESTS_ENVIRONMENT) $(srcdir)/test_compression.sh
+ @echo "----------------"
+ @echo "All tests passed"
+ @echo "----------------"
+
+clean-local:
+ -rm -f *.raw *.flac *.oga *.ogg *.cmp *.aiff *.wav *.w64 *.rf64 *.diff *.log *.cue core
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/common.sh.in b/test/common.sh.in
new file mode 100644
index 0000000..b958f30
--- /dev/null
+++ b/test/common.sh.in
@@ -0,0 +1,87 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$((RANDOM % 255 + 1))
+
+if [ -z "$1" ] ; then
+ BUILD=debug
+else
+ BUILD="$1"
+fi
+
+LD_LIBRARY_PATH=../objs/$BUILD/lib:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH="$(pwd)/../objs/$BUILD/lib:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/libFLAC/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/share/getopt/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/share/grabbag/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$(pwd)/../src/share/utf8/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/libFLAC++/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/share/getopt/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
+LD_LIBRARY_PATH=../src/share/utf8/.libs:$LD_LIBRARY_PATH
+
+export LD_LIBRARY_PATH
+
+PATH="$(pwd)/../objs/$CMAKE_CONFIG_TYPE:$PATH"
+PATH="$(pwd)/../objs:$PATH"
+
+EXE=@EXEEXT@
+
+# Needed for building out-of-tree where source files are in the $top_srcdir tree
+# and build products in the $top_builddir tree.
+top_srcdir=@top_srcdir@
+top_builddir=@top_builddir@
+git_commit_version_hash=@GIT_COMMIT_VERSION_HASH@
+
+# Set `is_win` variable which is used in other scripts that source this one.
+if test $(env | grep -ic '^comspec=') != 0 ; then
+ is_win=yes
+else
+ is_win=no
+fi
+
+# change to 'false' to show all flac/metaflac output (useful for debugging)
+if true ; then
+ SILENT='--silent'
+ TOTALLY_SILENT='--totally-silent'
+else
+ SILENT=''
+ TOTALLY_SILENT=''
+fi
+
+# Functions
+
+die ()
+{
+ echo $* 1>&2
+ exit 1
+}
+
+make_streams ()
+{
+ echo "Generating streams..."
+ if [ ! -f wacky1.wav ] ; then
+ test_streams${EXE} || die "ERROR during test_streams"
+ fi
+}
diff --git a/test/cuesheet.ok b/test/cuesheet.ok
new file mode 100644
index 0000000..dc9c82f
--- /dev/null
+++ b/test/cuesheet.ok
@@ -0,0 +1,94 @@
+NEGATIVE cuesheets/bad.000.CATALOG_multiple.cue
+pass1: parse error, line 2: "found multiple CATALOG commands"
+NEGATIVE cuesheets/bad.001.CATALOG_missing_number.cue
+pass1: parse error, line 1: "CATALOG is missing catalog number"
+NEGATIVE cuesheets/bad.002.CATALOG_number_too_long.cue
+pass1: parse error, line 1: "CATALOG number is too long"
+NEGATIVE cuesheets/bad.003.CATALOG_not_13_digits.cue
+pass1: parse error, line 1: "CD-DA CATALOG number must be 13 decimal digits"
+NEGATIVE cuesheets/bad.030.FLAGS_multiple.cue
+pass1: parse error, line 4: "found multiple FLAGS commands"
+NEGATIVE cuesheets/bad.031.FLAGS_wrong_place_1.cue
+pass1: parse error, line 1: "FLAGS command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.032.FLAGS_wrong_place_2.cue
+pass1: parse error, line 4: "FLAGS command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.060.INDEX_wrong_place.cue
+pass1: parse error, line 2: "found INDEX before any TRACK"
+NEGATIVE cuesheets/bad.061.INDEX_missing_number.cue
+pass1: parse error, line 4: "INDEX is missing index number"
+NEGATIVE cuesheets/bad.062.INDEX_invalid_number_1.cue
+pass1: parse error, line 4: "INDEX has invalid index number"
+NEGATIVE cuesheets/bad.063.first_INDEX_not_0_or_1.cue
+pass1: parse error, line 4: "first INDEX number of a TRACK must be 0 or 1"
+NEGATIVE cuesheets/bad.064.INDEX_num_non_sequential.cue
+pass1: parse error, line 5: "INDEX numbers must be sequential"
+NEGATIVE cuesheets/bad.065.INDEX_num_out_of_range.cue
+pass1: parse error, line 104: "CD-DA INDEX number must be between 0 and 99, inclusive"
+NEGATIVE cuesheets/bad.066.INDEX_missing_offset.cue
+pass1: parse error, line 4: "INDEX is missing an offset after the index number"
+NEGATIVE cuesheets/bad.067.INDEX_illegal_offset.cue
+pass1: parse error, line 4: "illegal INDEX offset (not of the form MM:SS:FF)"
+NEGATIVE cuesheets/bad.068.INDEX_cdda_illegal_offset.cue
+pass1: parse error, line 4: "illegal INDEX offset (not of the form MM:SS:FF)"
+NEGATIVE cuesheets/bad.069.nonzero_first_INDEX.cue
+pass1: parse error, line 4: "first INDEX of first TRACK must have an offset of 00:00:00"
+NEGATIVE cuesheets/bad.070.INDEX_offset_not_ascending_1.cue
+pass1: parse error, line 5: "CD-DA INDEX offsets must increase in time"
+NEGATIVE cuesheets/bad.071.INDEX_offset_not_ascending_2.cue
+pass1: parse error, line 6: "CD-DA INDEX offsets must increase in time"
+NEGATIVE cuesheets/bad.110.ISRC_multiple.cue
+pass1: parse error, line 4: "found multiple ISRC commands"
+NEGATIVE cuesheets/bad.111.ISRC_wrong_place_1.cue
+pass1: parse error, line 2: "ISRC command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.112.ISRC_wrong_place_2.cue
+pass1: parse error, line 4: "ISRC command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.113.ISRC_missing_number.cue
+pass1: parse error, line 3: "ISRC is missing ISRC number"
+NEGATIVE cuesheets/bad.114.ISRC_invalid_number.cue
+pass1: parse error, line 3: "invalid ISRC number"
+NEGATIVE cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue
+pass1: parse error, line 2: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue
+pass1: parse error, line 3: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue
+pass1: parse error, line 3: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue
+pass1: parse error, line 4: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.134.TRACK_missing_number.cue
+pass1: parse error, line 2: "TRACK is missing track number"
+NEGATIVE cuesheets/bad.135.TRACK_invalid_number_1.cue
+pass1: parse error, line 2: "TRACK has invalid track number"
+NEGATIVE cuesheets/bad.136.TRACK_invalid_number_2.cue
+pass1: parse error, line 2: "TRACK number must be greater than 0"
+NEGATIVE cuesheets/bad.137.TRACK_cdda_out_of_range.cue
+pass1: parse error, line 2: "CD-DA TRACK number must be between 1 and 99, inclusive"
+NEGATIVE cuesheets/bad.138.TRACK_num_non_sequential.cue
+pass1: parse error, line 6: "CD-DA TRACK numbers must be sequential"
+NEGATIVE cuesheets/bad.139.TRACK_missing_type.cue
+pass1: parse error, line 2: "TRACK is missing a track type after the track number"
+NEGATIVE cuesheets/bad.140.no_TRACKs.cue
+pass1: parse error, line 1: "there must be at least one TRACK command"
+NEGATIVE cuesheets/bad.200.FLAC_leadin_missing_offset.cue
+pass1: parse error, line 1: "FLAC__lead-in is missing offset"
+NEGATIVE cuesheets/bad.201.FLAC_leadin_illegal_offset.cue
+pass1: parse error, line 1: "illegal FLAC__lead-in offset"
+NEGATIVE cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue
+pass1: parse error, line 1: "illegal CD-DA FLAC__lead-in offset, must be even multiple of 588 samples"
+NEGATIVE cuesheets/bad.230.FLAC_leadout_multiple.cue
+pass1: parse error, line 3: "multiple FLAC__lead-out commands"
+NEGATIVE cuesheets/bad.231.FLAC_leadout_missing_track.cue
+pass1: parse error, line 1: "FLAC__lead-out is missing track number"
+NEGATIVE cuesheets/bad.232.FLAC_leadout_illegal_track.cue
+pass1: parse error, line 1: "illegal FLAC__lead-out track number"
+NEGATIVE cuesheets/bad.233.FLAC_leadout_missing_offset.cue
+pass1: parse error, line 1: "FLAC__lead-out is missing offset"
+NEGATIVE cuesheets/bad.234.FLAC_leadout_illegal_offset.cue
+pass1: parse error, line 1: "illegal FLAC__lead-out offset"
+NEGATIVE cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue
+pass1: parse error, line 1: "FLAC__lead-out offset does not match end-of-stream offset"
+POSITIVE cuesheets/good.000.cue
+POSITIVE cuesheets/good.001.cue
+POSITIVE cuesheets/good.002.dos_format.cue
+POSITIVE cuesheets/good.003.missing_final_newline.cue
+POSITIVE cuesheets/good.004.dos_format.missing_final_newline.cue
+POSITIVE cuesheets/good.005.quoted.isrc.cue
diff --git a/test/cuesheets/Makefile.am b/test/cuesheets/Makefile.am
new file mode 100644
index 0000000..8db5c5f
--- /dev/null
+++ b/test/cuesheets/Makefile.am
@@ -0,0 +1,69 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+EXTRA_DIST = \
+ bad.000.CATALOG_multiple.cue \
+ bad.001.CATALOG_missing_number.cue \
+ bad.002.CATALOG_number_too_long.cue \
+ bad.003.CATALOG_not_13_digits.cue \
+ bad.030.FLAGS_multiple.cue \
+ bad.031.FLAGS_wrong_place_1.cue \
+ bad.032.FLAGS_wrong_place_2.cue \
+ bad.060.INDEX_wrong_place.cue \
+ bad.061.INDEX_missing_number.cue \
+ bad.062.INDEX_invalid_number_1.cue \
+ bad.063.first_INDEX_not_0_or_1.cue \
+ bad.064.INDEX_num_non_sequential.cue \
+ bad.065.INDEX_num_out_of_range.cue \
+ bad.066.INDEX_missing_offset.cue \
+ bad.067.INDEX_illegal_offset.cue \
+ bad.068.INDEX_cdda_illegal_offset.cue \
+ bad.069.nonzero_first_INDEX.cue \
+ bad.070.INDEX_offset_not_ascending_1.cue \
+ bad.071.INDEX_offset_not_ascending_2.cue \
+ bad.110.ISRC_multiple.cue \
+ bad.111.ISRC_wrong_place_1.cue \
+ bad.112.ISRC_wrong_place_2.cue \
+ bad.113.ISRC_missing_number.cue \
+ bad.114.ISRC_invalid_number.cue \
+ bad.130.TRACK_missing_INDEX_01_1.cue \
+ bad.131.TRACK_missing_INDEX_01_2.cue \
+ bad.132.TRACK_missing_INDEX_01_3.cue \
+ bad.133.TRACK_missing_INDEX_01_4.cue \
+ bad.134.TRACK_missing_number.cue \
+ bad.135.TRACK_invalid_number_1.cue \
+ bad.136.TRACK_invalid_number_2.cue \
+ bad.137.TRACK_cdda_out_of_range.cue \
+ bad.138.TRACK_num_non_sequential.cue \
+ bad.139.TRACK_missing_type.cue \
+ bad.140.no_TRACKs.cue \
+ bad.200.FLAC_leadin_missing_offset.cue \
+ bad.201.FLAC_leadin_illegal_offset.cue \
+ bad.202.FLAC_leadin_cdda_illegal_offset.cue \
+ bad.230.FLAC_leadout_multiple.cue \
+ bad.231.FLAC_leadout_missing_track.cue \
+ bad.232.FLAC_leadout_illegal_track.cue \
+ bad.233.FLAC_leadout_missing_offset.cue \
+ bad.234.FLAC_leadout_illegal_offset.cue \
+ bad.235.FLAC_leadout_offset_not_211680000.cue \
+ good.000.cue \
+ good.001.cue \
+ good.002.dos_format.cue \
+ good.003.missing_final_newline.cue \
+ good.004.dos_format.missing_final_newline.cue \
+ good.005.quoted.isrc.cue
diff --git a/test/cuesheets/Makefile.in b/test/cuesheets/Makefile.in
new file mode 100644
index 0000000..82d1467
--- /dev/null
+++ b/test/cuesheets/Makefile.in
@@ -0,0 +1,549 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/cuesheets
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ bad.000.CATALOG_multiple.cue \
+ bad.001.CATALOG_missing_number.cue \
+ bad.002.CATALOG_number_too_long.cue \
+ bad.003.CATALOG_not_13_digits.cue \
+ bad.030.FLAGS_multiple.cue \
+ bad.031.FLAGS_wrong_place_1.cue \
+ bad.032.FLAGS_wrong_place_2.cue \
+ bad.060.INDEX_wrong_place.cue \
+ bad.061.INDEX_missing_number.cue \
+ bad.062.INDEX_invalid_number_1.cue \
+ bad.063.first_INDEX_not_0_or_1.cue \
+ bad.064.INDEX_num_non_sequential.cue \
+ bad.065.INDEX_num_out_of_range.cue \
+ bad.066.INDEX_missing_offset.cue \
+ bad.067.INDEX_illegal_offset.cue \
+ bad.068.INDEX_cdda_illegal_offset.cue \
+ bad.069.nonzero_first_INDEX.cue \
+ bad.070.INDEX_offset_not_ascending_1.cue \
+ bad.071.INDEX_offset_not_ascending_2.cue \
+ bad.110.ISRC_multiple.cue \
+ bad.111.ISRC_wrong_place_1.cue \
+ bad.112.ISRC_wrong_place_2.cue \
+ bad.113.ISRC_missing_number.cue \
+ bad.114.ISRC_invalid_number.cue \
+ bad.130.TRACK_missing_INDEX_01_1.cue \
+ bad.131.TRACK_missing_INDEX_01_2.cue \
+ bad.132.TRACK_missing_INDEX_01_3.cue \
+ bad.133.TRACK_missing_INDEX_01_4.cue \
+ bad.134.TRACK_missing_number.cue \
+ bad.135.TRACK_invalid_number_1.cue \
+ bad.136.TRACK_invalid_number_2.cue \
+ bad.137.TRACK_cdda_out_of_range.cue \
+ bad.138.TRACK_num_non_sequential.cue \
+ bad.139.TRACK_missing_type.cue \
+ bad.140.no_TRACKs.cue \
+ bad.200.FLAC_leadin_missing_offset.cue \
+ bad.201.FLAC_leadin_illegal_offset.cue \
+ bad.202.FLAC_leadin_cdda_illegal_offset.cue \
+ bad.230.FLAC_leadout_multiple.cue \
+ bad.231.FLAC_leadout_missing_track.cue \
+ bad.232.FLAC_leadout_illegal_track.cue \
+ bad.233.FLAC_leadout_missing_offset.cue \
+ bad.234.FLAC_leadout_illegal_offset.cue \
+ bad.235.FLAC_leadout_offset_not_211680000.cue \
+ good.000.cue \
+ good.001.cue \
+ good.002.dos_format.cue \
+ good.003.missing_final_newline.cue \
+ good.004.dos_format.missing_final_newline.cue \
+ good.005.quoted.isrc.cue
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/cuesheets/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/cuesheets/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/cuesheets/bad.000.CATALOG_multiple.cue b/test/cuesheets/bad.000.CATALOG_multiple.cue
new file mode 100644
index 0000000..ef2769b
--- /dev/null
+++ b/test/cuesheets/bad.000.CATALOG_multiple.cue
@@ -0,0 +1,5 @@
+CATALOG 1234567890123
+CATALOG 0234567890123
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.001.CATALOG_missing_number.cue b/test/cuesheets/bad.001.CATALOG_missing_number.cue
new file mode 100644
index 0000000..ce2334f
--- /dev/null
+++ b/test/cuesheets/bad.001.CATALOG_missing_number.cue
@@ -0,0 +1,4 @@
+CATALOG
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.002.CATALOG_number_too_long.cue b/test/cuesheets/bad.002.CATALOG_number_too_long.cue
new file mode 100644
index 0000000..8585a0a
--- /dev/null
+++ b/test/cuesheets/bad.002.CATALOG_number_too_long.cue
@@ -0,0 +1,4 @@
+CATALOG 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.003.CATALOG_not_13_digits.cue b/test/cuesheets/bad.003.CATALOG_not_13_digits.cue
new file mode 100644
index 0000000..c75d4c0
--- /dev/null
+++ b/test/cuesheets/bad.003.CATALOG_not_13_digits.cue
@@ -0,0 +1,4 @@
+CATALOG 123456789012z
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.030.FLAGS_multiple.cue b/test/cuesheets/bad.030.FLAGS_multiple.cue
new file mode 100644
index 0000000..ee82b13
--- /dev/null
+++ b/test/cuesheets/bad.030.FLAGS_multiple.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ FLAGS 4CH
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.031.FLAGS_wrong_place_1.cue b/test/cuesheets/bad.031.FLAGS_wrong_place_1.cue
new file mode 100644
index 0000000..3b7f018
--- /dev/null
+++ b/test/cuesheets/bad.031.FLAGS_wrong_place_1.cue
@@ -0,0 +1,4 @@
+FLAGS PRE
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.032.FLAGS_wrong_place_2.cue b/test/cuesheets/bad.032.FLAGS_wrong_place_2.cue
new file mode 100644
index 0000000..926cc91
--- /dev/null
+++ b/test/cuesheets/bad.032.FLAGS_wrong_place_2.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
+ FLAGS PRE
diff --git a/test/cuesheets/bad.060.INDEX_wrong_place.cue b/test/cuesheets/bad.060.INDEX_wrong_place.cue
new file mode 100644
index 0000000..fb175f2
--- /dev/null
+++ b/test/cuesheets/bad.060.INDEX_wrong_place.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+INDEX 00 00:00:00
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.061.INDEX_missing_number.cue b/test/cuesheets/bad.061.INDEX_missing_number.cue
new file mode 100644
index 0000000..bf72604
--- /dev/null
+++ b/test/cuesheets/bad.061.INDEX_missing_number.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX
diff --git a/test/cuesheets/bad.062.INDEX_invalid_number_1.cue b/test/cuesheets/bad.062.INDEX_invalid_number_1.cue
new file mode 100644
index 0000000..fcb4dd3
--- /dev/null
+++ b/test/cuesheets/bad.062.INDEX_invalid_number_1.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX thhpt!
diff --git a/test/cuesheets/bad.063.first_INDEX_not_0_or_1.cue b/test/cuesheets/bad.063.first_INDEX_not_0_or_1.cue
new file mode 100644
index 0000000..a136f3f
--- /dev/null
+++ b/test/cuesheets/bad.063.first_INDEX_not_0_or_1.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 02 00:00:00
diff --git a/test/cuesheets/bad.064.INDEX_num_non_sequential.cue b/test/cuesheets/bad.064.INDEX_num_non_sequential.cue
new file mode 100644
index 0000000..9df3b47
--- /dev/null
+++ b/test/cuesheets/bad.064.INDEX_num_non_sequential.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 00:00:00
+ INDEX 00 00:00:00
diff --git a/test/cuesheets/bad.065.INDEX_num_out_of_range.cue b/test/cuesheets/bad.065.INDEX_num_out_of_range.cue
new file mode 100644
index 0000000..a72d7e0
--- /dev/null
+++ b/test/cuesheets/bad.065.INDEX_num_out_of_range.cue
@@ -0,0 +1,104 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 00 00:00:00
+ INDEX 01 02:10:15
+ INDEX 02 02:20:15
+ INDEX 03 02:30:15
+ INDEX 04 03:30:15
+ INDEX 05 03:31:15
+ INDEX 06 03:32:06
+ INDEX 07 03:32:07
+ INDEX 08 03:32:08
+ INDEX 09 03:32:09
+ INDEX 10 03:32:10
+ INDEX 11 03:32:11
+ INDEX 12 03:32:12
+ INDEX 13 03:32:13
+ INDEX 14 03:32:14
+ INDEX 15 03:32:15
+ INDEX 16 03:32:16
+ INDEX 17 03:32:17
+ INDEX 18 03:32:18
+ INDEX 19 03:32:19
+ INDEX 20 03:32:20
+ INDEX 21 03:32:21
+ INDEX 22 03:32:22
+ INDEX 23 03:32:23
+ INDEX 24 03:32:24
+ INDEX 25 03:32:25
+ INDEX 26 03:32:26
+ INDEX 27 03:32:27
+ INDEX 28 03:32:28
+ INDEX 29 03:32:29
+ INDEX 30 03:32:30
+ INDEX 31 03:32:31
+ INDEX 32 03:32:32
+ INDEX 33 03:32:33
+ INDEX 34 03:32:34
+ INDEX 35 03:32:35
+ INDEX 36 03:32:36
+ INDEX 37 03:32:37
+ INDEX 38 03:32:38
+ INDEX 39 03:32:39
+ INDEX 40 03:32:40
+ INDEX 41 03:32:41
+ INDEX 42 03:32:42
+ INDEX 43 03:32:43
+ INDEX 44 03:32:44
+ INDEX 45 03:32:45
+ INDEX 46 03:32:46
+ INDEX 47 03:32:47
+ INDEX 48 03:32:48
+ INDEX 49 03:32:49
+ INDEX 50 03:32:50
+ INDEX 51 03:32:51
+ INDEX 52 03:32:52
+ INDEX 53 03:32:53
+ INDEX 54 03:32:54
+ INDEX 55 03:32:55
+ INDEX 56 03:32:56
+ INDEX 57 03:32:57
+ INDEX 58 03:32:58
+ INDEX 59 03:32:59
+ INDEX 60 03:32:60
+ INDEX 61 03:32:61
+ INDEX 62 03:32:62
+ INDEX 63 03:32:63
+ INDEX 64 03:32:64
+ INDEX 65 03:32:65
+ INDEX 66 03:32:66
+ INDEX 67 03:32:67
+ INDEX 68 03:32:68
+ INDEX 69 03:32:69
+ INDEX 70 03:40:50
+ INDEX 71 03:40:51
+ INDEX 72 03:40:52
+ INDEX 73 03:40:53
+ INDEX 74 03:40:54
+ INDEX 75 03:40:55
+ INDEX 76 03:40:56
+ INDEX 77 03:40:57
+ INDEX 78 03:40:58
+ INDEX 79 03:40:59
+ INDEX 80 03:41:50
+ INDEX 81 03:41:51
+ INDEX 82 03:41:52
+ INDEX 83 03:41:53
+ INDEX 84 03:41:54
+ INDEX 85 03:41:55
+ INDEX 86 03:41:56
+ INDEX 87 03:41:57
+ INDEX 88 03:41:58
+ INDEX 89 03:41:59
+ INDEX 90 03:42:50
+ INDEX 91 03:42:51
+ INDEX 92 03:42:52
+ INDEX 93 03:42:53
+ INDEX 94 03:42:54
+ INDEX 95 03:42:55
+ INDEX 96 03:42:56
+ INDEX 97 03:42:57
+ INDEX 98 03:42:58
+ INDEX 99 03:42:59
+ INDEX 100 04:00:00
diff --git a/test/cuesheets/bad.066.INDEX_missing_offset.cue b/test/cuesheets/bad.066.INDEX_missing_offset.cue
new file mode 100644
index 0000000..1e78bc6
--- /dev/null
+++ b/test/cuesheets/bad.066.INDEX_missing_offset.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01
diff --git a/test/cuesheets/bad.067.INDEX_illegal_offset.cue b/test/cuesheets/bad.067.INDEX_illegal_offset.cue
new file mode 100644
index 0000000..8742029
--- /dev/null
+++ b/test/cuesheets/bad.067.INDEX_illegal_offset.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 00:00.00
diff --git a/test/cuesheets/bad.068.INDEX_cdda_illegal_offset.cue b/test/cuesheets/bad.068.INDEX_cdda_illegal_offset.cue
new file mode 100644
index 0000000..6e00fed
--- /dev/null
+++ b/test/cuesheets/bad.068.INDEX_cdda_illegal_offset.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 588
diff --git a/test/cuesheets/bad.069.nonzero_first_INDEX.cue b/test/cuesheets/bad.069.nonzero_first_INDEX.cue
new file mode 100644
index 0000000..7464949
--- /dev/null
+++ b/test/cuesheets/bad.069.nonzero_first_INDEX.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 00:02:00
diff --git a/test/cuesheets/bad.070.INDEX_offset_not_ascending_1.cue b/test/cuesheets/bad.070.INDEX_offset_not_ascending_1.cue
new file mode 100644
index 0000000..a4fe063
--- /dev/null
+++ b/test/cuesheets/bad.070.INDEX_offset_not_ascending_1.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
+ INDEX 02 00:02:00
+ INDEX 03 00:01:74
diff --git a/test/cuesheets/bad.071.INDEX_offset_not_ascending_2.cue b/test/cuesheets/bad.071.INDEX_offset_not_ascending_2.cue
new file mode 100644
index 0000000..8983a03
--- /dev/null
+++ b/test/cuesheets/bad.071.INDEX_offset_not_ascending_2.cue
@@ -0,0 +1,6 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
+ INDEX 02 00:02:00
+ TRACK 02 AUDIO
+ INDEX 01 00:01:74
diff --git a/test/cuesheets/bad.110.ISRC_multiple.cue b/test/cuesheets/bad.110.ISRC_multiple.cue
new file mode 100644
index 0000000..907c1b8
--- /dev/null
+++ b/test/cuesheets/bad.110.ISRC_multiple.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ ISRC ABCDE1234567
+ ISRC ABCD01234567
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.111.ISRC_wrong_place_1.cue b/test/cuesheets/bad.111.ISRC_wrong_place_1.cue
new file mode 100644
index 0000000..86fbe90
--- /dev/null
+++ b/test/cuesheets/bad.111.ISRC_wrong_place_1.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ISRC ABCD01234567
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.112.ISRC_wrong_place_2.cue b/test/cuesheets/bad.112.ISRC_wrong_place_2.cue
new file mode 100644
index 0000000..e0b4e77
--- /dev/null
+++ b/test/cuesheets/bad.112.ISRC_wrong_place_2.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
+ ISRC ABCD01234567
diff --git a/test/cuesheets/bad.113.ISRC_missing_number.cue b/test/cuesheets/bad.113.ISRC_missing_number.cue
new file mode 100644
index 0000000..742e054
--- /dev/null
+++ b/test/cuesheets/bad.113.ISRC_missing_number.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ ISRC
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.114.ISRC_invalid_number.cue b/test/cuesheets/bad.114.ISRC_invalid_number.cue
new file mode 100644
index 0000000..362130a
--- /dev/null
+++ b/test/cuesheets/bad.114.ISRC_invalid_number.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ ISRC ABCD0123456Z
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue b/test/cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue
new file mode 100644
index 0000000..0697074
--- /dev/null
+++ b/test/cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
diff --git a/test/cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue b/test/cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue
new file mode 100644
index 0000000..554cf12
--- /dev/null
+++ b/test/cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue
@@ -0,0 +1,3 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 00 00:00:00
diff --git a/test/cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue b/test/cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue
new file mode 100644
index 0000000..5618db8
--- /dev/null
+++ b/test/cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue
@@ -0,0 +1,4 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ TRACK 02 AUDIO
+ INDEX 01 00:02:00
diff --git a/test/cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue b/test/cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue
new file mode 100644
index 0000000..f74a9e4
--- /dev/null
+++ b/test/cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue
@@ -0,0 +1,5 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 00 00:00:00
+ TRACK 02 AUDIO
+ INDEX 01 00:02:00
diff --git a/test/cuesheets/bad.134.TRACK_missing_number.cue b/test/cuesheets/bad.134.TRACK_missing_number.cue
new file mode 100644
index 0000000..f95180b
--- /dev/null
+++ b/test/cuesheets/bad.134.TRACK_missing_number.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK
diff --git a/test/cuesheets/bad.135.TRACK_invalid_number_1.cue b/test/cuesheets/bad.135.TRACK_invalid_number_1.cue
new file mode 100644
index 0000000..9c3c9ea
--- /dev/null
+++ b/test/cuesheets/bad.135.TRACK_invalid_number_1.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK thhpt! AUDIO
diff --git a/test/cuesheets/bad.136.TRACK_invalid_number_2.cue b/test/cuesheets/bad.136.TRACK_invalid_number_2.cue
new file mode 100644
index 0000000..69caafa
--- /dev/null
+++ b/test/cuesheets/bad.136.TRACK_invalid_number_2.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK 0 AUDIO
diff --git a/test/cuesheets/bad.137.TRACK_cdda_out_of_range.cue b/test/cuesheets/bad.137.TRACK_cdda_out_of_range.cue
new file mode 100644
index 0000000..8696f52
--- /dev/null
+++ b/test/cuesheets/bad.137.TRACK_cdda_out_of_range.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK 100 AUDIO
diff --git a/test/cuesheets/bad.138.TRACK_num_non_sequential.cue b/test/cuesheets/bad.138.TRACK_num_non_sequential.cue
new file mode 100644
index 0000000..37870c3
--- /dev/null
+++ b/test/cuesheets/bad.138.TRACK_num_non_sequential.cue
@@ -0,0 +1,6 @@
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 0:0:0
+ TRACK 02 AUDIO
+ INDEX 01 2:0:0
+ TRACK 01 AUDIO
diff --git a/test/cuesheets/bad.139.TRACK_missing_type.cue b/test/cuesheets/bad.139.TRACK_missing_type.cue
new file mode 100644
index 0000000..01fca6a
--- /dev/null
+++ b/test/cuesheets/bad.139.TRACK_missing_type.cue
@@ -0,0 +1,2 @@
+FILE "z.wav" WAVE
+ TRACK 01
diff --git a/test/cuesheets/bad.140.no_TRACKs.cue b/test/cuesheets/bad.140.no_TRACKs.cue
new file mode 100644
index 0000000..73cb8cf
--- /dev/null
+++ b/test/cuesheets/bad.140.no_TRACKs.cue
@@ -0,0 +1 @@
+FILE "z.wav" WAVE
diff --git a/test/cuesheets/bad.200.FLAC_leadin_missing_offset.cue b/test/cuesheets/bad.200.FLAC_leadin_missing_offset.cue
new file mode 100644
index 0000000..7441aa5
--- /dev/null
+++ b/test/cuesheets/bad.200.FLAC_leadin_missing_offset.cue
@@ -0,0 +1 @@
+REM FLAC__lead-in
diff --git a/test/cuesheets/bad.201.FLAC_leadin_illegal_offset.cue b/test/cuesheets/bad.201.FLAC_leadin_illegal_offset.cue
new file mode 100644
index 0000000..acf6940
--- /dev/null
+++ b/test/cuesheets/bad.201.FLAC_leadin_illegal_offset.cue
@@ -0,0 +1 @@
+REM FLAC__lead-in thhpt!
diff --git a/test/cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue b/test/cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue
new file mode 100644
index 0000000..6f2d0f7
--- /dev/null
+++ b/test/cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue
@@ -0,0 +1 @@
+REM FLAC__lead-in 123
diff --git a/test/cuesheets/bad.230.FLAC_leadout_multiple.cue b/test/cuesheets/bad.230.FLAC_leadout_multiple.cue
new file mode 100644
index 0000000..656fe9d
--- /dev/null
+++ b/test/cuesheets/bad.230.FLAC_leadout_multiple.cue
@@ -0,0 +1,3 @@
+REM FLAC__lead-in 88200
+REM FLAC__lead-out 170 211680000
+REM FLAC__lead-out 170 211680588
diff --git a/test/cuesheets/bad.231.FLAC_leadout_missing_track.cue b/test/cuesheets/bad.231.FLAC_leadout_missing_track.cue
new file mode 100644
index 0000000..a723b7a
--- /dev/null
+++ b/test/cuesheets/bad.231.FLAC_leadout_missing_track.cue
@@ -0,0 +1 @@
+REM FLAC__lead-out
diff --git a/test/cuesheets/bad.232.FLAC_leadout_illegal_track.cue b/test/cuesheets/bad.232.FLAC_leadout_illegal_track.cue
new file mode 100644
index 0000000..6001826
--- /dev/null
+++ b/test/cuesheets/bad.232.FLAC_leadout_illegal_track.cue
@@ -0,0 +1 @@
+REM FLAC__lead-out thhpt!
diff --git a/test/cuesheets/bad.233.FLAC_leadout_missing_offset.cue b/test/cuesheets/bad.233.FLAC_leadout_missing_offset.cue
new file mode 100644
index 0000000..ef5f1dc
--- /dev/null
+++ b/test/cuesheets/bad.233.FLAC_leadout_missing_offset.cue
@@ -0,0 +1 @@
+REM FLAC__lead-out 170
diff --git a/test/cuesheets/bad.234.FLAC_leadout_illegal_offset.cue b/test/cuesheets/bad.234.FLAC_leadout_illegal_offset.cue
new file mode 100644
index 0000000..01c69f4
--- /dev/null
+++ b/test/cuesheets/bad.234.FLAC_leadout_illegal_offset.cue
@@ -0,0 +1 @@
+REM FLAC__lead-out 170 thhpt!
diff --git a/test/cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue b/test/cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue
new file mode 100644
index 0000000..8add1d6
--- /dev/null
+++ b/test/cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue
@@ -0,0 +1 @@
+REM FLAC__lead-out 170 211680588
diff --git a/test/cuesheets/good.000.cue b/test/cuesheets/good.000.cue
new file mode 100644
index 0000000..bdfbccf
--- /dev/null
+++ b/test/cuesheets/good.000.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/good.001.cue b/test/cuesheets/good.001.cue
new file mode 100644
index 0000000..f9887cf
--- /dev/null
+++ b/test/cuesheets/good.001.cue
@@ -0,0 +1,184 @@
+REM FLAC__lead-in 88200
+REM FLAC__lead-out 170 211680000
+CATALOG 1234567890123
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ FLAGS PRE
+ INDEX 01 00:00:00
+ TRACK 02 AUDIO
+ FLAGS PRE
+ ISRC ABCDE7654321
+ INDEX 00 02:09:12
+ INDEX 01 02:10:15
+ INDEX 02 02:20:15
+ INDEX 03 02:30:15
+ INDEX 04 03:30:15
+ INDEX 05 03:31:15
+ INDEX 06 03:32:06
+ INDEX 07 03:32:07
+ INDEX 08 03:32:08
+ INDEX 09 03:32:09
+ INDEX 10 03:32:10
+ INDEX 11 03:32:11
+ INDEX 12 03:32:12
+ INDEX 13 03:32:13
+ INDEX 14 03:32:14
+ INDEX 15 03:32:15
+ INDEX 16 03:32:16
+ INDEX 17 03:32:17
+ INDEX 18 03:32:18
+ INDEX 19 03:32:19
+ INDEX 20 03:32:20
+ INDEX 21 03:32:21
+ INDEX 22 03:32:22
+ INDEX 23 03:32:23
+ INDEX 24 03:32:24
+ INDEX 25 03:32:25
+ INDEX 26 03:32:26
+ INDEX 27 03:32:27
+ INDEX 28 03:32:28
+ INDEX 29 03:32:29
+ INDEX 30 03:32:30
+ INDEX 31 03:32:31
+ INDEX 32 03:32:32
+ INDEX 33 03:32:33
+ INDEX 34 03:32:34
+ INDEX 35 03:32:35
+ INDEX 36 03:32:36
+ INDEX 37 03:32:37
+ INDEX 38 03:32:38
+ INDEX 39 03:32:39
+ INDEX 40 03:32:40
+ INDEX 41 03:32:41
+ INDEX 42 03:32:42
+ INDEX 43 03:32:43
+ INDEX 44 03:32:44
+ INDEX 45 03:32:45
+ INDEX 46 03:32:46
+ INDEX 47 03:32:47
+ INDEX 48 03:32:48
+ INDEX 49 03:32:49
+ INDEX 50 03:32:50
+ INDEX 51 03:32:51
+ INDEX 52 03:32:52
+ INDEX 53 03:32:53
+ INDEX 54 03:32:54
+ INDEX 55 03:32:55
+ INDEX 56 03:32:56
+ INDEX 57 03:32:57
+ INDEX 58 03:32:58
+ INDEX 59 03:32:59
+ INDEX 60 03:32:60
+ INDEX 61 03:32:61
+ INDEX 62 03:32:62
+ INDEX 63 03:32:63
+ INDEX 64 03:32:64
+ INDEX 65 03:32:65
+ INDEX 66 03:32:66
+ INDEX 67 03:32:67
+ INDEX 68 03:32:68
+ INDEX 69 03:32:69
+ INDEX 70 03:40:50
+ INDEX 71 03:40:51
+ INDEX 72 03:40:52
+ INDEX 73 03:40:53
+ INDEX 74 03:40:54
+ INDEX 75 03:40:55
+ INDEX 76 03:40:56
+ INDEX 77 03:40:57
+ INDEX 78 03:40:58
+ INDEX 79 03:40:59
+ INDEX 80 03:41:50
+ INDEX 81 03:41:51
+ INDEX 82 03:41:52
+ INDEX 83 03:41:53
+ INDEX 84 03:41:54
+ INDEX 85 03:41:55
+ INDEX 86 03:41:56
+ INDEX 87 03:41:57
+ INDEX 88 03:41:58
+ INDEX 89 03:41:59
+ INDEX 90 03:42:50
+ INDEX 91 03:42:51
+ INDEX 92 03:42:52
+ INDEX 93 03:42:53
+ INDEX 94 03:42:54
+ INDEX 95 03:42:55
+ INDEX 96 03:42:56
+ INDEX 97 03:42:57
+ INDEX 98 03:42:58
+ INDEX 99 03:42:59
+ TRACK 03 AUDIO
+ ISRC AB-CD7-65-43210
+ INDEX 00 04:50:12
+ INDEX 01 04:51:72
+ TRACK 04 AUDIO
+ INDEX 00 06:36:10
+ INDEX 01 06:38:47
+ TRACK 05 AUDIO
+ INDEX 00 08:34:45
+ INDEX 01 08:36:15
+ TRACK 06 AUDIO
+ INDEX 00 13:20:22
+ INDEX 01 13:22:12
+ TRACK 07 AUDIO
+ INDEX 00 16:08:20
+ INDEX 01 16:11:17
+ TRACK 08 AUDIO
+ INDEX 01 17:48:37
+ TRACK 09 AUDIO
+ INDEX 00 19:38:17
+ INDEX 01 19:39:30
+ TRACK 10 AUDIO
+ INDEX 00 22:07:07
+ INDEX 01 22:08:20
+ TRACK 11 AUDIO
+ INDEX 01 24:16:45
+ TRACK 12 AUDIO
+ INDEX 01 26:13:67
+ TRACK 13 AUDIO
+ INDEX 01 28:03:27
+ TRACK 14 AUDIO
+ INDEX 00 30:22:42
+ INDEX 01 30:24:45
+ TRACK 15 AUDIO
+ INDEX 00 34:06:22
+ INDEX 01 34:07:62
+ TRACK 16 AUDIO
+ INDEX 00 35:54:30
+ INDEX 01 35:56:60
+ TRACK 17 AUDIO
+ INDEX 00 38:49:10
+ INDEX 01 38:51:22
+ TRACK 18 AUDIO
+ INDEX 00 41:14:15
+ INDEX 01 41:17:15
+ TRACK 19 AUDIO
+ INDEX 00 44:27:15
+ INDEX 01 44:28:45
+ TRACK 20 AUDIO
+ INDEX 00 48:07:17
+ INDEX 01 48:09:72
+ TRACK 21 AUDIO
+ INDEX 00 50:48:05
+ INDEX 01 50:49:27
+ TRACK 22 AUDIO
+ INDEX 00 53:29:72
+ INDEX 01 53:31:20
+ TRACK 23 AUDIO
+ INDEX 00 57:57:60
+ INDEX 01 58:00:40
+ TRACK 24 AUDIO
+ INDEX 00 61:52:65
+ INDEX 01 61:55:37
+ TRACK 25 AUDIO
+ INDEX 00 65:07:50
+ INDEX 01 65:10:52
+ TRACK 26 AUDIO
+ INDEX 00 68:30:05
+ INDEX 01 68:32:45
+ TRACK 27 AUDIO
+ INDEX 01 71:45:17
+ TRACK 28 AUDIO
+ INDEX 00 74:49:07
+ INDEX 01 74:51:47
diff --git a/test/cuesheets/good.002.dos_format.cue b/test/cuesheets/good.002.dos_format.cue
new file mode 100644
index 0000000..a60e03b
--- /dev/null
+++ b/test/cuesheets/good.002.dos_format.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/good.003.missing_final_newline.cue b/test/cuesheets/good.003.missing_final_newline.cue
new file mode 100644
index 0000000..a4c298f
--- /dev/null
+++ b/test/cuesheets/good.003.missing_final_newline.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00 \ No newline at end of file
diff --git a/test/cuesheets/good.004.dos_format.missing_final_newline.cue b/test/cuesheets/good.004.dos_format.missing_final_newline.cue
new file mode 100644
index 0000000..1f6d0e5
--- /dev/null
+++ b/test/cuesheets/good.004.dos_format.missing_final_newline.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00 \ No newline at end of file
diff --git a/test/cuesheets/good.005.quoted.isrc.cue b/test/cuesheets/good.005.quoted.isrc.cue
new file mode 100644
index 0000000..3d8e905
--- /dev/null
+++ b/test/cuesheets/good.005.quoted.isrc.cue
@@ -0,0 +1,6 @@
+TRACK 01 AUDIO
+TITLE "Foo"
+PERFORMER "Bar"
+DISC_ID ""
+ISRC "US-SM1-23-45678"
+INDEX 01 00:00:00
diff --git a/test/flac-to-flac-metadata-test-files/Makefile.am b/test/flac-to-flac-metadata-test-files/Makefile.am
new file mode 100644
index 0000000..d76843d
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/Makefile.am
@@ -0,0 +1,49 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+EXTRA_DIST = \
+ case00a-expect.meta \
+ case01a-expect.meta \
+ case01b-expect.meta \
+ case01c-expect.meta \
+ case01d-expect.meta \
+ case01e-expect.meta \
+ case02a-expect.meta \
+ case02b-expect.meta \
+ case02c-expect.meta \
+ case03a-expect.meta \
+ case03b-expect.meta \
+ case03c-expect.meta \
+ case04a-expect.meta \
+ case04b-expect.meta \
+ case04c-expect.meta \
+ case04d-expect.meta \
+ case04e-expect.meta \
+ input-SCPAP.flac \
+ input-SCVA.flac \
+ input-SCVAUP.flac \
+ input-SCVPAP.flac \
+ input-SVAUP.flac \
+ input-VA.flac \
+ 🤔.flac \
+ Prøve.flac \
+ שלום.flac \
+ input0.cue
+
+clean-local:
+ -rm -f out.*
diff --git a/test/flac-to-flac-metadata-test-files/Makefile.in b/test/flac-to-flac-metadata-test-files/Makefile.in
new file mode 100644
index 0000000..ff68336
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/Makefile.in
@@ -0,0 +1,529 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/flac-to-flac-metadata-test-files
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ case00a-expect.meta \
+ case01a-expect.meta \
+ case01b-expect.meta \
+ case01c-expect.meta \
+ case01d-expect.meta \
+ case01e-expect.meta \
+ case02a-expect.meta \
+ case02b-expect.meta \
+ case02c-expect.meta \
+ case03a-expect.meta \
+ case03b-expect.meta \
+ case03c-expect.meta \
+ case04a-expect.meta \
+ case04b-expect.meta \
+ case04c-expect.meta \
+ case04d-expect.meta \
+ case04e-expect.meta \
+ input-SCPAP.flac \
+ input-SCVA.flac \
+ input-SCVAUP.flac \
+ input-SCVPAP.flac \
+ input-SVAUP.flac \
+ input-VA.flac \
+ 🤔.flac \
+ Prøve.flac \
+ שלום.flac \
+ input0.cue
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/flac-to-flac-metadata-test-files/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/flac-to-flac-metadata-test-files/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+clean-local:
+ -rm -f out.*
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/flac-to-flac-metadata-test-files/Prøve.flac b/test/flac-to-flac-metadata-test-files/Prøve.flac
new file mode 100644
index 0000000..1883075
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/Prøve.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/case00a-expect.meta b/test/flac-to-flac-metadata-test-files/case00a-expect.meta
new file mode 100644
index 0000000..6facc3e
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case00a-expect.meta
@@ -0,0 +1,84 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 126 (UNKNOWN)
+ is last: false
+ length: XXX
+ data contents:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case01a-expect.meta b/test/flac-to-flac-metadata-test-files/case01a-expect.meta
new file mode 100644
index 0000000..25ceaec
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case01a-expect.meta
@@ -0,0 +1,79 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case01b-expect.meta b/test/flac-to-flac-metadata-test-files/case01b-expect.meta
new file mode 100644
index 0000000..1970646
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case01b-expect.meta
@@ -0,0 +1,75 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/case01c-expect.meta b/test/flac-to-flac-metadata-test-files/case01c-expect.meta
new file mode 100644
index 0000000..25ceaec
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case01c-expect.meta
@@ -0,0 +1,79 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case01d-expect.meta b/test/flac-to-flac-metadata-test-files/case01d-expect.meta
new file mode 100644
index 0000000..25ceaec
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case01d-expect.meta
@@ -0,0 +1,79 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case01e-expect.meta b/test/flac-to-flac-metadata-test-files/case01e-expect.meta
new file mode 100644
index 0000000..25ceaec
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case01e-expect.meta
@@ -0,0 +1,79 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case02a-expect.meta b/test/flac-to-flac-metadata-test-files/case02a-expect.meta
new file mode 100644
index 0000000..63bf6f6
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case02a-expect.meta
@@ -0,0 +1,73 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #2
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case02b-expect.meta b/test/flac-to-flac-metadata-test-files/case02b-expect.meta
new file mode 100644
index 0000000..a6b269d
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case02b-expect.meta
@@ -0,0 +1,74 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: artist=0
+METADATA block #2
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case02c-expect.meta b/test/flac-to-flac-metadata-test-files/case02c-expect.meta
new file mode 100644
index 0000000..2e2e06f
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case02c-expect.meta
@@ -0,0 +1,79 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: artist=0
+METADATA block #2
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 126 (UNKNOWN)
+ is last: false
+ length: XXX
+ data contents:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case03a-expect.meta b/test/flac-to-flac-metadata-test-files/case03a-expect.meta
new file mode 100644
index 0000000..c4c4c93
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case03a-expect.meta
@@ -0,0 +1,84 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 9294969890929
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 588
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 2352
+ number: 2
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #2
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 126 (UNKNOWN)
+ is last: false
+ length: XXX
+ data contents:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case03b-expect.meta b/test/flac-to-flac-metadata-test-files/case03b-expect.meta
new file mode 100644
index 0000000..c4c4c93
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case03b-expect.meta
@@ -0,0 +1,84 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 9294969890929
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 588
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 2352
+ number: 2
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #2
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 10
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+ point 5: PLACEHOLDER
+ point 6: PLACEHOLDER
+ point 7: PLACEHOLDER
+ point 8: PLACEHOLDER
+ point 9: PLACEHOLDER
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #5
+ type: 126 (UNKNOWN)
+ is last: false
+ length: XXX
+ data contents:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case03c-expect.meta b/test/flac-to-flac-metadata-test-files/case03c-expect.meta
new file mode 100644
index 0000000..6bdefb3
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case03c-expect.meta
@@ -0,0 +1,41 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5879
+ MD5 signature: 2ea0e6a767b66bf0668523fd77672ce1
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #3
+ type: 2 (APPLICATION)
+ is last: false
+ length: XXX
+ application ID: 66616b65
+ data contents:
+METADATA block #4
+ type: 126 (UNKNOWN)
+ is last: false
+ length: XXX
+ data contents:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/flac-to-flac-metadata-test-files/case04a-expect.meta b/test/flac-to-flac-metadata-test-files/case04a-expect.meta
new file mode 100644
index 0000000..cb50bb4
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case04a-expect.meta
@@ -0,0 +1,26 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #2
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/case04b-expect.meta b/test/flac-to-flac-metadata-test-files/case04b-expect.meta
new file mode 100644
index 0000000..71d9b95
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case04b-expect.meta
@@ -0,0 +1,36 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 5
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #3
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/case04c-expect.meta b/test/flac-to-flac-metadata-test-files/case04c-expect.meta
new file mode 100644
index 0000000..f163edf
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case04c-expect.meta
@@ -0,0 +1,32 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #3
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/case04d-expect.meta b/test/flac-to-flac-metadata-test-files/case04d-expect.meta
new file mode 100644
index 0000000..086f684
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case04d-expect.meta
@@ -0,0 +1,60 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #3
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/case04e-expect.meta b/test/flac-to-flac-metadata-test-files/case04e-expect.meta
new file mode 100644
index 0000000..6559840
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/case04e-expect.meta
@@ -0,0 +1,70 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 44100 Hz
+ channels: 2
+ bits-per-sample: 16
+ total samples: 5880
+ MD5 signature: 74ffd4737eb5488d512be4af58943362
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 5
+ point 0: sample_number=0
+ point 1: sample_number=4096
+ point 2: PLACEHOLDER
+ point 3: PLACEHOLDER
+ point 4: PLACEHOLDER
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 88200
+ is CD: true
+ number of tracks: 3
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 2
+ index[0]
+ offset: 0
+ number: 1
+ index[1]
+ offset: 588
+ number: 2
+ track[1]
+ offset: 2940
+ number: 2
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[2]
+ offset: 5880
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 6
+ comment[0]: REPLAYGAIN_TRACK_PEAK=0.99996948
+ comment[1]: REPLAYGAIN_TRACK_GAIN=-7.89 dB
+ comment[2]: REPLAYGAIN_ALBUM_PEAK=0.99996948
+ comment[3]: REPLAYGAIN_ALBUM_GAIN=-7.89 dB
+ comment[4]: artist=1
+ comment[5]: title=2
+METADATA block #4
+ type: 2 (APPLICATION)
+ is last: true
+ length: XXX
+ application ID: 66616b65
+ data contents:
diff --git a/test/flac-to-flac-metadata-test-files/input-SCPAP.flac b/test/flac-to-flac-metadata-test-files/input-SCPAP.flac
new file mode 100644
index 0000000..6fde318
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-SCPAP.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input-SCVA.flac b/test/flac-to-flac-metadata-test-files/input-SCVA.flac
new file mode 100644
index 0000000..4bb6926
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-SCVA.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input-SCVAUP.flac b/test/flac-to-flac-metadata-test-files/input-SCVAUP.flac
new file mode 100644
index 0000000..e4ecc95
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-SCVAUP.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input-SCVPAP.flac b/test/flac-to-flac-metadata-test-files/input-SCVPAP.flac
new file mode 100644
index 0000000..7474928
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-SCVPAP.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input-SVAUP.flac b/test/flac-to-flac-metadata-test-files/input-SVAUP.flac
new file mode 100644
index 0000000..e3fa5c1
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-SVAUP.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input-VA.flac b/test/flac-to-flac-metadata-test-files/input-VA.flac
new file mode 100644
index 0000000..4fac878
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input-VA.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/input0.cue b/test/flac-to-flac-metadata-test-files/input0.cue
new file mode 100644
index 0000000..2894bd0
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/input0.cue
@@ -0,0 +1,7 @@
+CATALOG 9294969890929
+FILE "blah" FLAC
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
+ TRACK 02 AUDIO
+ INDEX 01 00:00:01
+ INDEX 02 00:00:05
diff --git a/test/flac-to-flac-metadata-test-files/שלום.flac b/test/flac-to-flac-metadata-test-files/שלום.flac
new file mode 100644
index 0000000..0e66868
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/שלום.flac
Binary files differ
diff --git a/test/flac-to-flac-metadata-test-files/🤔.flac b/test/flac-to-flac-metadata-test-files/🤔.flac
new file mode 100644
index 0000000..7373da6
--- /dev/null
+++ b/test/flac-to-flac-metadata-test-files/🤔.flac
Binary files differ
diff --git a/test/foreign-metadata-test-files/24bit-WaveFmtPCM.wav b/test/foreign-metadata-test-files/24bit-WaveFmtPCM.wav
new file mode 100644
index 0000000..2479974
--- /dev/null
+++ b/test/foreign-metadata-test-files/24bit-WaveFmtPCM.wav
Binary files differ
diff --git a/test/foreign-metadata-test-files/AIFF-C-sowt-compression-type-name.aifc b/test/foreign-metadata-test-files/AIFF-C-sowt-compression-type-name.aifc
new file mode 100644
index 0000000..ca0963a
--- /dev/null
+++ b/test/foreign-metadata-test-files/AIFF-C-sowt-compression-type-name.aifc
Binary files differ
diff --git a/test/foreign-metadata-test-files/AIFF-C-sowt-tag.aifc b/test/foreign-metadata-test-files/AIFF-C-sowt-tag.aifc
new file mode 100644
index 0000000..381d52e
--- /dev/null
+++ b/test/foreign-metadata-test-files/AIFF-C-sowt-tag.aifc
Binary files differ
diff --git a/test/foreign-metadata-test-files/AIFF-ID3.aiff b/test/foreign-metadata-test-files/AIFF-ID3.aiff
new file mode 100644
index 0000000..517c5ac
--- /dev/null
+++ b/test/foreign-metadata-test-files/AIFF-ID3.aiff
Binary files differ
diff --git a/test/foreign-metadata-test-files/BWF-WaveFmtEx.wav b/test/foreign-metadata-test-files/BWF-WaveFmtEx.wav
new file mode 100755
index 0000000..244985d
--- /dev/null
+++ b/test/foreign-metadata-test-files/BWF-WaveFmtEx.wav
Binary files differ
diff --git a/test/foreign-metadata-test-files/Makefile.am b/test/foreign-metadata-test-files/Makefile.am
new file mode 100644
index 0000000..bdb2ed2
--- /dev/null
+++ b/test/foreign-metadata-test-files/Makefile.am
@@ -0,0 +1,24 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+EXTRA_DIST = \
+ 24bit-WaveFmtPCM.wav \
+ AIFF-C-sowt-compression-type-name.aifc \
+ AIFF-C-sowt-tag.aifc \
+ AIFF-ID3.aiff \
+ BWF-WaveFmtEx.wav
diff --git a/test/foreign-metadata-test-files/Makefile.in b/test/foreign-metadata-test-files/Makefile.in
new file mode 100644
index 0000000..26c708b
--- /dev/null
+++ b/test/foreign-metadata-test-files/Makefile.in
@@ -0,0 +1,504 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/foreign-metadata-test-files
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ 24bit-WaveFmtPCM.wav \
+ AIFF-C-sowt-compression-type-name.aifc \
+ AIFF-C-sowt-tag.aifc \
+ AIFF-ID3.aiff \
+ BWF-WaveFmtEx.wav
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/foreign-metadata-test-files/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/foreign-metadata-test-files/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/generate_streams.sh b/test/generate_streams.sh
new file mode 100755
index 0000000..29e32dc
--- /dev/null
+++ b/test/generate_streams.sh
@@ -0,0 +1,29 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH="$(pwd)/../src/test_streams:$PATH"
+PATH="$(pwd)/../objs/$BUILD/bin:$PATH"
+
+echo "Generating streams..."
+if [ ! -f wacky1.wav ] ; then
+ test_streams || die "ERROR during test_streams"
+fi
diff --git a/test/metaflac-test-files/Makefile.am b/test/metaflac-test-files/Makefile.am
new file mode 100644
index 0000000..6f08961
--- /dev/null
+++ b/test/metaflac-test-files/Makefile.am
@@ -0,0 +1,90 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+EXTRA_DIST = \
+ case00-expect.meta \
+ case01-expect.meta \
+ case02-expect.meta \
+ case03-expect.meta \
+ case04-expect.meta \
+ case05-expect.meta \
+ case06-expect.meta \
+ case07-expect.meta \
+ case08-expect.meta \
+ case09-expect.meta \
+ case10-expect.meta \
+ case11-expect.meta \
+ case12-expect.meta \
+ case13-expect.meta \
+ case14-expect.meta \
+ case15-expect.meta \
+ case16-expect.meta \
+ case17-expect.meta \
+ case18-expect.meta \
+ case19-expect.meta \
+ case20-expect.meta \
+ case21-expect.meta \
+ case22-expect.meta \
+ case23-expect.meta \
+ case24-expect.meta \
+ case25-expect.meta \
+ case26-expect.meta \
+ case27-expect.meta \
+ case28-expect.meta \
+ case29-expect.meta \
+ case30-expect.meta \
+ case31-expect.meta \
+ case32-expect.meta \
+ case33-expect.meta \
+ case34-expect.meta \
+ case35-expect.meta \
+ case36-expect.meta \
+ case37-expect.meta \
+ case38-expect.meta \
+ case39-expect.meta \
+ case40-expect.meta \
+ case41-expect.meta \
+ case42-expect.meta \
+ case43-expect.meta \
+ case44-expect.meta \
+ case45-expect.meta \
+ case46-expect.meta \
+ case47-expect.meta \
+ case48-expect.meta \
+ case49-expect.meta \
+ case50-expect.meta \
+ case51-expect.meta \
+ case52-expect.meta \
+ case53-expect.meta \
+ case54-expect.meta \
+ case55-expect.meta \
+ case56-expect.meta \
+ case57-expect.meta \
+ case58-expect.meta \
+ case59-expect.meta \
+ case60-expect.meta \
+ case61-expect.meta \
+ case62-expect.meta \
+ case63-expect.meta \
+ case64-expect.meta \
+ case65-expect.meta \
+ case66-expect.meta \
+ case67-expect.meta
+
+clean-local:
+ -rm -f out.*
diff --git a/test/metaflac-test-files/Makefile.in b/test/metaflac-test-files/Makefile.in
new file mode 100644
index 0000000..7623202
--- /dev/null
+++ b/test/metaflac-test-files/Makefile.in
@@ -0,0 +1,570 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/metaflac-test-files
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ case00-expect.meta \
+ case01-expect.meta \
+ case02-expect.meta \
+ case03-expect.meta \
+ case04-expect.meta \
+ case05-expect.meta \
+ case06-expect.meta \
+ case07-expect.meta \
+ case08-expect.meta \
+ case09-expect.meta \
+ case10-expect.meta \
+ case11-expect.meta \
+ case12-expect.meta \
+ case13-expect.meta \
+ case14-expect.meta \
+ case15-expect.meta \
+ case16-expect.meta \
+ case17-expect.meta \
+ case18-expect.meta \
+ case19-expect.meta \
+ case20-expect.meta \
+ case21-expect.meta \
+ case22-expect.meta \
+ case23-expect.meta \
+ case24-expect.meta \
+ case25-expect.meta \
+ case26-expect.meta \
+ case27-expect.meta \
+ case28-expect.meta \
+ case29-expect.meta \
+ case30-expect.meta \
+ case31-expect.meta \
+ case32-expect.meta \
+ case33-expect.meta \
+ case34-expect.meta \
+ case35-expect.meta \
+ case36-expect.meta \
+ case37-expect.meta \
+ case38-expect.meta \
+ case39-expect.meta \
+ case40-expect.meta \
+ case41-expect.meta \
+ case42-expect.meta \
+ case43-expect.meta \
+ case44-expect.meta \
+ case45-expect.meta \
+ case46-expect.meta \
+ case47-expect.meta \
+ case48-expect.meta \
+ case49-expect.meta \
+ case50-expect.meta \
+ case51-expect.meta \
+ case52-expect.meta \
+ case53-expect.meta \
+ case54-expect.meta \
+ case55-expect.meta \
+ case56-expect.meta \
+ case57-expect.meta \
+ case58-expect.meta \
+ case59-expect.meta \
+ case60-expect.meta \
+ case61-expect.meta \
+ case62-expect.meta \
+ case63-expect.meta \
+ case64-expect.meta \
+ case65-expect.meta \
+ case66-expect.meta \
+ case67-expect.meta
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/metaflac-test-files/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/metaflac-test-files/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+clean-local:
+ -rm -f out.*
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/metaflac-test-files/case00-expect.meta b/test/metaflac-test-files/case00-expect.meta
new file mode 100644
index 0000000..a1a3770
--- /dev/null
+++ b/test/metaflac-test-files/case00-expect.meta
@@ -0,0 +1,24 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case01-expect.meta b/test/metaflac-test-files/case01-expect.meta
new file mode 100644
index 0000000..bae8f49
--- /dev/null
+++ b/test/metaflac-test-files/case01-expect.meta
@@ -0,0 +1,9 @@
+a042237c5493fdb9656b94a83608d11a
+1152
+1152
+10
+10
+8000
+1
+8
+80000
diff --git a/test/metaflac-test-files/case02-expect.meta b/test/metaflac-test-files/case02-expect.meta
new file mode 100644
index 0000000..830302c
--- /dev/null
+++ b/test/metaflac-test-files/case02-expect.meta
@@ -0,0 +1,28 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #3
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case03-expect.meta b/test/metaflac-test-files/case03-expect.meta
new file mode 100644
index 0000000..a3b88bd
--- /dev/null
+++ b/test/metaflac-test-files/case03-expect.meta
@@ -0,0 +1,25 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: ARTIST=The_artist_formerly_known_as_the_artist...
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case04-expect.meta b/test/metaflac-test-files/case04-expect.meta
new file mode 100644
index 0000000..056f5af
--- /dev/null
+++ b/test/metaflac-test-files/case04-expect.meta
@@ -0,0 +1,26 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 2
+ comment[0]: ARTIST=The_artist_formerly_known_as_the_artist...
+ comment[1]: ARTIST=Chuck_Woolery
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case05-expect.meta b/test/metaflac-test-files/case05-expect.meta
new file mode 100644
index 0000000..6bc0238
--- /dev/null
+++ b/test/metaflac-test-files/case05-expect.meta
@@ -0,0 +1,27 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 3
+ comment[0]: ARTIST=The_artist_formerly_known_as_the_artist...
+ comment[1]: ARTIST=Chuck_Woolery
+ comment[2]: ARTIST=Vern
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case06-expect.meta b/test/metaflac-test-files/case06-expect.meta
new file mode 100644
index 0000000..7435329
--- /dev/null
+++ b/test/metaflac-test-files/case06-expect.meta
@@ -0,0 +1,28 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: ARTIST=The_artist_formerly_known_as_the_artist...
+ comment[1]: ARTIST=Chuck_Woolery
+ comment[2]: ARTIST=Vern
+ comment[3]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case07-expect.meta b/test/metaflac-test-files/case07-expect.meta
new file mode 100644
index 0000000..8e9efd1
--- /dev/null
+++ b/test/metaflac-test-files/case07-expect.meta
@@ -0,0 +1,4 @@
+reference libFLAC 1.4.3 20230623
+ARTIST=The_artist_formerly_known_as_the_artist...
+ARTIST=Chuck_Woolery
+ARTIST=Vern
diff --git a/test/metaflac-test-files/case08-expect.meta b/test/metaflac-test-files/case08-expect.meta
new file mode 100644
index 0000000..61845ae
--- /dev/null
+++ b/test/metaflac-test-files/case08-expect.meta
@@ -0,0 +1,27 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 3
+ comment[0]: ARTIST=Chuck_Woolery
+ comment[1]: ARTIST=Vern
+ comment[2]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case09-expect.meta b/test/metaflac-test-files/case09-expect.meta
new file mode 100644
index 0000000..71f7270
--- /dev/null
+++ b/test/metaflac-test-files/case09-expect.meta
@@ -0,0 +1,25 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case10-expect.meta b/test/metaflac-test-files/case10-expect.meta
new file mode 100644
index 0000000..402ad6d
--- /dev/null
+++ b/test/metaflac-test-files/case10-expect.meta
@@ -0,0 +1,6 @@
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
diff --git a/test/metaflac-test-files/case11-expect.meta b/test/metaflac-test-files/case11-expect.meta
new file mode 100644
index 0000000..530001b
--- /dev/null
+++ b/test/metaflac-test-files/case11-expect.meta
@@ -0,0 +1,9 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
diff --git a/test/metaflac-test-files/case12-expect.meta b/test/metaflac-test-files/case12-expect.meta
new file mode 100644
index 0000000..1d29f44
--- /dev/null
+++ b/test/metaflac-test-files/case12-expect.meta
@@ -0,0 +1,12 @@
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
diff --git a/test/metaflac-test-files/case13-expect.meta b/test/metaflac-test-files/case13-expect.meta
new file mode 100644
index 0000000..004104f
--- /dev/null
+++ b/test/metaflac-test-files/case13-expect.meta
@@ -0,0 +1,10 @@
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case14-expect.meta b/test/metaflac-test-files/case14-expect.meta
new file mode 100644
index 0000000..a9a1167
--- /dev/null
+++ b/test/metaflac-test-files/case14-expect.meta
@@ -0,0 +1,13 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case15-expect.meta b/test/metaflac-test-files/case15-expect.meta
new file mode 100644
index 0000000..6f68176
--- /dev/null
+++ b/test/metaflac-test-files/case15-expect.meta
@@ -0,0 +1,16 @@
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case16-expect.meta b/test/metaflac-test-files/case16-expect.meta
new file mode 100644
index 0000000..28eaf2b
--- /dev/null
+++ b/test/metaflac-test-files/case16-expect.meta
@@ -0,0 +1,33 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #4
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case17-expect.meta b/test/metaflac-test-files/case17-expect.meta
new file mode 100644
index 0000000..71f7270
--- /dev/null
+++ b/test/metaflac-test-files/case17-expect.meta
@@ -0,0 +1,25 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case18-expect.meta b/test/metaflac-test-files/case18-expect.meta
new file mode 100644
index 0000000..81f1f0e
--- /dev/null
+++ b/test/metaflac-test-files/case18-expect.meta
@@ -0,0 +1,29 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case19-expect.meta b/test/metaflac-test-files/case19-expect.meta
new file mode 100644
index 0000000..71f7270
--- /dev/null
+++ b/test/metaflac-test-files/case19-expect.meta
@@ -0,0 +1,25 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case20-expect.meta b/test/metaflac-test-files/case20-expect.meta
new file mode 100644
index 0000000..81f1f0e
--- /dev/null
+++ b/test/metaflac-test-files/case20-expect.meta
@@ -0,0 +1,29 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: TITLE=He_who_smelt_it_dealt_it
+METADATA block #3
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case21-expect.meta b/test/metaflac-test-files/case21-expect.meta
new file mode 100644
index 0000000..a1a3770
--- /dev/null
+++ b/test/metaflac-test-files/case21-expect.meta
@@ -0,0 +1,24 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case22-expect.meta b/test/metaflac-test-files/case22-expect.meta
new file mode 100644
index 0000000..d102550
--- /dev/null
+++ b/test/metaflac-test-files/case22-expect.meta
@@ -0,0 +1,18 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case23-expect.meta b/test/metaflac-test-files/case23-expect.meta
new file mode 100644
index 0000000..d102550
--- /dev/null
+++ b/test/metaflac-test-files/case23-expect.meta
@@ -0,0 +1,18 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case24-expect.meta b/test/metaflac-test-files/case24-expect.meta
new file mode 100644
index 0000000..d102550
--- /dev/null
+++ b/test/metaflac-test-files/case24-expect.meta
@@ -0,0 +1,18 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case25-expect.meta b/test/metaflac-test-files/case25-expect.meta
new file mode 100644
index 0000000..79de56e
--- /dev/null
+++ b/test/metaflac-test-files/case25-expect.meta
@@ -0,0 +1,14 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: true
+ length: XXX
+ comments: 0
diff --git a/test/metaflac-test-files/case26-expect.meta b/test/metaflac-test-files/case26-expect.meta
new file mode 100644
index 0000000..622d19a
--- /dev/null
+++ b/test/metaflac-test-files/case26-expect.meta
@@ -0,0 +1,22 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 0
+METADATA block #2
+ type: 1 (PADDING)
+ is last: false
+ length: XXX
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case27-expect.meta b/test/metaflac-test-files/case27-expect.meta
new file mode 100644
index 0000000..1fd3fb6
--- /dev/null
+++ b/test/metaflac-test-files/case27-expect.meta
@@ -0,0 +1,13 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case28-expect.meta b/test/metaflac-test-files/case28-expect.meta
new file mode 100644
index 0000000..1fd3fb6
--- /dev/null
+++ b/test/metaflac-test-files/case28-expect.meta
@@ -0,0 +1,13 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case29-expect.meta b/test/metaflac-test-files/case29-expect.meta
new file mode 100644
index 0000000..0ebcd92
--- /dev/null
+++ b/test/metaflac-test-files/case29-expect.meta
@@ -0,0 +1,9 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: true
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
diff --git a/test/metaflac-test-files/case30-expect.meta b/test/metaflac-test-files/case30-expect.meta
new file mode 100644
index 0000000..0ebcd92
--- /dev/null
+++ b/test/metaflac-test-files/case30-expect.meta
@@ -0,0 +1,9 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: true
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
diff --git a/test/metaflac-test-files/case31-expect.meta b/test/metaflac-test-files/case31-expect.meta
new file mode 100644
index 0000000..a76e485
--- /dev/null
+++ b/test/metaflac-test-files/case31-expect.meta
@@ -0,0 +1,15 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: true
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789abcdefghij
diff --git a/test/metaflac-test-files/case32-expect.meta b/test/metaflac-test-files/case32-expect.meta
new file mode 100644
index 0000000..ad58596
--- /dev/null
+++ b/test/metaflac-test-files/case32-expect.meta
@@ -0,0 +1,15 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: true
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789abcdefghi
diff --git a/test/metaflac-test-files/case33-expect.meta b/test/metaflac-test-files/case33-expect.meta
new file mode 100644
index 0000000..aed7927
--- /dev/null
+++ b/test/metaflac-test-files/case33-expect.meta
@@ -0,0 +1,19 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789abcde
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case34-expect.meta b/test/metaflac-test-files/case34-expect.meta
new file mode 100644
index 0000000..619bbcc
--- /dev/null
+++ b/test/metaflac-test-files/case34-expect.meta
@@ -0,0 +1,19 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: f=0
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case35-expect.meta b/test/metaflac-test-files/case35-expect.meta
new file mode 100644
index 0000000..274076d
--- /dev/null
+++ b/test/metaflac-test-files/case35-expect.meta
@@ -0,0 +1,19 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case36-expect.meta b/test/metaflac-test-files/case36-expect.meta
new file mode 100644
index 0000000..ad58596
--- /dev/null
+++ b/test/metaflac-test-files/case36-expect.meta
@@ -0,0 +1,15 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: true
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789abcdefghi
diff --git a/test/metaflac-test-files/case37-expect.meta b/test/metaflac-test-files/case37-expect.meta
new file mode 100644
index 0000000..274076d
--- /dev/null
+++ b/test/metaflac-test-files/case37-expect.meta
@@ -0,0 +1,19 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case38-expect.meta b/test/metaflac-test-files/case38-expect.meta
new file mode 100644
index 0000000..d6c3f79
--- /dev/null
+++ b/test/metaflac-test-files/case38-expect.meta
@@ -0,0 +1,19 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 1
+ comment[0]: f=0123456789abcdefghij
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case39-expect.meta b/test/metaflac-test-files/case39-expect.meta
new file mode 100644
index 0000000..937f252
--- /dev/null
+++ b/test/metaflac-test-files/case39-expect.meta
@@ -0,0 +1,20 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 2
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case40-expect.meta b/test/metaflac-test-files/case40-expect.meta
new file mode 100644
index 0000000..f163537
--- /dev/null
+++ b/test/metaflac-test-files/case40-expect.meta
@@ -0,0 +1,22 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case41-expect.meta b/test/metaflac-test-files/case41-expect.meta
new file mode 100644
index 0000000..d2acc4b
--- /dev/null
+++ b/test/metaflac-test-files/case41-expect.meta
@@ -0,0 +1,27 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 9
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+ comment[4]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
+ comment[5]: REPLAYGAIN_TRACK_GAIN=+64.82 dB
+ comment[6]: REPLAYGAIN_TRACK_PEAK=0.00000000
+ comment[7]: REPLAYGAIN_ALBUM_GAIN=+64.82 dB
+ comment[8]: REPLAYGAIN_ALBUM_PEAK=0.00000000
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case42-expect.meta b/test/metaflac-test-files/case42-expect.meta
new file mode 100644
index 0000000..f163537
--- /dev/null
+++ b/test/metaflac-test-files/case42-expect.meta
@@ -0,0 +1,22 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #2
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case43-expect.meta b/test/metaflac-test-files/case43-expect.meta
new file mode 100644
index 0000000..3bead39
--- /dev/null
+++ b/test/metaflac-test-files/case43-expect.meta
@@ -0,0 +1,49 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case44-expect.meta b/test/metaflac-test-files/case44-expect.meta
new file mode 100644
index 0000000..776daa5
--- /dev/null
+++ b/test/metaflac-test-files/case44-expect.meta
@@ -0,0 +1,28 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case45-expect.meta b/test/metaflac-test-files/case45-expect.meta
new file mode 100644
index 0000000..3bead39
--- /dev/null
+++ b/test/metaflac-test-files/case45-expect.meta
@@ -0,0 +1,49 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case46-expect.meta b/test/metaflac-test-files/case46-expect.meta
new file mode 100644
index 0000000..25778cb
--- /dev/null
+++ b/test/metaflac-test-files/case46-expect.meta
@@ -0,0 +1,62 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case47-expect.meta b/test/metaflac-test-files/case47-expect.meta
new file mode 100644
index 0000000..096c430
--- /dev/null
+++ b/test/metaflac-test-files/case47-expect.meta
@@ -0,0 +1,75 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case48-expect.meta b/test/metaflac-test-files/case48-expect.meta
new file mode 100644
index 0000000..4055396
--- /dev/null
+++ b/test/metaflac-test-files/case48-expect.meta
@@ -0,0 +1,88 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case49-expect.meta b/test/metaflac-test-files/case49-expect.meta
new file mode 100644
index 0000000..56f7d5e
--- /dev/null
+++ b/test/metaflac-test-files/case49-expect.meta
@@ -0,0 +1,101 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case50-expect.meta b/test/metaflac-test-files/case50-expect.meta
new file mode 100644
index 0000000..868df7c
--- /dev/null
+++ b/test/metaflac-test-files/case50-expect.meta
@@ -0,0 +1,114 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case51-expect.meta b/test/metaflac-test-files/case51-expect.meta
new file mode 100644
index 0000000..c98eae4
--- /dev/null
+++ b/test/metaflac-test-files/case51-expect.meta
@@ -0,0 +1,127 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case52-expect.meta b/test/metaflac-test-files/case52-expect.meta
new file mode 100644
index 0000000..4053288
--- /dev/null
+++ b/test/metaflac-test-files/case52-expect.meta
@@ -0,0 +1,140 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case53-expect.meta b/test/metaflac-test-files/case53-expect.meta
new file mode 100644
index 0000000..9dc3ef5
--- /dev/null
+++ b/test/metaflac-test-files/case53-expect.meta
@@ -0,0 +1,153 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case54-expect.meta b/test/metaflac-test-files/case54-expect.meta
new file mode 100644
index 0000000..866cd36
--- /dev/null
+++ b/test/metaflac-test-files/case54-expect.meta
@@ -0,0 +1,166 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case55-expect.meta b/test/metaflac-test-files/case55-expect.meta
new file mode 100644
index 0000000..38058ea
--- /dev/null
+++ b/test/metaflac-test-files/case55-expect.meta
@@ -0,0 +1,179 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 4.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #14
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case56-expect.meta b/test/metaflac-test-files/case56-expect.meta
new file mode 100644
index 0000000..0bcf922
--- /dev/null
+++ b/test/metaflac-test-files/case56-expect.meta
@@ -0,0 +1,192 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 4.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #14
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 5.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #15
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case57-expect.meta b/test/metaflac-test-files/case57-expect.meta
new file mode 100644
index 0000000..546a600
--- /dev/null
+++ b/test/metaflac-test-files/case57-expect.meta
@@ -0,0 +1,205 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 4.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #14
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 5.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #15
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 6.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 23
+ data length: XXX
+ data:
+METADATA block #16
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case58-expect.meta b/test/metaflac-test-files/case58-expect.meta
new file mode 100644
index 0000000..6496167
--- /dev/null
+++ b/test/metaflac-test-files/case58-expect.meta
@@ -0,0 +1,218 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 4.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #14
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 5.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #15
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 6.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 23
+ data length: XXX
+ data:
+METADATA block #16
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 7.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 23
+ data length: XXX
+ data:
+METADATA block #17
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case59-expect.meta b/test/metaflac-test-files/case59-expect.meta
new file mode 100644
index 0000000..cbe812d
--- /dev/null
+++ b/test/metaflac-test-files/case59-expect.meta
@@ -0,0 +1,231 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 0.gif
+ width: 24
+ height: 24
+ depth: 24
+ colors: 2
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 1.gif
+ width: 12
+ height: 8
+ depth: 24
+ colors: 256
+ data length: XXX
+ data:
+METADATA block #6
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 3 (Cover (front))
+ MIME type: image/gif
+ description: 2.gif
+ width: 16
+ height: 14
+ depth: 24
+ colors: 128
+ data length: XXX
+ data:
+METADATA block #7
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 0.jpg
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #8
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 4 (Cover (back))
+ MIME type: image/jpeg
+ description: 4.jpg
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #9
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 0.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #10
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 1.png
+ width: 30
+ height: 20
+ depth: 8
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #11
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 2.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #12
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 3.png
+ width: 30
+ height: 20
+ depth: 24
+ colors: 7
+ data length: XXX
+ data:
+METADATA block #13
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 4.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #14
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 5.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #15
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 6.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 23
+ data length: XXX
+ data:
+METADATA block #16
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 7.png
+ width: 31
+ height: 47
+ depth: 24
+ colors: 23
+ data length: XXX
+ data:
+METADATA block #17
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 5 (Leaflet page)
+ MIME type: image/png
+ description: 8.png
+ width: 32
+ height: 32
+ depth: 32
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #18
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case60-expect.meta b/test/metaflac-test-files/case60-expect.meta
new file mode 100644
index 0000000..3bead39
--- /dev/null
+++ b/test/metaflac-test-files/case60-expect.meta
@@ -0,0 +1,49 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case61-expect.meta b/test/metaflac-test-files/case61-expect.meta
new file mode 100644
index 0000000..535cde3
--- /dev/null
+++ b/test/metaflac-test-files/case61-expect.meta
@@ -0,0 +1,62 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 1 (32x32 pixels 'file icon' (PNG only))
+ MIME type: image/png
+ description: standard_icon
+ width: 32
+ height: 32
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #5
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case62-expect.meta b/test/metaflac-test-files/case62-expect.meta
new file mode 100644
index 0000000..472fec3
--- /dev/null
+++ b/test/metaflac-test-files/case62-expect.meta
@@ -0,0 +1,75 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 4
+ comment[0]: f=0123456789abcdefghij
+ comment[1]: TITLE=Tittle
+ comment[2]: artist=Fartist
+ comment[3]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 1 (32x32 pixels 'file icon' (PNG only))
+ MIME type: image/png
+ description: standard_icon
+ width: 32
+ height: 32
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 2 (Other file icon)
+ MIME type: image/png
+ description: icon
+ width: 64
+ height: 64
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case63-expect.meta b/test/metaflac-test-files/case63-expect.meta
new file mode 100644
index 0000000..8c3f2ec
--- /dev/null
+++ b/test/metaflac-test-files/case63-expect.meta
@@ -0,0 +1,74 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: XXX
+ sample_rate: 8000 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 80000
+ MD5 signature: a042237c5493fdb9656b94a83608d11a
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: XXX
+ seek points: 1
+ point 0: sample_number=0
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: XXX
+ comments: 3
+ comment[0]: TITLE=Tittle
+ comment[1]: artist=Fartist
+ comment[2]: artist=artits
+METADATA block #3
+ type: 5 (CUESHEET)
+ is last: false
+ length: XXX
+ media catalog number: 1234567890123
+ lead-in: 0
+ is CD: false
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 80000
+ number: 255 (LEAD-OUT)
+METADATA block #4
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 1 (32x32 pixels 'file icon' (PNG only))
+ MIME type: image/png
+ description: standard_icon
+ width: 32
+ height: 32
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #5
+ type: 6 (PICTURE)
+ is last: false
+ length: XXX
+ type: 2 (Other file icon)
+ MIME type: image/png
+ description: icon
+ width: 64
+ height: 64
+ depth: 24
+ colors: 0 (unindexed)
+ data length: XXX
+ data:
+METADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: XXX
diff --git a/test/metaflac-test-files/case64-expect.meta b/test/metaflac-test-files/case64-expect.meta
new file mode 100644
index 0000000..f78c13a
--- /dev/null
+++ b/test/metaflac-test-files/case64-expect.meta
@@ -0,0 +1,3 @@
+TITLE=Tittle
+artist=Fartist
+artist=artits
diff --git a/test/metaflac-test-files/case65-expect.meta b/test/metaflac-test-files/case65-expect.meta
new file mode 100644
index 0000000..3f863b1
--- /dev/null
+++ b/test/metaflac-test-files/case65-expect.meta
Binary files differ
diff --git a/test/metaflac-test-files/case66-expect.meta b/test/metaflac-test-files/case66-expect.meta
new file mode 100644
index 0000000..9345b15
--- /dev/null
+++ b/test/metaflac-test-files/case66-expect.meta
@@ -0,0 +1,62 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: 34
+ minimum blocksize: 1152 samples
+ maximum blocksize: 1152 samples
+ minimum framesize: 11 bytes
+ maximum framesize: 11 bytes
+ sample_rate: 44100 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 1
+ MD5 signature: 8d39dd7eef115ea6975446ef4082951f
+METADATA block #1
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: 18
+ seek points: 1
+ point 0: sample_number=0, stream_offset=0, frame_samples=1
+METADATA block #2
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: 46
+ vendor string: reference libFLAC 1.0.5_beta2 20030114
+ comments: 0
+METADATA block #3
+ type: 126 (UNKNOWN)
+ is last: false
+ length: 4
+ data contents:
+ 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z
+METADATA block #4
+ type: 5 (CUESHEET)
+ is last: false
+ length: 480
+ media catalog number:
+ lead-in: 88200
+ is CD: true
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 1
+ number: 170 (LEAD-OUT)
+METADATA block #5
+ type: 2 (APPLICATION)
+ is last: false
+ length: 12
+ application ID: 61626364
+ data contents:
+calfflacMETADATA block #6
+ type: 1 (PADDING)
+ is last: true
+ length: 12
diff --git a/test/metaflac-test-files/case67-expect.meta b/test/metaflac-test-files/case67-expect.meta
new file mode 100644
index 0000000..3f6f217
--- /dev/null
+++ b/test/metaflac-test-files/case67-expect.meta
@@ -0,0 +1,95 @@
+METADATA block #0
+ type: 0 (STREAMINFO)
+ is last: false
+ length: 34
+ minimum blocksize: 1152 samples
+ maximum blocksize: 1152 samples
+ minimum framesize: 11 bytes
+ maximum framesize: 11 bytes
+ sample_rate: 44100 Hz
+ channels: 1
+ bits-per-sample: 8
+ total samples: 1
+ MD5 signature: 8d39dd7eef115ea6975446ef4082951f
+METADATA block #1
+ type: 126 (UNKNOWN)
+ is last: false
+ length: 4
+ data contents:
+ 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z
+METADATA block #2
+ type: 5 (CUESHEET)
+ is last: false
+ length: 480
+ media catalog number:
+ lead-in: 88200
+ is CD: true
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 1
+ number: 170 (LEAD-OUT)
+METADATA block #3
+ type: 2 (APPLICATION)
+ is last: false
+ length: 12
+ application ID: 61626364
+ data contents:
+calfflacMETADATA block #4
+ type: 3 (SEEKTABLE)
+ is last: false
+ length: 18
+ seek points: 1
+ point 0: sample_number=0, stream_offset=0, frame_samples=1
+METADATA block #5
+ type: 4 (VORBIS_COMMENT)
+ is last: false
+ length: 46
+ vendor string: reference libFLAC 1.0.5_beta2 20030114
+ comments: 0
+METADATA block #6
+ type: 126 (UNKNOWN)
+ is last: false
+ length: 4
+ data contents:
+ 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z
+METADATA block #7
+ type: 5 (CUESHEET)
+ is last: false
+ length: 480
+ media catalog number:
+ lead-in: 88200
+ is CD: true
+ number of tracks: 2
+ track[0]
+ offset: 0
+ number: 1
+ ISRC:
+ type: AUDIO
+ pre-emphasis: false
+ number of index points: 1
+ index[0]
+ offset: 0
+ number: 1
+ track[1]
+ offset: 1
+ number: 170 (LEAD-OUT)
+METADATA block #8
+ type: 2 (APPLICATION)
+ is last: false
+ length: 12
+ application ID: 61626364
+ data contents:
+calfflacMETADATA block #9
+ type: 1 (PADDING)
+ is last: true
+ length: 28
diff --git a/test/metaflac.flac.in b/test/metaflac.flac.in
new file mode 100644
index 0000000..7989263
--- /dev/null
+++ b/test/metaflac.flac.in
Binary files differ
diff --git a/test/metaflac.flac.ok b/test/metaflac.flac.ok
new file mode 100644
index 0000000..82ad84c
--- /dev/null
+++ b/test/metaflac.flac.ok
Binary files differ
diff --git a/test/picture.ok b/test/picture.ok
new file mode 100644
index 0000000..4b7e55d
--- /dev/null
+++ b/test/picture.ok
@@ -0,0 +1,42 @@
+
++++ grabbag unit test: picture
+
+testing grabbag__picture_parse_specification("")... OK (failed as expected, error: error opening picture file)
+testing grabbag__picture_parse_specification("||||")... OK (failed as expected: error opening picture file)
+testing grabbag__picture_parse_specification("|image/gif|||")... OK (failed as expected: error opening picture file)
+testing grabbag__picture_parse_specification("|image/gif|desc|320|0.gif")... OK (failed as expected: invalid picture specification: can't parse resolution/color part)
+testing grabbag__picture_parse_specification("|image/gif|desc|320x240|0.gif")... OK (failed as expected: invalid picture specification: can't parse resolution/color part)
+testing grabbag__picture_parse_specification("|image/gif|desc|320x240x9|")... OK (failed as expected: error opening picture file)
+testing grabbag__picture_parse_specification("|image/gif|desc|320x240x9/2345|0.gif")... OK (failed as expected: invalid picture specification: can't parse resolution/color part)
+testing grabbag__picture_parse_specification("1|-->|desc|32x24x9|0.gif")... OK (failed as expected: type 1 icon must be a 32x32 pixel PNG)
+testing grabbag__picture_parse_specification("|-->|desc||http://blah.blah.blah/z.gif")... OK (failed as expected: unable to extract resolution and color info from URL, user must set explicitly)
+testing grabbag__picture_parse_specification("|-->|desc|320x240x9|http://blah.blah.blah/z.gif")... OK
+testing grabbag__picture_parse_specification("pictures/0.gif")... OK
+testing grabbag__picture_parse_specification("pictures/1.gif")... OK
+testing grabbag__picture_parse_specification("pictures/2.gif")... OK
+testing grabbag__picture_parse_specification("pictures/0.jpg")... OK
+testing grabbag__picture_parse_specification("pictures/4.jpg")... OK
+testing grabbag__picture_parse_specification("pictures/0.png")... OK
+testing grabbag__picture_parse_specification("pictures/1.png")... OK
+testing grabbag__picture_parse_specification("pictures/2.png")... OK
+testing grabbag__picture_parse_specification("pictures/3.png")... OK
+testing grabbag__picture_parse_specification("pictures/4.png")... OK
+testing grabbag__picture_parse_specification("pictures/5.png")... OK
+testing grabbag__picture_parse_specification("pictures/6.png")... OK
+testing grabbag__picture_parse_specification("pictures/7.png")... OK
+testing grabbag__picture_parse_specification("pictures/8.png")... OK
+testing grabbag__picture_parse_specification("3|image/gif|||pictures/0.gif")... OK
+testing grabbag__picture_parse_specification("4|image/gif|||pictures/1.gif")... OK
+testing grabbag__picture_parse_specification("0|image/gif|||pictures/2.gif")... OK
+testing grabbag__picture_parse_specification("3|image/jpeg|||pictures/0.jpg")... OK
+testing grabbag__picture_parse_specification("3|image/jpeg|||pictures/4.jpg")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/0.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/1.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/2.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/3.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/4.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/5.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/6.png")... OK
+testing grabbag__picture_parse_specification("3|image/png|||pictures/7.png")... OK
+testing grabbag__picture_parse_specification("999|image/png|||pictures/8.png")... OK
+testing grabbag__picture_parse_specification("3|image/gif||320x240x3/2|pictures/0.gif")... OK
diff --git a/test/pictures/0.gif b/test/pictures/0.gif
new file mode 100644
index 0000000..c9f3d71
--- /dev/null
+++ b/test/pictures/0.gif
Binary files differ
diff --git a/test/pictures/0.jpg b/test/pictures/0.jpg
new file mode 100644
index 0000000..54b9a7c
--- /dev/null
+++ b/test/pictures/0.jpg
Binary files differ
diff --git a/test/pictures/0.png b/test/pictures/0.png
new file mode 100644
index 0000000..2f3ec80
--- /dev/null
+++ b/test/pictures/0.png
Binary files differ
diff --git a/test/pictures/1.gif b/test/pictures/1.gif
new file mode 100644
index 0000000..c40eeae
--- /dev/null
+++ b/test/pictures/1.gif
Binary files differ
diff --git a/test/pictures/1.png b/test/pictures/1.png
new file mode 100644
index 0000000..2b487c0
--- /dev/null
+++ b/test/pictures/1.png
Binary files differ
diff --git a/test/pictures/2.gif b/test/pictures/2.gif
new file mode 100644
index 0000000..632098b
--- /dev/null
+++ b/test/pictures/2.gif
Binary files differ
diff --git a/test/pictures/2.png b/test/pictures/2.png
new file mode 100644
index 0000000..a7ca42b
--- /dev/null
+++ b/test/pictures/2.png
Binary files differ
diff --git a/test/pictures/3.png b/test/pictures/3.png
new file mode 100644
index 0000000..9d117b6
--- /dev/null
+++ b/test/pictures/3.png
Binary files differ
diff --git a/test/pictures/4.jpg b/test/pictures/4.jpg
new file mode 100644
index 0000000..da78796
--- /dev/null
+++ b/test/pictures/4.jpg
Binary files differ
diff --git a/test/pictures/4.png b/test/pictures/4.png
new file mode 100644
index 0000000..72c0a45
--- /dev/null
+++ b/test/pictures/4.png
Binary files differ
diff --git a/test/pictures/5.png b/test/pictures/5.png
new file mode 100644
index 0000000..abefad5
--- /dev/null
+++ b/test/pictures/5.png
Binary files differ
diff --git a/test/pictures/6.png b/test/pictures/6.png
new file mode 100644
index 0000000..4953ceb
--- /dev/null
+++ b/test/pictures/6.png
Binary files differ
diff --git a/test/pictures/7.png b/test/pictures/7.png
new file mode 100644
index 0000000..c8934c1
--- /dev/null
+++ b/test/pictures/7.png
Binary files differ
diff --git a/test/pictures/8.png b/test/pictures/8.png
new file mode 100644
index 0000000..01e4118
--- /dev/null
+++ b/test/pictures/8.png
Binary files differ
diff --git a/test/pictures/Makefile.am b/test/pictures/Makefile.am
new file mode 100644
index 0000000..a1bf9e7
--- /dev/null
+++ b/test/pictures/Makefile.am
@@ -0,0 +1,33 @@
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+EXTRA_DIST = \
+ 0.gif \
+ 0.jpg \
+ 0.png \
+ 1.gif \
+ 1.png \
+ 2.gif \
+ 2.png \
+ 3.png \
+ 4.jpg \
+ 4.png \
+ 5.png \
+ 6.png \
+ 7.png \
+ 8.png
diff --git a/test/pictures/Makefile.in b/test/pictures/Makefile.in
new file mode 100644
index 0000000..c354117
--- /dev/null
+++ b/test/pictures/Makefile.in
@@ -0,0 +1,513 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2006-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test/pictures
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \
+ $(top_srcdir)/m4/add_cxxflags.m4 \
+ $(top_srcdir)/m4/ax_add_fortify_source.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_enable_debug.m4 \
+ $(top_srcdir)/m4/bswap.m4 $(top_srcdir)/m4/clang.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gcc_version.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \
+ $(top_srcdir)/m4/really_gcc.m4 \
+ $(top_srcdir)/m4/stack_protect.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_64_BIT_WORDS = @ENABLE_64_BIT_WORDS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLAC__HAS_OGG = @FLAC__HAS_OGG@
+FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
+FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
+GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
+GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
+GCC_VERSION = @GCC_VERSION@
+GIT_COMMIT_VERSION_HASH = @GIT_COMMIT_VERSION_HASH@
+GIT_FOUND = @GIT_FOUND@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBJ_FORMAT = @OBJ_FORMAT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OGG_PACKAGE = @OGG_PACKAGE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANDOC = @PANDOC@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RC = @RC@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ 0.gif \
+ 0.jpg \
+ 0.png \
+ 1.gif \
+ 1.png \
+ 2.gif \
+ 2.png \
+ 3.png \
+ 4.jpg \
+ 4.png \
+ 5.png \
+ 6.png \
+ 7.png \
+ 8.png
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/pictures/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/pictures/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/test_compression.sh b/test/test_compression.sh
new file mode 100755
index 0000000..60c2399
--- /dev/null
+++ b/test/test_compression.sh
@@ -0,0 +1,46 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2012-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH="$(pwd)/../src/flac:$PATH"
+
+printf "Using FLAC binary : %s\n" "$(which flac)"
+
+date="$(date "+%Y%m%dT%H%M%S")"
+fname="comp${date}.flac"
+
+last_k=0
+last_size=$(wc -c < noisy-sine.wav)
+
+echo "Original file size ${last_size} bytes."
+
+for k in 0 1 2 3 4 5 6 7 8 ; do
+ flac${EXE} -${k} --silent noisy-sine.wav -o ${fname}
+ size=$(wc -c < ${fname})
+ echo "Compression level ${k}, file size ${size} bytes."
+ if test ${last_size} -lt ${size} ; then
+ echo "Error : Compression ${last_k} size ${last_size} >= compression ${k} size ${size}."
+ exit 1
+ fi
+ # Need this because OSX's 'wc -c' returns a number with leading whitespace.
+ last_size=$((size+10))
+ last_k=${k}
+ rm -f ${fname}
+ done
diff --git a/test/test_flac.sh b/test/test_flac.sh
new file mode 100755
index 0000000..df2d10e
--- /dev/null
+++ b/test/test_flac.sh
@@ -0,0 +1,1338 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+# we use '.' as decimal separator in --skip/--until tests
+export LANG=C LC_ALL=C
+
+dddie="die ERROR: creating files with dd"
+
+PATH="$(pwd)/../src/flac:$PATH"
+PATH="$(pwd)/../src/metaflac:$PATH"
+PATH="$(pwd)/../src/test_streams:$PATH"
+PATH="$(pwd)/../objs/$BUILD/bin:$PATH"
+
+flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
+
+run_flac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_flac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} $TOTALLY_SILENT --no-error-on-compression-fail $* 4>>test_flac.valgrind.log
+ else
+ flac${EXE} $TOTALLY_SILENT --no-error-on-compression-fail $*
+ fi
+}
+
+run_metaflac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_flac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 4>>test_flac.valgrind.log
+ else
+ metaflac${EXE} $*
+ fi
+}
+
+md5cmp ()
+{
+ n=$( ( [ -f "$1" ] && [ -f "$2" ] && metaflac${EXE} --show-md5sum --no-filename "$1" "$2" 2>/dev/null || exit 1 ) | uniq | wc -l)
+ [ "$n" != "" ] && [ $n = 1 ]
+}
+
+echo "Checking for --ogg support in flac..."
+if flac${EXE} --ogg $TOTTALY_SILENT --force-raw-format --endian=little --sign=signed --channels=1 --bps=8 --sample-rate=44100 -c $0 1>/dev/null 2>&1 ; then
+ has_ogg=yes;
+ echo "flac --ogg works"
+else
+ has_ogg=no;
+ echo "flac --ogg doesn't work"
+fi
+
+echo "Generating streams..."
+if [ ! -f wacky1.wav ] ; then
+ test_streams || die "ERROR during test_streams"
+fi
+
+############################################################################
+# test that flac doesn't automatically overwrite files unless -f is used
+############################################################################
+
+echo "Try encoding to a file that exists; should fail"
+cp wacky1.wav exist.wav
+touch exist.flac
+if run_flac -0 exist.wav ; then
+ die "ERROR: it should have failed but didn't"
+else
+ echo "OK, it failed as it should"
+fi
+
+echo "Try encoding with -f to a file that exists; should succeed"
+if run_flac -0 --force exist.wav ; then
+ echo "OK, it succeeded as it should"
+else
+ die "ERROR: it should have succeeded but didn't"
+fi
+
+echo "Try decoding to a file that exists; should fail"
+if run_flac -d exist.flac ; then
+ die "ERROR: it should have failed but didn't"
+else
+ echo "OK, it failed as it should"
+fi
+
+echo "Try decoding with -f to a file that exists; should succeed"
+if run_flac -d -f exist.flac ; then
+ echo "OK, it succeeded as it should"
+else
+ die "ERROR: it should have succeeded but didn't"
+fi
+
+rm -f exist.wav exist.flac
+
+############################################################################
+# test fractional block sizes
+############################################################################
+
+test_fractional ()
+{
+ blocksize=$1
+ samples=$2
+ dd if=noise.raw ibs=4 count=$samples of=pbs.raw 2>/dev/null || $dddie
+ echo $ECHO_N "fractional block size test (blocksize=$blocksize samples=$samples) encode... " $ECHO_C
+ run_flac --force --verify --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=$blocksize --no-padding --lax -o pbs.flac pbs.raw || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --force-raw-format --endian=little --sign=signed -o pbs.cmp pbs.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp pbs.raw pbs.cmp || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f pbs.raw pbs.flac pbs.cmp
+}
+
+# The special significance of 2048 is it's the # of samples that flac calls
+# FLAC__stream_encoder_process() on.
+#
+# We're trying to make sure the 1-sample overread logic in the stream encoder
+# (used for last-block checking) works; these values probe around common
+# multiples of the flac sample chunk size (2048) and the blocksize.
+for samples in 31 32 33 34 35 2046 2047 2048 2049 2050 ; do
+ test_fractional 33 $samples
+done
+for samples in 254 255 256 257 258 510 511 512 513 514 1022 1023 1024 1025 1026 2046 2047 2048 2049 2050 4094 4095 4096 4097 4098 ; do
+ test_fractional 256 $samples
+done
+for samples in 1022 1023 1024 1025 1026 2046 2047 2048 2049 2050 4094 4095 4096 4097 4098 ; do
+ test_fractional 2048 $samples
+done
+for samples in 1022 1023 1024 1025 1026 2046 2047 2048 2049 2050 4094 4095 4096 4097 4098 4606 4607 4608 4609 4610 8190 8191 8192 8193 8194 16382 16383 16384 16385 16386 ; do
+ test_fractional 4608 $samples
+done
+
+############################################################################
+# basic 'round-trip' tests of various kinds of streams
+############################################################################
+
+rt_test_raw ()
+{
+ f="$1"
+ extra="$2"
+ channels="$(echo $f | awk -F- '{print $2}')"
+ bps="$(echo $f | awk -F- '{print $3}')"
+ sign="$(echo $f | awk -F- '{print $4}')"
+
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --force-raw-format --endian=little --sign=$sign --sample-rate=44100 --bps=$bps --channels=$channels --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --force-raw-format --endian=little --sign=$sign -o rt.raw $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.raw || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.raw
+}
+
+rt_test_wav ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.wav $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.wav || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.wav
+}
+
+rt_test_wav_autokf ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.wav || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.wav
+}
+
+rt_test_w64 ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.w64 $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.w64 || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.w64
+}
+
+rt_test_w64_autokf ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.w64 || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.w64
+}
+
+rt_test_rf64 ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.rf64 $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.rf64 || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.rf64
+}
+
+rt_test_rf64_autokf ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.rf64 || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.rf64
+}
+
+rt_test_aiff ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.aiff $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.aiff || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac rt.aiff
+}
+
+rt_test_autokf ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f) encode... " $ECHO_C
+ run_flac --force --verify --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode $extra rt.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f $3 || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.flac $3
+}
+
+# assumes input file is WAVE; does not check the metadata-preserving features of flac-to-flac; that is checked later
+rt_test_flac ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f->flac->flac->wav) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.flac $extra $f || die "ERROR"
+ echo $ECHO_N "re-encode... " $ECHO_C
+ run_flac --force --verify --lax -o rt2.flac rt.flac || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.wav $extra rt2.flac || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.wav || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.wav rt.flac rt2.flac
+}
+
+# assumes input file is WAVE; does not check the metadata-preserving features of flac-to-flac; that is checked later
+rt_test_ogg_flac ()
+{
+ f="$1"
+ extra="$2"
+ echo $ECHO_N "round-trip test ($f->oggflac->oggflac->wav) encode... " $ECHO_C
+ run_flac --force --verify --channel-map=none --no-padding --lax -o rt.oga --ogg $extra $f || die "ERROR"
+ echo $ECHO_N "re-encode... " $ECHO_C
+ run_flac --force --verify --lax -o rt2.oga --ogg rt.oga || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac --force --decode --channel-map=none -o rt.wav $extra rt2.oga || die "ERROR"
+ echo $ECHO_N "compare... " $ECHO_C
+ cmp $f rt.wav || die "ERROR: file mismatch"
+ echo "OK"
+ rm -f rt.wav rt.oga rt2.oga
+}
+
+for f in rt-*.raw ; do
+ rt_test_raw $f
+done
+for f in rt-*.wav ; do
+ rt_test_wav $f
+done
+for f in rt-*.w64 ; do
+ rt_test_w64 $f
+done
+for f in rt-*.rf64 ; do
+ rt_test_rf64 $f
+done
+for f in rt-*.aiff ; do
+ rt_test_aiff $f
+done
+for f in rt-*.wav ; do
+ rt_test_flac $f
+done
+if [ $has_ogg = yes ] ; then
+ for f in rt-*.wav ; do
+ rt_test_ogg_flac $f
+ done
+fi
+
+############################################################################
+# test --skip and --until
+############################################################################
+
+#
+# first make some chopped-up raw files
+#
+echo "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMN" > master.raw
+dd if=master.raw ibs=1 count=50 of=50c.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=10 count=40 of=50c.skip10.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=11 count=39 of=50c.skip11.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=20 count=30 of=50c.skip20.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=30 count=20 of=50c.skip30.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=40 count=10 of=50c.skip40.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 count=10 of=50c.until10.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 count=20 of=50c.until20.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 count=30 of=50c.until30.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 count=39 of=50c.until39.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 count=40 of=50c.until40.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=10 count=20 of=50c.skip10.until30.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=10 count=29 of=50c.skip10.until39.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=10 count=30 of=50c.skip10.until40.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=20 count=10 of=50c.skip20.until30.raw 2>/dev/null || $dddie
+dd if=master.raw ibs=1 skip=20 count=20 of=50c.skip20.until40.raw 2>/dev/null || $dddie
+
+wav_eopt="--force --verify --no-padding --lax"
+wav_dopt="--force --decode"
+
+raw_eopt="$wav_eopt --force-raw-format --endian=big --sign=signed --sample-rate=10 --bps=8 --channels=1"
+raw_dopt="$wav_dopt --force-raw-format --endian=big --sign=signed"
+
+#
+# convert them to WAVE/AIFF/Ogg FLAC files
+#
+convert_to_wav ()
+{
+ run_flac "$2" $1.raw || die "ERROR converting $1.raw to WAVE"
+ run_flac "$3" $1.flac || die "ERROR converting $1.raw to WAVE"
+}
+convert_to_wav 50c "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip10 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip11 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip20 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip30 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip40 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.until10 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.until20 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.until30 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.until39 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.until40 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip10.until30 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip10.until39 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip10.until40 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip20.until30 "$raw_eopt" "$wav_dopt"
+convert_to_wav 50c.skip20.until40 "$raw_eopt" "$wav_dopt"
+
+convert_to_aiff ()
+{
+ run_flac "$2" $1.raw || die "ERROR converting $1.raw to AIFF"
+ run_flac "$3" $1.flac -o $1.aiff || die "ERROR converting $1.raw to AIFF"
+}
+convert_to_aiff 50c "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip10 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip11 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip20 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip30 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip40 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.until10 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.until20 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.until30 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.until39 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.until40 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip10.until30 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip10.until39 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip10.until40 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip20.until30 "$raw_eopt" "$wav_dopt"
+convert_to_aiff 50c.skip20.until40 "$raw_eopt" "$wav_dopt"
+
+convert_to_ogg ()
+{
+ run_flac "$wav_eopt" --ogg $1.wav || die "ERROR converting $1.raw to Ogg FLAC"
+}
+if [ $has_ogg = yes ] ; then
+ convert_to_ogg 50c
+ convert_to_ogg 50c.skip10
+ convert_to_ogg 50c.skip11
+ convert_to_ogg 50c.skip20
+ convert_to_ogg 50c.skip30
+ convert_to_ogg 50c.skip40
+ convert_to_ogg 50c.until10
+ convert_to_ogg 50c.until20
+ convert_to_ogg 50c.until30
+ convert_to_ogg 50c.until39
+ convert_to_ogg 50c.until40
+ convert_to_ogg 50c.skip10.until30
+ convert_to_ogg 50c.skip10.until39
+ convert_to_ogg 50c.skip10.until40
+ convert_to_ogg 50c.skip20.until30
+ convert_to_ogg 50c.skip20.until40
+fi
+
+test_skip_until ()
+{
+ in_fmt=$1
+ out_fmt=$2
+
+ [ "$in_fmt" = wav ] || [ "$in_fmt" = aiff ] || [ "$in_fmt" = raw ] || [ "$in_fmt" = flac ] || [ "$in_fmt" = ogg ] || die "ERROR: internal error, bad 'in' format '$in_fmt'"
+
+ [ "$out_fmt" = flac ] || [ "$out_fmt" = ogg ] || die "ERROR: internal error, bad 'out' format '$out_fmt'"
+
+ if [ $in_fmt = raw ] ; then
+ eopt="$raw_eopt"
+ dopt="$raw_dopt"
+ else
+ eopt="$wav_eopt"
+ dopt="$wav_dopt"
+ fi
+
+ if [ $in_fmt = flac -o $in_fmt = ogg ] && [ $out_fmt = flac -o $out_fmt = ogg ]; then
+ CMP=md5cmp
+ else
+ CMP=cmp
+ fi
+
+ if [ $out_fmt = ogg ] ; then
+ eopt="--ogg $eopt"
+ fi
+
+ #
+ # test --skip when encoding
+ #
+
+ desc="($in_fmt<->$out_fmt)"
+
+ echo $ECHO_N "testing --skip=# (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 -o z50c.skip10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.$in_fmt z50c.skip10.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.skip10.$in_fmt || die "ERROR: file mismatch for --skip=10 (encode) $desc"
+ rm -f z50c.skip10.$out_fmt z50c.skip10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=0:01 -o z50c.skip0_01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip0_01.$in_fmt z50c.skip0_01.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.skip0_01.$in_fmt || die "ERROR: file mismatch for --skip=0:01 (encode) $desc"
+ rm -f z50c.skip0_01.$out_fmt z50c.skip0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=0:01.1001 -o z50c.skip0_01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip0_01.1001.$in_fmt z50c.skip0_01.1001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip11.$in_fmt z50c.skip0_01.1001.$in_fmt || die "ERROR: file mismatch for --skip=0:01.1001 (encode) $desc"
+ rm -f z50c.skip0_01.1001.$out_fmt z50c.skip0_01.1001.$in_fmt
+ echo OK
+
+ #
+ # test --skip when decoding
+ #
+
+ if [ $in_fmt != $out_fmt ] ; then run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt ; else cp -f 50c.$in_fmt z50c.$out_fmt ; fi || die "ERROR generating FLAC file $desc"
+
+ echo $ECHO_N "testing --skip=# (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 -o z50c.skip10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.skip10.$in_fmt || die "ERROR: file mismatch for --skip=10 (decode) $desc"
+ rm -f z50c.skip10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=mm:ss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=0:01 -o z50c.skip0_01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.skip0_01.$in_fmt || die "ERROR: file mismatch for --skip=0:01 (decode) $desc"
+ rm -f z50c.skip0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=mm:ss.sss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=0:01.1001 -o z50c.skip0_01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip11.$in_fmt z50c.skip0_01.1001.$in_fmt || die "ERROR: file mismatch for --skip=0:01.1001 (decode) $desc"
+ rm -f z50c.skip0_01.1001.$in_fmt
+ echo OK
+
+ rm -f z50c.$out_fmt
+
+ #
+ # test --until when encoding
+ #
+
+ echo $ECHO_N "testing --until=# (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=40 -o z50c.until40.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until40.$in_fmt z50c.until40.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until40.$in_fmt || die "ERROR: file mismatch for --until=40 (encode) $desc"
+ rm -f z50c.until40.$out_fmt z50c.until40.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=0:04 -o z50c.until0_04.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until0_04.$in_fmt z50c.until0_04.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until0_04.$in_fmt || die "ERROR: file mismatch for --until=0:04 (encode) $desc"
+ rm -f z50c.until0_04.$out_fmt z50c.until0_04.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=0:03.9001 -o z50c.until0_03.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until0_03.9001.$in_fmt z50c.until0_03.9001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until39.$in_fmt z50c.until0_03.9001.$in_fmt || die "ERROR: file mismatch for --until=0:03.9001 (encode) $desc"
+ rm -f z50c.until0_03.9001.$out_fmt z50c.until0_03.9001.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-# (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=-10 -o z50c.until-10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until-10.$in_fmt z50c.until-10.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until-10.$in_fmt || die "ERROR: file mismatch for --until=-10 (encode) $desc"
+ rm -f z50c.until-10.$out_fmt z50c.until-10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=-0:01 -o z50c.until-0_01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until-0_01.$in_fmt z50c.until-0_01.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until-0_01.$in_fmt || die "ERROR: file mismatch for --until=-0:01 (encode) $desc"
+ rm -f z50c.until-0_01.$out_fmt z50c.until-0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --until=-0:01.1001 -o z50c.until-0_01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.until-0_01.1001.$in_fmt z50c.until-0_01.1001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until39.$in_fmt z50c.until-0_01.1001.$in_fmt || die "ERROR: file mismatch for --until=-0:01.1001 (encode) $desc"
+ rm -f z50c.until-0_01.1001.$out_fmt z50c.until-0_01.1001.$in_fmt
+ echo OK
+
+ #
+ # test --until when decoding
+ #
+
+ if [ $in_fmt != $out_fmt ] ; then run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt ; else cp -f 50c.$in_fmt z50c.$out_fmt ; fi || die "ERROR generating FLAC file $desc"
+
+ echo $ECHO_N "testing --until=# (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=40 -o z50c.until40.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until40.$in_fmt || die "ERROR: file mismatch for --until=40 (decode) $desc"
+ rm -f z50c.until40.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=mm:ss (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=0:04 -o z50c.until0_04.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until0_04.$in_fmt || die "ERROR: file mismatch for --until=0:04 (decode) $desc"
+ rm -f z50c.until0_04.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=mm:ss.sss (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=0:03.9001 -o z50c.until0_03.9001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until39.$in_fmt z50c.until0_03.9001.$in_fmt || die "ERROR: file mismatch for --until=0:03.9001 (decode) $desc"
+ rm -f z50c.until0_03.9001.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-# (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=-10 -o z50c.until-10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until-10.$in_fmt || die "ERROR: file mismatch for --until=-10 (decode) $desc"
+ rm -f z50c.until-10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-mm:ss (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=-0:01 -o z50c.until-0_01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.until-0_01.$in_fmt || die "ERROR: file mismatch for --until=-0:01 (decode) $desc"
+ rm -f z50c.until-0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --until=-mm:ss.sss (decode) $desc... " $ECHO_C
+ run_flac $dopt --until=-0:01.1001 -o z50c.until-0_01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until39.$in_fmt z50c.until-0_01.1001.$in_fmt || die "ERROR: file mismatch for --until=-0:01.1001 (decode) $desc"
+ rm -f z50c.until-0_01.1001.$in_fmt
+ echo OK
+
+ rm -f z50c.$out_fmt
+
+ #
+ # test --skip and --until when encoding
+ #
+
+ echo $ECHO_N "testing --skip=10 --until=# (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=40 -o z50c.skip10.until40.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until40.$in_fmt z50c.skip10.until40.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until40.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=40 (encode) $desc"
+ rm -f z50c.skip10.until40.$out_fmt z50c.skip10.until40.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=0:04 -o z50c.skip10.until0_04.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until0_04.$in_fmt z50c.skip10.until0_04.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until0_04.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:04 (encode) $desc"
+ rm -f z50c.skip10.until0_04.$out_fmt z50c.skip10.until0_04.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=0:03.9001 -o z50c.skip10.until0_03.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until0_03.9001.$in_fmt z50c.skip10.until0_03.9001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until39.$in_fmt z50c.skip10.until0_03.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:03.9001 (encode) $desc"
+ rm -f z50c.skip10.until0_03.9001.$out_fmt z50c.skip10.until0_03.9001.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=+# (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=+30 -o z50c.skip10.until+30.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until+30.$in_fmt z50c.skip10.until+30.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until+30.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+30 (encode) $desc"
+ rm -f z50c.skip10.until+30.$out_fmt z50c.skip10.until+30.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=+mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=+0:03 -o z50c.skip10.until+0_03.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until+0_03.$in_fmt z50c.skip10.until+0_03.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until+0_03.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+0:03 (encode) $desc"
+ rm -f z50c.skip10.until+0_03.$out_fmt z50c.skip10.until+0_03.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=+mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=+0:02.9001 -o z50c.skip10.until+0_02.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until+0_02.9001.$in_fmt z50c.skip10.until+0_02.9001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until39.$in_fmt z50c.skip10.until+0_02.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+0:02.9001 (encode) $desc"
+ rm -f z50c.skip10.until+0_02.9001.$out_fmt z50c.skip10.until+0_02.9001.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-# (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=-10 -o z50c.skip10.until-10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until-10.$in_fmt z50c.skip10.until-10.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until-10.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-10 (encode) $desc"
+ rm -f z50c.skip10.until-10.$out_fmt z50c.skip10.until-10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-mm:ss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=-0:01 -o z50c.skip10.until-0_01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until-0_01.$in_fmt z50c.skip10.until-0_01.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until-0_01.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01 (encode) $desc"
+ rm -f z50c.skip10.until-0_01.$out_fmt z50c.skip10.until-0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-mm:ss.sss (encode) $desc... " $ECHO_C
+ run_flac $eopt --skip=10 --until=-0:01.1001 -o z50c.skip10.until-0_01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+ [ $in_fmt = $out_fmt ] || run_flac $dopt -o z50c.skip10.until-0_01.1001.$in_fmt z50c.skip10.until-0_01.1001.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until39.$in_fmt z50c.skip10.until-0_01.1001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01.1001 (encode) $desc"
+ rm -f z50c.skip10.until-0_01.1001.$out_fmt z50c.skip10.until-0_01.1001.$in_fmt
+ echo OK
+
+ #
+ # test --skip and --until when decoding
+ #
+
+ if [ $in_fmt != $out_fmt ] ; then run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt ; else cp -f 50c.$in_fmt z50c.$out_fmt ; fi || die "ERROR generating FLAC file $desc"
+
+
+ echo $ECHO_N "testing --skip=10 --until=# (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=40 -o z50c.skip10.until40.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until40.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=40 (decode) $desc"
+ rm -f z50c.skip10.until40.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=mm:ss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=0:04 -o z50c.skip10.until0_04.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until0_04.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:04 (decode) $desc"
+ rm -f z50c.skip10.until0_04.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=mm:ss.sss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=0:03.9001 -o z50c.skip10.until0_03.9001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until39.$in_fmt z50c.skip10.until0_03.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:03.9001 (decode) $desc"
+ rm -f z50c.skip10.until0_03.9001.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-# (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=-10 -o z50c.skip10.until-10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until-10.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-10 (decode) $desc"
+ rm -f z50c.skip10.until-10.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-mm:ss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=-0:01 -o z50c.skip10.until-0_01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.skip10.until-0_01.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01 (decode) $desc"
+ rm -f z50c.skip10.until-0_01.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --skip=10 --until=-mm:ss.sss (decode) $desc... " $ECHO_C
+ run_flac $dopt --skip=10 --until=-0:01.1001 -o z50c.skip10.until-0_01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until39.$in_fmt z50c.skip10.until-0_01.1001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01.1001 (decode) $desc"
+ rm -f z50c.skip10.until-0_01.1001.$in_fmt
+ echo OK
+
+ rm -f z50c.$out_fmt
+}
+
+test_skip_until raw flac
+test_skip_until wav flac
+test_skip_until aiff flac
+test_skip_until flac flac
+#@@@if [ $has_ogg = yes ] ; then
+#@@@ #@@@ doesn't work yet because md5cmp doesn't work because metaflac doesn't work on ogg flac yet
+#@@@ test_skip_until ogg flac
+#@@@fi
+
+if [ $has_ogg = yes ] ; then
+ test_skip_until raw ogg
+ test_skip_until wav ogg
+ test_skip_until aiff ogg
+ #@@@ doesn't work yet because md5cmp doesn't work because metaflac doesn't work on ogg flac yet
+ #@@@test_skip_until flac ogg
+ #@@@test_skip_until ogg ogg
+fi
+
+echo "testing seek extremes:"
+
+run_flac --verify --force --no-padding --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 noise.raw || die "ERROR generating FLAC file"
+
+if [ $is_win = no ] ; then
+ total_noise_cdda_samples="$(run_metaflac --show-total-samples noise.flac)"
+ [ $? = 0 ] || die "ERROR getting total sample count from noise.flac"
+else
+ # some flavors of cygwin don't seem to treat the \x0d as a word
+ # separator, so we hard code it. we'll just have to fix it later
+ # if we change the way noise.flac is made.
+ total_noise_cdda_samples=393216
+fi
+
+echo $ECHO_N "testing --skip=0... " $ECHO_C
+run_flac $wav_dopt --skip=0 -o z.wav noise.flac || die "ERROR decoding FLAC file noise.flac"
+echo OK
+
+for delta in 2 1 ; do
+ n=$((total_noise_cdda_samples - delta))
+ echo $ECHO_N "testing --skip=$n... " $ECHO_C
+ run_flac $wav_dopt --skip=$n -o z.wav noise.flac || die "ERROR decoding FLAC file noise.flac"
+ echo OK
+done
+
+rm noise.flac z.wav
+
+############################################################################
+# test --input-size
+############################################################################
+
+#@@@ cat will not work on old cygwin, need to fix
+if [ $is_win = no ] ; then
+ echo $ECHO_N "testing --input-size=50 --skip=10... " $ECHO_C
+ run_flac $raw_eopt --input-size=50 --skip=10 -o z50c.skip10.flac - < 50c.raw || die "ERROR generating FLAC file"
+ run_flac $raw_dopt -o z50c.skip10.raw z50c.skip10.flac || die "ERROR decoding FLAC file"
+ cmp 50c.skip10.raw z50c.skip10.raw || die "ERROR: file mismatch for --input-size=50 --skip=10"
+ rm -f z50c.skip10.raw z50c.skip10.flac
+ echo OK
+fi
+
+############################################################################
+# test --output-prefix
+############################################################################
+
+in_dir=./tmp_in
+out_dir=./tmp_out
+mkdir $in_dir $out_dir || die "ERROR failed to create temp directories"
+
+cp 50c.raw 50c.flac $in_dir
+
+#
+# test --output-prefix when encoding
+#
+
+echo $ECHO_N "testing --output-prefix=$out_dir/ (encode)... " $ECHO_C
+run_flac $raw_eopt --output-prefix=$out_dir/ $in_dir/50c.raw || die "ERROR generating FLAC file in $out_dir (encode)"
+[ -f $out_dir/50c.flac ] || die "ERROR FLAC file not in $out_dir (encode)"
+run_flac $raw_dopt $out_dir/50c.flac || die "ERROR decoding FLAC file (encode)"
+[ -f $out_dir/50c.raw ] || die "ERROR RAW file not in $out_dir (encode)"
+cmp 50c.raw $out_dir/50c.raw || die "ERROR: file mismatch for --output-prefix=$out_dir (encode)"
+rm -f $out_dir/50c.flac $out_dir/50c.raw
+echo OK
+
+#
+# test --ouput-prefix when decoding
+#
+
+echo $ECHO_N "testing --output-prefix=$out_dir/ (decode)... " $ECHO_C
+run_flac $raw_dopt --output-prefix=$out_dir/ $in_dir/50c.flac || die "ERROR deocding FLAC file in $out_dir (decode)"
+[ -f $out_dir/50c.raw ] || die "ERROR RAW file not in $out_dir (decode)"
+run_flac $raw_eopt $out_dir/50c.raw || die "ERROR generating FLAC file (decode)"
+[ -f $out_dir/50c.flac ] || die "ERROR FLAC file not in $out_dir (decode)"
+cmp 50c.flac $out_dir/50c.flac || die "ERROR: file mismatch for --output-prefix=$out_dir (decode)"
+rm -f $out_dir/50c.flac $out_dir/50c.raw
+echo OK
+
+rm -rf $in_dir $out_dir
+
+############################################################################
+# test --cue
+############################################################################
+
+#
+# create the cue sheet
+#
+cuesheet=cuetest.cue
+cat > $cuesheet << EOF
+CATALOG 1234567890123
+FILE "blah" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 0
+ INDEX 02 10
+ INDEX 03 20
+ TRACK 02 AUDIO
+ INDEX 01 30
+ TRACK 04 AUDIO
+ INDEX 01 40
+EOF
+
+test_cue ()
+{
+ in_fmt=$1
+ out_fmt=$2
+
+ [ "$in_fmt" = wav ] || [ "$in_fmt" = aiff ] || [ "$in_fmt" = raw ] || [ "$in_fmt" = flac ] || [ "$in_fmt" = ogg ] || die "ERROR: internal error, bad 'in' format '$in_fmt'"
+
+ [ "$out_fmt" = flac ] || [ "$out_fmt" = ogg ] || die "ERROR: internal error, bad 'out' format '$out_fmt'"
+
+ if [ $in_fmt = raw ] ; then
+ eopt="$raw_eopt"
+ dopt="$raw_dopt"
+ else
+ eopt="$wav_eopt"
+ dopt="$wav_dopt"
+ fi
+
+ if [ $in_fmt = flac -o $in_fmt = ogg ] && [ $out_fmt = flac -o $out_fmt = ogg ]; then
+ CMP=md5cmp
+ else
+ CMP=cmp
+ fi
+
+ if [ $out_fmt = ogg ] ; then
+ eopt="--ogg $eopt"
+ fi
+
+ desc="($in_fmt<->$out_fmt)"
+
+ #
+ # for this we need just need just one FLAC file; --cue only works while decoding
+ #
+ run_flac $eopt --cuesheet=$cuesheet -o z50c.cue.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc"
+
+ # To make it easy to translate from cue point to sample numbers, the
+ # file has a sample rate of 10 Hz and a cuesheet like so:
+ #
+ # TRACK 01, INDEX 01 : 0:00.00 -> sample 0
+ # TRACK 01, INDEX 02 : 0:01.00 -> sample 10
+ # TRACK 01, INDEX 03 : 0:02.00 -> sample 20
+ # TRACK 02, INDEX 01 : 0:03.00 -> sample 30
+ # TRACK 04, INDEX 01 : 0:04.00 -> sample 40
+ #
+ echo $ECHO_N "testing --cue=- $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=- $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.0 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.0 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.0- $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.0- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.0- $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.1 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.1 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.1- $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.1- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.1- $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.2 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.2 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.2 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.2- $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.2- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.2- $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.4 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.4 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip20.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.4 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.4- $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.4- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip20.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.4- $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=-5.0 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=-5.0 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=-4.1 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=-4.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=-4.1 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=-3.1 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=-3.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until40.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=-3.1 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=-1.4 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=-1.4 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.until30.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=-1.4 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.0-5.0 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.0-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.0-5.0 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.1-5.0 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.1-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.1-5.0 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.2-4.1 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.2-4.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip10.until40.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.2-4.1 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ echo $ECHO_N "testing --cue=1.4-2.0 $desc... " $ECHO_C
+ run_flac $dopt -o z50c.cued.$in_fmt --cue=1.4-2.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc"
+ $CMP 50c.skip20.until30.$in_fmt z50c.cued.$in_fmt || die "ERROR: file mismatch for --cue=1.4-2.0 $desc"
+ rm -f z50c.cued.$in_fmt
+ echo OK
+
+ rm -f z50c.cue.$out_fmt
+}
+
+test_cue raw flac
+test_cue wav flac
+test_cue aiff flac
+test_cue flac flac
+#@@@if [ $has_ogg = yes ] ; then
+#@@@ #@@@ doesn't work yet because md5cmp doesn't work because metaflac doesn't work on ogg flac yet
+#@@@ test_cue ogg flac
+#@@@fi
+
+if [ $has_ogg = yes ] ; then
+ test_cue raw ogg
+ test_cue wav ogg
+ test_cue aiff ogg
+ #@@@ doesn't work yet because md5cmp doesn't work because metaflac doesn't work on ogg flac yet
+ #@@@test_cue flac ogg
+ #@@@test_cue ogg ogg
+fi
+
+############################################################################
+# test 'fixup' code that happens when a FLAC file with total_samples == 0
+# in the STREAMINFO block is converted to WAVE or AIFF, requiring the
+# decoder go back and fix up the chunk headers
+############################################################################
+
+echo $ECHO_N "WAVE fixup test... " $ECHO_C
+
+echo $ECHO_N "prepare... " $ECHO_C
+convert_to_wav noise "$raw_eopt" "$wav_dopt" || die "ERROR creating reference WAVE"
+
+echo $ECHO_N "encode... " $ECHO_C
+# the pipe from 'cat' to 'flac' does not work on cygwin because of the EOF/
+# binary-mode stdin problem, so we use an undocumented option to metaflac to
+# set the total sample count to 0
+if [ $is_win = yes ] ; then
+ run_flac $raw_eopt noise.raw -o fixup.flac || die "ERROR generating FLAC file"
+ run_metaflac --set-total-samples=0 fixup.flac 2> /dev/null
+else
+ run_flac $raw_eopt - -c < noise.raw > fixup.flac || die "ERROR generating FLAC file"
+fi
+
+echo $ECHO_N "decode... " $ECHO_C
+run_flac $wav_dopt fixup.flac -o fixup.wav || die "ERROR decoding FLAC file"
+
+echo $ECHO_N "compare... " $ECHO_C
+cmp noise.wav fixup.wav || die "ERROR: file mismatch"
+
+echo OK
+rm -f noise.wav fixup.wav fixup.flac
+
+echo $ECHO_N "AIFF fixup test... " $ECHO_C
+
+echo $ECHO_N "prepare... " $ECHO_C
+convert_to_aiff noise "$raw_eopt" "$wav_dopt" || die "ERROR creating reference AIFF"
+
+echo $ECHO_N "encode... " $ECHO_C
+# the pipe from 'cat' to 'flac' does not work on cygwin because of the EOF/
+# binary-mode stdin problem, so we use an undocumented option to metaflac to
+# set the total sample count to 0
+if [ $is_win = yes ] ; then
+ run_flac $raw_eopt noise.raw -o fixup.flac || die "ERROR generating FLAC file"
+ run_metaflac --set-total-samples=0 fixup.flac 2> /dev/null
+else
+ run_flac $raw_eopt - -c < noise.raw > fixup.flac || die "ERROR generating FLAC file"
+fi
+
+echo $ECHO_N "decode... " $ECHO_C
+run_flac $wav_dopt fixup.flac -o fixup.aiff || die "ERROR decoding FLAC file"
+
+echo $ECHO_N "compare... " $ECHO_C
+cmp noise.aiff fixup.aiff || die "ERROR: file mismatch"
+
+echo OK
+rm -f noise.aiff fixup.aiff fixup.flac
+
+
+############################################################################
+# multi-file tests
+############################################################################
+
+echo "Generating multiple input files from noise..."
+multifile_format_decode="--endian=big --sign=signed"
+multifile_format_encode="$multifile_format_decode --sample-rate=44100 --bps=16 --channels=2 --no-padding"
+short_noise_cdda_samples=$((total_noise_cdda_samples / 8))
+run_flac --verify --force --force-raw-format $multifile_format_encode --until=$short_noise_cdda_samples -o shortnoise.flac noise.raw || die "ERROR generating FLAC file"
+run_flac --decode --force shortnoise.flac -o shortnoise.raw --force-raw-format $multifile_format_decode || die "ERROR generating RAW file"
+run_flac --decode --force shortnoise.flac || die "ERROR generating WAVE file"
+run_flac --decode --force shortnoise.flac -o shortnoise.aiff || die "ERROR generating AIFF file"
+cp shortnoise.flac file0.flac
+cp shortnoise.flac file1.flac
+cp shortnoise.flac file2.flac
+rm -f shortnoise.flac
+cp shortnoise.wav file0.wav
+cp shortnoise.wav file1.wav
+cp shortnoise.wav file2.wav
+rm -f shortnoise.wav
+cp shortnoise.aiff file0.aiff
+cp shortnoise.aiff file1.aiff
+cp shortnoise.aiff file2.aiff
+rm -f shortnoise.aiff
+cp shortnoise.raw file0.raw
+cp shortnoise.raw file1.raw
+cp shortnoise.raw file2.raw
+rm -f shortnoise.raw
+
+test_multifile ()
+{
+ input_type=$1
+ streamtype=$2
+ encode_options="$3"
+
+ extra_encode_options=""
+ extra_decode_options=""
+ if [ $input_type = "raw" ] ; then
+ extra_encode_options="--force-raw-format $multifile_format_encode"
+ extra_decode_options="--force-raw-format $multifile_format_decode"
+ else
+ if [ $input_type = "aiff" ] ; then
+ extra_decode_options="--force-aiff-format"
+ fi
+ fi
+
+ if [ $streamtype = ogg ] ; then
+ suffix=oga
+ encode_options="$encode_options --ogg"
+ else
+ suffix=flac
+ fi
+
+ if [ $input_type = flac ] || [ $input_type = ogg ] ; then
+ CMP=md5cmp
+ else
+ CMP=cmp
+ fi
+
+ for n in 0 1 2 ; do
+ cp file$n.$input_type file${n}x.$input_type
+ done
+ run_flac --force $encode_options $extra_encode_options file0x.$input_type file1x.$input_type file2x.$input_type || die "ERROR"
+ run_flac --force --decode $extra_decode_options file0x.$suffix file1x.$suffix file2x.$suffix || die "ERROR"
+ for n in 0 1 2 ; do
+ $CMP file$n.$input_type file${n}x.$input_type || die "ERROR: file mismatch on file #$n"
+ done
+ for n in 0 1 2 ; do
+ rm -f file${n}x.$suffix file${n}x.$input_type
+ done
+}
+
+input_types="raw wav aiff flac"
+#@@@ doesn't work yet because md5cmp doesn't work because metaflac doesn't work on ogg flac yet
+#@@@if [ $has_ogg = yes ] ; then
+#@@@ input_types="$input_types ogg"
+#@@@fi
+for input_type in $input_types ; do
+ echo "Testing multiple $input_type files without verify..."
+ test_multifile $input_type flac ""
+
+ echo "Testing multiple $input_type files with verify..."
+ test_multifile $input_type flac "--verify"
+
+ if [ $has_ogg = yes ] ; then
+ echo "Testing multiple $input_type files with --ogg, without verify..."
+ test_multifile $input_type ogg ""
+
+ echo "Testing multiple $input_type files with --ogg, with verify..."
+ test_multifile $input_type ogg "--verify"
+
+ echo "Testing multiple $input_type files with --ogg and --serial-number, with verify..."
+ test_multifile $input_type ogg "--serial-number=321 --verify"
+ fi
+done
+
+
+############################################################################
+# test --keep-foreign-metadata
+############################################################################
+
+echo "Testing --keep-foreign-metadata..."
+
+rt_test_wav wacky1.wav '--keep-foreign-metadata'
+rt_test_wav wacky2.wav '--keep-foreign-metadata'
+rt_test_w64 wacky1.w64 '--keep-foreign-metadata'
+rt_test_w64 wacky2.w64 '--keep-foreign-metadata'
+rt_test_rf64 wacky1.rf64 '--keep-foreign-metadata'
+rt_test_rf64 wacky2.rf64 '--keep-foreign-metadata'
+
+rt_test_wav_autokf wacky1.wav '--keep-foreign-metadata'
+rt_test_wav_autokf wacky2.wav '--keep-foreign-metadata'
+rt_test_w64_autokf wacky1.w64 '--keep-foreign-metadata'
+rt_test_w64_autokf wacky2.w64 '--keep-foreign-metadata'
+rt_test_rf64_autokf wacky1.rf64 '--keep-foreign-metadata'
+rt_test_rf64_autokf wacky2.rf64 '--keep-foreign-metadata'
+
+testdatadir=${top_srcdir}/test/foreign-metadata-test-files
+
+rt_test_autokf "$testdatadir/BWF-WaveFmtEx.wav" '--keep-foreign-metadata' 'rt.wav'
+rt_test_autokf "$testdatadir/AIFF-ID3.aiff" '--keep-foreign-metadata' 'rt.aiff'
+rt_test_autokf "$testdatadir/AIFF-C-sowt-tag.aifc" '--keep-foreign-metadata' 'rt.aifc'
+rt_test_autokf "$testdatadir/AIFF-C-sowt-compression-type-name.aifc" '--keep-foreign-metadata' 'rt.aifc'
+rt_test_autokf "$testdatadir/24bit-WaveFmtPCM.wav" '--keep-foreign-metadata' 'rt.wav'
+
+############################################################################
+# test the metadata-handling properties of flac-to-flac encoding
+############################################################################
+
+echo "Testing the metadata-handling properties of flac-to-flac encoding..."
+
+testdatadir=${top_srcdir}/test/flac-to-flac-metadata-test-files
+
+filter ()
+{
+ # minor danger, changing vendor strings might change the length of the
+ # VORBIS_COMMENT block, but if we add "^ length: " to the patterns,
+ # we lose info about PADDING size that we need
+ grep -Ev '^ vendor string: |^ m..imum .....size: ' | sed -e 's/, stream_offset.*//'
+}
+flac2flac ()
+{
+ file="$testdatadir/$1"
+ case="$testdatadir/$2"
+ args="$3"
+ expect="$case-expect.meta"
+ echo $ECHO_N "$2... " $ECHO_C
+ # The 'make distcheck' target needs this.
+ chmod u+w $file
+ run_flac -f -o out.flac $args $file || die "ERROR encoding FLAC file"
+ run_metaflac --list out.flac | filter > out1.meta || die "ERROR listing metadata of output FLAC file"
+ # Ignore lengths which can be affected by the version string.
+ sed "s/length:.*/length: XXX/" out1.meta > out.meta
+ diff -q -w $expect out.meta 2>/dev/null || die "ERROR: metadata does not match expected $expect"
+ echo OK
+}
+
+#filter=', stream_offset.*|^ vendor string: |^ length: |^ m..imum .....size: '
+
+# case 00a: no alterations on a file with all metadata types, keep all metadata, in same order
+flac2flac input-SCVAUP.flac case00a ""
+# case 01a: on file with multiple PADDING blocks, they should be aggregated into one at the end
+flac2flac input-SCVPAP.flac case01a ""
+# case 01b: on file with multiple PADDING blocks and --no-padding specified, they should all be deleted
+flac2flac input-SCVPAP.flac case01b "--no-padding"
+# case 01c: on file with multiple PADDING blocks and -P specified, they should all be overwritten with -P value
+flac2flac input-SCVPAP.flac case01c "-P 1234"
+# case 01d: on file with no PADDING blocks, use -P setting
+flac2flac input-SCVA.flac case01d "-P 1234"
+# case 01e: on file with no PADDING blocks and no -P given, use default padding
+flac2flac input-SCVA.flac case01e ""
+# case 02a: on file with no VORBIS_COMMENT block, add new VORBIS_COMMENT
+flac2flac input-SCPAP.flac case02a ""
+# case 02b: on file with no VORBIS_COMMENT block and --tag, add new VORBIS_COMMENT with tags
+flac2flac input-SCPAP.flac case02b "--tag=artist=0"
+# case 02c: on file with VORBIS_COMMENT block and --tag, replace existing VORBIS_COMMENT with new tags
+flac2flac input-SCVAUP.flac case02c "--tag=artist=0"
+# case 03a: on file with no CUESHEET block and --cuesheet specified, add it
+flac2flac input-SVAUP.flac case03a "--cuesheet=$testdatadir/input0.cue"
+# case 03b: on file with CUESHEET block and --cuesheet specified, overwrite existing CUESHEET
+flac2flac input-SCVAUP.flac case03b "--cuesheet=$testdatadir/input0.cue"
+# case 03c: on file with CUESHEET block and size-changing option specified, drop existing CUESHEET
+flac2flac input-SCVAUP.flac case03c "--skip=1"
+# case 04a: on file with no SEEKTABLE block and --no-seektable specified, no SEEKTABLE
+flac2flac input-VA.flac case04a "--no-padding --no-seektable"
+# case 04b: on file with no SEEKTABLE block and -S specified, new SEEKTABLE
+flac2flac input-VA.flac case04b "--no-padding -S 5x"
+# case 04c: on file with no SEEKTABLE block and no seektable options specified, new SEEKTABLE with default points
+flac2flac input-VA.flac case04c "--no-padding"
+# case 04d: on file with SEEKTABLE block and --no-seektable specified, drop existing SEEKTABLE
+flac2flac input-SCVA.flac case04d "--no-padding --no-seektable"
+# case 04e: on file with SEEKTABLE block and -S specified, overwrite existing SEEKTABLE
+flac2flac input-SCVA.flac case04e "--no-padding -S 5x"
+# case 04f: on file with SEEKTABLE block and size-changing option specified, drop existing SEEKTABLE, new SEEKTABLE with default points
+#(already covered by case03c)
+
+############################################################################
+# test limiting minimum bitrate
+############################################################################
+
+echo $ECHO_N "Testing --limit-min-bitrate" $ECHO_C
+
+run_flac -f -o out.flac --no-padding --no-seektable --limit-min-bitrate "$testdatadir/input-VA.flac"
+size=$(wc -c < out.flac)
+
+if [ "$size" -lt "1022" ]; then
+ die "ERROR: filesize of flac file encoded with --limit-min-bitrate is smaller than expected"
+fi
+
+echo OK
+
+############################################################################
+# test overflow of total samples field in STREAMINFO
+############################################################################
+
+test_total_samples_overflow ()
+{
+ total_samples=$1
+ expected_stored_total_samples=$2
+ echo $ECHO_N "total_samples overflow test (samples=$total_samples) encode... " $ECHO_C
+ head -c $total_samples /dev/zero | run_flac --force --verify --sign=signed --sample-rate=96000 -b 16384 --channels=1 --endian=little --bps=8 -o big-$total_samples.flac - || die "ERROR"
+ echo $ECHO_N "decode... " $ECHO_C
+ run_flac -t big-$total_samples.flac || die "ERROR"
+ echo $ECHO_N "check... " $ECHO_C
+ run_metaflac --show-total-samples big-$total_samples.flac > big-$total_samples.cmp1
+ echo $expected_stored_total_samples > big-$total_samples.cmp2
+ diff -q -w big-$total_samples.cmp1 big-$total_samples.cmp2 || die "ERROR"
+ echo "OK"
+ rm -f big-$total_samples.flac big-$total_samples.cmp1 big-$total_samples.cmp2
+}
+
+if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ test_total_samples_overflow 68719476735 68719476735
+ test_total_samples_overflow 68719476736 0
+ test_total_samples_overflow 68719476737 0
+fi
+
+############################################################################
+# test handling of UTF-8 filenames
+############################################################################
+
+
+test_utf8_handling ()
+{
+ echo $ECHO_N "Test decoding from $1... " $ECHO_C
+ run_flac -d $testdatadir/$1 -o out.wav
+ if [ -f out.wav ] ; then
+ echo "OK"
+ else
+ die "Decoding failed"
+ fi
+ echo $ECHO_N "Test encoding to $1... " $ECHO_C
+ run_flac out.wav -o $1
+ if [ -f $1 ] ; then
+ echo "OK"
+ else
+ die "Encoding failed"
+ fi
+ rm -f $1 out.wav
+}
+
+if [ "$WIN32BUSYBOX" != "yes" ]; then
+ test_utf8_handling שלום.flac
+ test_utf8_handling 🤔.flac
+ test_utf8_handling Prøve.flac
+fi
+
+rm -f out.flac out.meta out1.meta
+
+#@@@ when metaflac handles ogg flac, duplicate flac2flac tests here
+
+cd ..
diff --git a/test/test_grabbag.sh b/test/test_grabbag.sh
new file mode 100755
index 0000000..6f2aca1
--- /dev/null
+++ b/test/test_grabbag.sh
@@ -0,0 +1,128 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH=../src/test_grabbag/cuesheet:$PATH
+PATH=../src/test_grabbag/picture:$PATH
+PATH=../objs/$BUILD/bin:$PATH
+
+test_cuesheet -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_cuesheet executable"
+test_picture -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_picture executable"
+
+run_test_cuesheet ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_cuesheet $*" >>test_grabbag.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_cuesheet${EXE} $* 4>>test_grabbag.valgrind.log
+ else
+ test_cuesheet${EXE} $*
+ fi
+}
+
+run_test_picture ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_picture $*" >>test_grabbag.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_picture${EXE} $* 4>>test_grabbag.valgrind.log
+ else
+ test_picture${EXE} $*
+ fi
+}
+
+########################################################################
+#
+# test_picture
+#
+########################################################################
+
+log=picture.log
+picture_dir=${top_srcdir}/test/pictures
+
+echo "Running test_picture..."
+
+rm -f $log
+
+run_test_picture $picture_dir >> $log 2>&1
+
+if [ $is_win = yes ] ; then
+ diff -w ${top_srcdir}/test/picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
+else
+ diff ${top_srcdir}/test/picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
+fi
+
+echo "PASSED (results are in $log)"
+
+########################################################################
+#
+# test_cuesheet
+#
+########################################################################
+
+log=cuesheet.log
+bad_cuesheets=${top_srcdir}/test/cuesheets/bad.*.cue
+good_cuesheets=${top_srcdir}/test/cuesheets/good.*.cue
+good_leadout=$((80 * 60 * 44100))
+bad_leadout=$((good_leadout + 1))
+
+echo "Running test_cuesheet..."
+
+rm -f $log
+
+#
+# negative tests
+#
+for cuesheet in $bad_cuesheets ; do
+ echo "NEGATIVE $cuesheet" | sed "s|${top_srcdir}/test/||" >> $log 2>&1
+ run_test_cuesheet $cuesheet $good_leadout 44100 cdda >> $log 2>&1 || exit_code=$?
+ if [ "$exit_code" = 255 ] ; then
+ die "Error: test script is broken"
+ fi
+ cuesheet_pass1=${cuesheet}.1
+ cuesheet_pass2=${cuesheet}.2
+ rm -f $cuesheet_pass1 $cuesheet_pass2
+done
+
+#
+# positive tests
+#
+for cuesheet in $good_cuesheets ; do
+ echo "POSITIVE $cuesheet" | sed "s|${top_srcdir}/test/||" >> $log 2>&1
+ run_test_cuesheet $cuesheet $good_leadout 44100 cdda >> $log 2>&1
+ exit_code=$?
+ if [ "$exit_code" = 255 ] ; then
+ die "Error: test script is broken"
+ elif [ "$exit_code" != 0 ] ; then
+ die "Error: good cuesheet is broken"
+ fi
+ cuesheet_out=$(echo $cuesheet | sed "s|${top_srcdir}/test/||")
+ cuesheet_pass1=${cuesheet_out}.1
+ cuesheet_pass2=${cuesheet_out}.2
+ diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1 || die "Error: pass1 and pass2 output differ"
+ rm -f $cuesheet_pass1 $cuesheet_pass2
+done
+
+if [ $is_win = yes ] ; then
+ diff -w ${top_srcdir}/test/cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
+else
+ diff ${top_srcdir}/test/cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
+fi
+
+echo "PASSED (results are in $log)"
diff --git a/test/test_libFLAC++.sh b/test/test_libFLAC++.sh
new file mode 100755
index 0000000..089ec16
--- /dev/null
+++ b/test/test_libFLAC++.sh
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2002-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH=../src/test_libFLAC++:$PATH
+PATH=../objs/$BUILD/bin:$PATH
+
+run_test_libFLACpp ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_libFLAC++${EXE} $* 4>>test_libFLAC++.valgrind.log
+ else
+ test_libFLAC++${EXE} $*
+ fi
+}
+
+run_test_libFLACpp "$@" || die "ERROR during test_libFLAC++"
diff --git a/test/test_libFLAC.sh b/test/test_libFLAC.sh
new file mode 100755
index 0000000..a3a1f0e
--- /dev/null
+++ b/test/test_libFLAC.sh
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH=../src/test_libFLAC:$PATH
+PATH=../objs/$BUILD/bin:$PATH
+
+run_test_libFLAC ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_libFLAC${EXE} $* 4>>test_libFLAC.valgrind.log
+ else
+ test_libFLAC${EXE} $*
+ fi
+}
+
+run_test_libFLAC "$@"|| die "ERROR during test_libFLAC"
diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh
new file mode 100755
index 0000000..b2dbee0
--- /dev/null
+++ b/test/test_metaflac.sh
@@ -0,0 +1,478 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2002-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH="$(pwd)/../src/flac:$PATH"
+PATH="$(pwd)/../src/metaflac:$PATH"
+PATH="$(pwd)/../objs/$BUILD/bin:$PATH"
+
+if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then EGREP='grep -E'
+ else EGREP='egrep'
+fi
+
+testdir="metaflac-test-files"
+flacfile="metaflac1.flac"
+
+flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
+metaflac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable"
+
+run_flac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_metaflac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} ${TOTALLY_SILENT} --no-error-on-compression-fail $* 4>>test_metaflac.valgrind.log
+ else
+ flac${EXE} ${TOTALLY_SILENT} --no-error-on-compression-fail $*
+ fi
+}
+
+run_metaflac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_metaflac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 4>>test_metaflac.valgrind.log
+ else
+ metaflac${EXE} $*
+ fi
+}
+
+run_metaflac_silent ()
+{
+ if [ -z "$SILENT" ] ; then
+ run_metaflac $*
+ else
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_metaflac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 2>/dev/null 4>>test_metaflac.valgrind.log
+ else
+ metaflac${EXE} $* 2>/dev/null
+ fi
+ fi
+}
+
+run_metaflac_to_metaflac_silent ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_metaflac.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 2>/dev/null 4>>test_metaflac.valgrind.log
+ else
+ metaflac${EXE} $1 | metaflac${EXE} $2 2>/dev/null
+ fi
+}
+
+
+check_flac ()
+{
+ run_flac --silent --test $flacfile || die "ERROR in $flacfile" 1>&2
+}
+
+echo "Generating stream..."
+bytes=80000
+if dd if=/dev/zero ibs=1 count=$bytes 2>/dev/null | flac${EXE} ${TOTALLY_SILENT} --force --verify -0 --input-size=$bytes --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=8000 - ; then
+ chmod +w $flacfile
+else
+ die "ERROR during generation"
+fi
+
+check_flac
+
+testdatadir=${top_srcdir}/test/metaflac-test-files
+
+filter ()
+{
+ # minor danger, changing vendor strings will change the length of the
+ # VORBIS_COMMENT block, but if we add "^ length: " to the patterns,
+ # we lose info about PADDING size that we need
+ # grep pattern 1: remove vendor string
+ # grep pattern 2: remove minimum/maximum frame and block size from STREAMINFO
+ # grep pattern 3: remove hexdump data from PICTURE metadata blocks
+ # sed pattern 1: remove stream offset values from SEEKTABLE points
+ $EGREP -v '^ vendor string: |^ m..imum .....size: |^ 0000[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]: ' \
+ | sed -e 's/, stream_offset.*//'
+}
+metaflac_test ()
+{
+ case="$testdatadir/$1"
+ desc="$2"
+ args="$3"
+ expect="$case-expect.meta"
+ echo $ECHO_N "test $1: $desc... " $ECHO_C
+ run_metaflac $args $flacfile | filter > $testdir/out1.meta || die "ERROR running metaflac"
+ # Ignore lengths which can be affected by the version string.
+ sed "s/length:.*/length: XXX/" $testdir/out1.meta > $testdir/out.meta
+ diff -w $expect $testdir/out.meta > /dev/null 2>&1 || die "ERROR: metadata does not match expected $expect"
+ # To blindly accept (and check later): cp -f $testdir/out.meta $expect
+ echo OK
+}
+
+metaflac_test_nofilter ()
+{
+ case="$testdatadir/$1"
+ desc="$2"
+ args="$3"
+ expect="$case-expect.meta"
+ echo $ECHO_N "test $1: $desc... " $ECHO_C
+ run_metaflac $args $flacfile > $testdir/out.meta || die "ERROR running metaflac"
+ diff -w $expect $testdir/out.meta || die "ERROR: metadata does not match expected $expect"
+ echo OK
+}
+
+metaflac_test_binary ()
+{
+ case="$testdatadir/$1"
+ desc="$2"
+ args="$3"
+ expect="$case-expect.meta"
+ echo $ECHO_N "test $1: $desc... " $ECHO_C
+ run_metaflac $args $flacfile > $testdir/out.meta || die "ERROR running metaflac"
+ cmp $expect $testdir/out.meta || die "ERROR: metadata does not match expected $expect"
+ echo OK
+}
+
+metaflac_test case00 "--list" "--list"
+
+metaflac_test case01 "STREAMINFO --show-* shortcuts" "
+ --show-md5sum
+ --show-min-blocksize
+ --show-max-blocksize
+ --show-min-framesize
+ --show-max-framesize
+ --show-sample-rate
+ --show-channels
+ --show-bps
+ --show-total-samples"
+
+run_metaflac --preserve-modtime --add-padding=12345 $flacfile
+check_flac
+metaflac_test case02 "--add-padding" "--list"
+
+# some flavors of /bin/sh (e.g. Darwin's) won't even handle quoted spaces, so we underscore:
+run_metaflac --set-tag="ARTIST=The_artist_formerly_known_as_the_artist..." $flacfile
+check_flac
+metaflac_test case03 "--set-tag=ARTIST" "--list"
+
+run_metaflac --set-tag="ARTIST=Chuck_Woolery" $flacfile
+check_flac
+metaflac_test case04 "--set-tag=ARTIST" "--list"
+
+run_metaflac --set-tag="ARTIST=Vern" $flacfile
+check_flac
+metaflac_test case05 "--set-tag=ARTIST" "--list"
+
+run_metaflac --set-tag="TITLE=He_who_smelt_it_dealt_it" $flacfile
+check_flac
+metaflac_test case06 "--set-tag=TITLE" "--list"
+
+if [ ! $git_commit_version_hash ] ; then
+ metaflac_test case07 "--show-vendor-tag --show-tag=ARTIST" "--show-vendor-tag --show-tag=ARTIST"
+else
+ echo "test case07 is skipped because version is taken from git"
+fi
+
+run_metaflac --remove-first-tag=ARTIST $flacfile
+check_flac
+metaflac_test case08 "--remove-first-tag=ARTIST" "--list"
+
+run_metaflac --remove-tag=ARTIST $flacfile
+check_flac
+metaflac_test case09 "--remove-tag=ARTIST" "--list"
+
+metaflac_test case10 "--list --block-type=VORBIS_COMMENT" "--list --block-type=VORBIS_COMMENT"
+metaflac_test case11 "--list --block-number=0" "--list --block-number=0"
+metaflac_test case12 "--list --block-number=1,2,999" "--list --block-number=1,2,999"
+metaflac_test case13 "--list --block-type=VORBIS_COMMENT,PADDING" "--list --block-type=VORBIS_COMMENT,PADDING"
+metaflac_test case14 "--list --except-block-type=SEEKTABLE,VORBIS_COMMENT" "--list --except-block-type=SEEKTABLE,VORBIS_COMMENT"
+metaflac_test case15 "--list --except-block-type=STREAMINFO" "--list --except-block-type=STREAMINFO"
+
+run_metaflac --add-padding=4321 $flacfile $flacfile
+check_flac
+metaflac_test case16 "--add-padding=4321 * 2" "--list"
+
+run_metaflac --merge-padding $flacfile
+check_flac
+metaflac_test case17 "--merge-padding" "--list"
+
+run_metaflac --add-padding=0 $flacfile
+check_flac
+metaflac_test case18 "--add-padding=0" "--list"
+
+run_metaflac --sort-padding $flacfile
+check_flac
+metaflac_test case19 "--sort-padding" "--list"
+
+run_metaflac --add-padding=0 $flacfile
+check_flac
+metaflac_test case20 "--add-padding=0" "--list"
+
+run_metaflac --remove-all-tags $flacfile
+check_flac
+metaflac_test case21 "--remove-all-tags" "--list"
+
+run_metaflac --remove --block-number=1,99 --dont-use-padding $flacfile
+check_flac
+metaflac_test case22 "--remove --block-number=1,99 --dont-use-padding" "--list"
+
+run_metaflac --remove --block-number=99 --dont-use-padding $flacfile
+check_flac
+metaflac_test case23 "--remove --block-number=99 --dont-use-padding" "--list"
+
+run_metaflac --remove --block-type=PADDING $flacfile
+check_flac
+metaflac_test case24 "--remove --block-type=PADDING" "--list"
+
+run_metaflac --remove --block-type=PADDING --dont-use-padding $flacfile
+check_flac
+metaflac_test case25 "--remove --block-type=PADDING --dont-use-padding" "--list"
+
+run_metaflac --add-padding=0 $flacfile $flacfile
+check_flac
+metaflac_test case26 "--add-padding=0 * 2" "--list"
+
+run_metaflac --remove --except-block-type=PADDING $flacfile
+check_flac
+metaflac_test case27 "--remove --except-block-type=PADDING" "--list"
+
+run_metaflac --remove-all $flacfile
+check_flac
+metaflac_test case28 "--remove-all" "--list"
+
+run_metaflac --remove-all --dont-use-padding $flacfile
+check_flac
+metaflac_test case29 "--remove-all --dont-use-padding" "--list"
+
+run_metaflac --remove-all --dont-use-padding $flacfile
+check_flac
+metaflac_test case30 "--remove-all --dont-use-padding" "--list"
+
+run_metaflac --set-tag="f=0123456789abcdefghij" $flacfile
+check_flac
+metaflac_test case31 "--set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789abcdefghi" $flacfile
+check_flac
+metaflac_test case32 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789abcde" $flacfile
+check_flac
+metaflac_test case33 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0" $flacfile
+check_flac
+metaflac_test case34 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789" $flacfile
+check_flac
+metaflac_test case35 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789abcdefghi" $flacfile
+check_flac
+metaflac_test case36 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789" $flacfile
+check_flac
+metaflac_test case37 "--remove-all-tags --set-tag=..." "--list"
+
+run_metaflac --remove-all-tags --set-tag="f=0123456789abcdefghij" $flacfile
+check_flac
+metaflac_test case38 "--remove-all-tags --set-tag=..." "--list"
+
+echo "TITLE=Tittle" | run_metaflac --import-tags-from=- $flacfile
+check_flac
+metaflac_test case39 "--import-tags-from=-" "--list"
+
+cat > vc.txt << EOF
+artist=Fartist
+artist=artits
+EOF
+run_metaflac --import-tags-from=vc.txt $flacfile
+check_flac
+metaflac_test case40 "--import-tags-from=[FILE]" "--list"
+
+rm vc.txt
+
+run_metaflac --add-replay-gain $flacfile
+check_flac
+metaflac_test case41 "--add-replay-gain" "--list"
+
+run_metaflac --remove-replay-gain $flacfile
+check_flac
+metaflac_test case42 "--remove-replay-gain" "--list"
+
+run_metaflac --scan-replay-gain $flacfile
+check_flac
+metaflac_test case42 "--scan-replay-gain" "--list"
+
+# CUESHEET blocks
+cs_in=${top_srcdir}/test/cuesheets/good.000.cue
+cs_out=metaflac.cue
+cs_out2=metaflac2.cue
+run_metaflac --import-cuesheet-from="$cs_in" $flacfile
+check_flac
+metaflac_test case43 "--import-cuesheet-from" "--list"
+run_metaflac --export-cuesheet-to=$cs_out $flacfile
+run_metaflac --remove --block-type=CUESHEET $flacfile
+check_flac
+metaflac_test case44 "--remove --block-type=CUESHEET" "--list"
+run_metaflac --import-cuesheet-from=$cs_out $flacfile
+check_flac
+metaflac_test case45 "--import-cuesheet-from" "--list"
+run_metaflac --export-cuesheet-to=$cs_out2 $flacfile
+echo "comparing cuesheets:"
+diff $cs_out $cs_out2 || die "ERROR, cuesheets should be identical"
+echo identical
+
+rm -f $cs_out $cs_out2
+
+# PICTURE blocks
+ncase=46
+for f in \
+ 0.gif \
+ 1.gif \
+ 2.gif \
+; do
+ run_metaflac --import-picture-from="|image/gif|$f||${top_srcdir}/test/pictures/$f" $flacfile
+ check_flac
+ metaflac_test "case$ncase" "--import-picture-from" "--list"
+ ncase=$((ncase + 1))
+done
+for f in \
+ 0.jpg \
+ 4.jpg \
+; do
+ run_metaflac --import-picture-from="4|image/jpeg|$f||${top_srcdir}/test/pictures/$f" $flacfile
+ check_flac
+ metaflac_test "case$ncase" "--import-picture-from" "--list"
+ ncase=$((ncase + 1))
+done
+for f in \
+ 0.png \
+ 1.png \
+ 2.png \
+ 3.png \
+ 4.png \
+ 5.png \
+ 6.png \
+ 7.png \
+ 8.png \
+; do
+ run_metaflac --import-picture-from="5|image/png|$f||${top_srcdir}/test/pictures/$f" $flacfile
+ check_flac
+ metaflac_test "case$ncase" "--import-picture-from" "--list"
+ ncase=$((ncase + 1))
+done
+[ $ncase = 60 ] || die "expected case# to be 60"
+
+fn=export-picture-check
+echo $ECHO_N "Testing --export-picture-to... " $ECHO_C
+run_metaflac --export-picture-to=$fn $flacfile
+check_flac
+cmp $fn ${top_srcdir}/test/pictures/0.gif || die "ERROR, exported picture file and original differ"
+echo OK
+rm -f $fn
+echo $ECHO_N "Testing --block-number --export-picture-to... " $ECHO_C
+run_metaflac --block-number=9 --export-picture-to=$fn $flacfile
+check_flac
+cmp $fn ${top_srcdir}/test/pictures/0.png || die "ERROR, exported picture file and original differ"
+echo OK
+rm -f $fn
+
+run_metaflac --remove --block-type=PICTURE $flacfile
+check_flac
+metaflac_test case60 "--remove --block-type=PICTURE" "--list"
+run_metaflac --import-picture-from="1|image/png|standard_icon|32x32x24|${top_srcdir}/test/pictures/0.png" $flacfile
+check_flac
+metaflac_test case61 "--import-picture-from" "--list"
+run_metaflac --import-picture-from="2|image/png|icon|64x64x24|${top_srcdir}/test/pictures/1.png" $flacfile
+check_flac
+metaflac_test case62 "--import-picture-from" "--list"
+run_metaflac --remove-all-tags-except=artist=title $flacfile
+check_flac
+metaflac_test case63 "--remove-all-tags-except=artist=title" "--list"
+metaflac_test case64 "--export-tags-to=-" "--export-tags-to=-"
+metaflac_test case64 "--show-all-tags" "--show-all-tags"
+
+run_flac ${top_srcdir}/test/foreign-metadata-test-files/AIFF-ID3.aiff --keep-foreign-metadata -f -o $flacfile
+metaflac_test_binary case65 "--data-format=binary" "--list --data-format=binary-headerless --block-type=APPLICATION:aiff"
+
+# UNKNOWN blocks
+flacfile=metaflac2.flac
+echo $ECHO_N "Testing FLAC file with unknown metadata... " $ECHO_C
+cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile
+# remove the VORBIS_COMMENT block so vendor string changes don't interfere with the comparison:
+run_metaflac --remove --block-type=VORBIS_COMMENT --dont-use-padding $flacfile
+cmp $flacfile ${top_srcdir}/test/metaflac.flac.ok || die "ERROR, $flacfile and metaflac.flac.ok differ"
+echo OK
+
+flacfile=metaflac3.flac
+cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile
+
+flacfile2=metaflac4.flac
+cp $flacfile $flacfile2
+run_metaflac --remove-all --dont-use-padding $flacfile
+
+echo $ECHO_N "Appending a streaminfo metadata block... " $ECHO_C
+if run_metaflac_to_metaflac_silent "--list --data-format=binary $flacfile2" "--append $flacfile" ; then
+ die "ERROR: it should have failed but didn't"
+else
+ echo "OK, it failed as it should"
+fi
+
+echo $ECHO_N "Appending a seektable metadata block... " $ECHO_C
+if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO $flacfile2" "--append $flacfile" ; then
+ die "ERROR: it should have failed but didn't"
+else
+ echo "OK, it failed as it should"
+fi
+
+run_metaflac --add-seekpoint=0 $flacfile
+
+echo $ECHO_N "Appending a vorbis comment metadata block... " $ECHO_C
+if run_metaflac_to_metaflac_silent "--list --data-format=binary --block-type=VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then
+ echo "OK"
+else
+ die "ERROR, couldn't add vorbis comment metadata block"
+fi
+
+echo $ECHO_N "Appending another vorbis comment metadata block... " $ECHO_C
+if run_metaflac_to_metaflac_silent "--list --data-format=binary --block-type=VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then
+ die "ERROR: it should have failed but didn't"
+else
+ echo "OK, it failed as it should"
+fi
+
+if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO,SEEKTABLE,VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then
+ :
+else
+ die "ERROR, couldn't add vorbis comment metadata block"
+fi
+
+metaflac_test_nofilter case66 "--append" "--list"
+
+if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO,SEEKTABLE,VORBIS_COMMENT $flacfile2" "--append --block-number=0 $flacfile" ; then
+ :
+else
+ die "ERROR, couldn't add vorbis comment metadata block"
+fi
+
+metaflac_test_nofilter case67 "--append --block-number=0" "--list"
+
+rm -f metaflac-test-files/out.meta metaflac-test-files/out1.meta
diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh
new file mode 100755
index 0000000..69ed993
--- /dev/null
+++ b/test/test_replaygain.sh
@@ -0,0 +1,146 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2002-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH="$(pwd)/../src/flac:$PATH"
+PATH="$(pwd)/../src/metaflac:$PATH"
+PATH="$(pwd)/../objs/$BUILD/bin:$PATH"
+
+if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then EGREP='grep -E'
+ else EGREP='egrep'
+fi
+
+testdir="metaflac-test-files"
+flacfile="replaygain.flac"
+
+run_flac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_replaygain.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac --no-error-on-compression-fail $* 4>>test_replaygain.valgrind.log
+ else
+ flac${EXE} --no-error-on-compression-fail $*
+ fi
+}
+
+run_metaflac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_replaygain.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac $* 4>>test_replaygain.valgrind.log
+ else
+ metaflac${EXE} $*
+ fi
+}
+
+run_metaflac_silent ()
+{
+ if [ -z "$SILENT" ] ; then
+ run_metaflac $*
+ else
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_replaygain.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac $* 2>/dev/null 4>>test_replaygain.valgrind.log
+ else
+ metaflac${EXE} $* 2>/dev/null
+ fi
+ fi
+}
+
+check_flac ()
+{
+ run_flac --silent --test $flacfile || die "ERROR in $flacfile" 1>&2
+}
+
+echo "Generating stream..."
+bytes=80000
+if dd if=/dev/zero ibs=1 count=$bytes 2>/dev/null | flac${EXE} --silent --force --verify -0 --input-size=$bytes --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=8000 - ; then
+ chmod +w $flacfile
+else
+ die "ERROR during generation"
+fi
+
+check_flac
+
+# Replay gain tests - Test the rates which have specific filter table entries
+# and verify that harmonics can be processed correctly.
+
+tonegenerator ()
+{
+ flac${EXE} --force --output-name=$2 --silent --no-seektable --no-error-on-compression-fail rpg-tone-$1.wav
+}
+
+REPLAYGAIN_FREQ=
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 8000/-12.73"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 11025/-12.91"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 12000/-12.98"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 16000/-13.27"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 18900/-13.41"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 22050/-13.77"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 24000/-13.82"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 28000/-14.06"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 32000/-14.08"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 36000/-14.12"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 37800/-14.18"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 44100/-14.17"
+REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 48000/-14.16:1:2:4"
+
+set -e
+
+for ACTION in $REPLAYGAIN_FREQ ; do
+ if [ -n "${ACTION##*:*}" ] ; then
+ HARMONICS=1
+ else
+ HARMONICS="${ACTION#*:}"
+ fi
+ FREQ="${ACTION%%/*}"
+ GAIN="${ACTION#*/}"
+ GAIN="${GAIN%%:*}"
+ while [ -n "$HARMONICS" ] ; do
+ MULTIPLE="${HARMONICS%%:*}"
+ if [ "$MULTIPLE" = "$HARMONICS" ] ; then
+ HARMONICS=
+ else
+ HARMONICS="${HARMONICS#*:}"
+ fi
+ RATE=$((MULTIPLE * FREQ))
+ [ $MULTIPLE -eq 1 -o -n "${REPLAYGAIN_FREQ##* $RATE/*}" ] || break
+ echo $ECHO_N "Testing FLAC replaygain $RATE ($FREQ x $MULTIPLE) ... " $ECHO_C
+ tonegenerator $RATE $flacfile
+ run_metaflac --scan-replay-gain $flacfile
+ run_metaflac --add-replay-gain $flacfile
+ run_metaflac --list $flacfile | grep "REPLAYGAIN.*GAIN=" |
+ while read -r REPLAYGAIN ; do
+ MEASUREDGAIN="${REPLAYGAIN##*=}"
+ MEASUREDGAIN="${MEASUREDGAIN%% *}"
+ if [ x"$MEASUREDGAIN" != x"$GAIN" ] ; then
+ die "ERROR, Expected $GAIN db instead of $REPLAYGAIN"
+ fi
+ done
+ echo OK
+ done
+done
+
+
+rm -f $testdir/out.flac $testdir/out.meta
+
+exit 0
diff --git a/test/test_seeking.sh b/test/test_seeking.sh
new file mode 100755
index 0000000..a00e7d1
--- /dev/null
+++ b/test/test_seeking.sh
@@ -0,0 +1,141 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2004-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH=../src/flac:$PATH
+PATH=../src/metaflac:$PATH
+PATH=../src/test_seeking:$PATH
+PATH=../src/test_streams:$PATH
+PATH=../objs/$BUILD/bin:$PATH
+
+if [ -z "$FLAC__TEST_LEVEL" ] ; then
+ FLAC__TEST_LEVEL=1
+fi
+
+flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
+metaflac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable"
+
+run_flac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_seeking.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac${EXE} --no-error-on-compression-fail $* 4>>test_seeking.valgrind.log
+ else
+ flac${EXE} --no-error-on-compression-fail $*
+ fi
+}
+
+run_metaflac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_seeking.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 4>>test_seeking.valgrind.log
+ else
+ metaflac${EXE} $*
+ fi
+}
+
+run_test_seeking ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 test_seeking $*" >>test_seeking.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_seeking $* 4>>test_seeking.valgrind.log
+ else
+ test_seeking${EXE} $*
+ fi
+}
+
+echo $ECHO_N "Checking for --ogg support in flac ... " $ECHO_C
+if flac${EXE} --ogg --no-error-on-compression-fail --silent --force-raw-format --endian=little --sign=signed --channels=1 --bps=8 --sample-rate=44100 -c $0 1>/dev/null 2>&1 ; then
+ has_ogg=yes;
+else
+ has_ogg=no;
+fi
+echo ${has_ogg}
+
+echo "Generating streams..."
+if [ ! -f noise.raw ] ; then
+ test_streams || die "ERROR during test_streams"
+fi
+
+echo "generating FLAC files for seeking:"
+run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 -S- --output-name=tiny.flac noise8m32.raw || die "ERROR generating FLAC file"
+run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 -S- --output-name=small.flac noise.raw || die "ERROR generating FLAC file"
+run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 -S10x --output-name=tiny-s.flac noise8m32.raw || die "ERROR generating FLAC file"
+run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 -S10x --output-name=small-s.flac noise.raw || die "ERROR generating FLAC file"
+
+tiny_samples="$(metaflac${EXE} --show-total-samples tiny.flac)"
+small_samples="$(metaflac${EXE} --show-total-samples small.flac)"
+
+tiny_seek_count=100
+if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ small_seek_count=10000
+else
+ small_seek_count=100
+fi
+
+for suffix in '' '-s' ; do
+ echo "testing tiny$suffix.flac:"
+ if run_test_seeking tiny$suffix.flac $tiny_seek_count $tiny_samples noise8m32.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+
+ echo "testing small$suffix.flac:"
+ if run_test_seeking small$suffix.flac $small_seek_count $small_samples noise.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+
+ echo "removing sample count from tiny$suffix.flac and small$suffix.flac:"
+ if run_metaflac --no-filename --set-total-samples=0 tiny$suffix.flac small$suffix.flac ; then : ; else
+ die "ERROR: during metaflac"
+ fi
+
+ echo "testing tiny$suffix.flac with total_samples=0:"
+ if run_test_seeking tiny$suffix.flac $tiny_seek_count $tiny_samples noise8m32.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+
+ echo "testing small$suffix.flac with total_samples=0:"
+ if run_test_seeking small$suffix.flac $small_seek_count $small_samples noise.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+done
+
+if [ $has_ogg = "yes" ] ; then
+
+ echo "generating Ogg FLAC files for seeking:"
+ run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.oga --ogg noise8m32.raw || die "ERROR generating Ogg FLAC file"
+ run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.oga --ogg noise.raw || die "ERROR generating Ogg FLAC file"
+ # seek tables are not used in Ogg FLAC
+
+ echo "testing tiny.oga:"
+ if run_test_seeking tiny.oga $tiny_seek_count $tiny_samples noise8m32.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+
+ echo "testing small.oga:"
+ if run_test_seeking small.oga $small_seek_count $small_samples noise.raw ; then : ; else
+ die "ERROR: during test_seeking"
+ fi
+
+fi
+
+rm -f tiny.flac tiny.oga small.flac small.oga tiny-s.flac small-s.flac
diff --git a/test/test_streams.sh b/test/test_streams.sh
new file mode 100755
index 0000000..22dd747
--- /dev/null
+++ b/test/test_streams.sh
@@ -0,0 +1,331 @@
+#!/bin/sh -e
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001-2009 Josh Coalson
+# Copyright (C) 2011-2023 Xiph.Org Foundation
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under different licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+. ./common.sh
+
+PATH=../src/flac:$PATH
+PATH=../src/test_streams:$PATH
+PATH=../objs/$BUILD/bin:$PATH
+
+if [ -z "$FLAC__TEST_LEVEL" ] ; then
+ FLAC__TEST_LEVEL=1
+fi
+
+flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable"
+
+run_flac ()
+{
+ if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then
+ echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 flac $*" >>test_streams.valgrind.log
+ valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 flac --no-error-on-compression-fail $* 4>>test_streams.valgrind.log
+ else
+ flac${EXE} --no-error-on-compression-fail $*
+ fi
+}
+
+echo "Generating streams..."
+if [ ! -f wacky1.wav ] ; then
+ test_streams || die "ERROR: missing files"
+fi
+
+#
+# single-file test routines
+#
+
+test_file ()
+{
+ name=$1
+ channels=$2
+ bps=$3
+ encode_options="$4"
+
+ echo $ECHO_N "$name (--channels=$channels --bps=$bps $encode_options): encode..." $ECHO_C
+ cmd="run_flac --verify --silent --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding $name.raw"
+ echo "### ENCODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 2>>./streams.log || die "ERROR during encode of $name"
+
+ echo $ECHO_N "decode..." $ECHO_C
+ cmd="run_flac --silent --force --endian=little --sign=signed --decode --force-raw-format --output-name=$name.cmp $name.flac"
+ echo "### DECODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 2>>./streams.log || die "ERROR during decode of $name"
+
+ ls -1l $name.raw >> ./streams.log
+ ls -1l $name.flac >> ./streams.log
+ ls -1l $name.cmp >> ./streams.log
+
+ echo $ECHO_N "compare..." $ECHO_C
+ cmp $name.raw $name.cmp || die "ERROR during compare of $name"
+
+ echo OK
+}
+
+test_file_piped ()
+{
+ name=$1
+ channels=$2
+ bps=$3
+ encode_options="$4"
+
+ if [ "$(env | grep -ic '^comspec=')" != 0 ] ; then
+ is_win=yes
+ else
+ is_win=no
+ fi
+
+ echo $ECHO_N "$name: encode via pipes..." $ECHO_C
+ if [ $is_win = yes ] ; then
+ cmd="run_flac --verify --silent --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding --stdout $name.raw"
+ echo "### ENCODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 1>$name.flac 2>>./streams.log || die "ERROR during encode of $name"
+ else
+ cmd="run_flac --verify --silent --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding --stdout -"
+ echo "### ENCODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd < $name.raw 1>$name.flac 2>>./streams.log || die "ERROR during encode of $name"
+ fi
+ echo $ECHO_N "decode via pipes..." $ECHO_C
+ if [ $is_win = yes ] ; then
+ cmd="run_flac --silent --force --endian=little --sign=signed --decode --force-raw-format --stdout $name.flac"
+ echo "### DECODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 1>$name.cmp 2>>./streams.log || die "ERROR during decode of $name"
+ else
+ cmd="run_flac --silent --force --endian=little --sign=signed --decode --force-raw-format --stdout -"
+ echo "### DECODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd < $name.flac 1>$name.cmp 2>>./streams.log || die "ERROR during decode of $name"
+ fi
+ ls -1l $name.raw >> ./streams.log
+ ls -1l $name.flac >> ./streams.log
+ ls -1l $name.cmp >> ./streams.log
+
+ echo $ECHO_N "compare..." $ECHO_C
+ cmp $name.raw $name.cmp || die "ERROR during compare of $name"
+
+ echo OK
+}
+
+test_corrupted_file ()
+{
+ name=$1
+ channels=$2
+ bps=$3
+ encode_options="$4"
+
+ echo $ECHO_N "$name (--channels=$channels --bps=$bps $encode_options): encode..." $ECHO_C
+ cmd="run_flac --verify --silent --no-padding --force --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --no-padding $name.raw"
+ echo "### ENCODE $name #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 2>>./streams.log || die "ERROR during encode of $name"
+
+ filesize=$(wc -c < $name.flac)
+ bs=$((filesize/13))
+
+ # Overwrite with 'garbagegarbagegarbage....'
+ yes garbage 2>/dev/null | dd of=$name.flac conv=notrunc bs=$bs seek=1 count=2 2>> ./streams.log
+ # Overwrite with 0x00
+ dd if=/dev/zero of=$name.flac conv=notrunc bs=$bs seek=4 count=2 2>> ./streams.log
+ # Overwrite with 0xFF
+ tr '\0' '\377' < /dev/zero | dd of=$name.flac conv=notrunc bs=$bs seek=7 count=2 2>> ./streams.log
+ # Remove section
+ cp $name.flac $name.tmp.flac
+ dd if=$name.tmp.flac of=$name.flac bs=$bs skip=12 seek=10 2>> ./streams.log
+
+ echo $ECHO_N "decode..." $ECHO_C
+ cmd="run_flac --silent --decode-through-errors --force --endian=little --sign=signed --decode --force-raw-format --output-name=$name.cmp $name.flac"
+ echo "### DECODE $name.corrupt #######################################################" >> ./streams.log
+ echo "### cmd=$cmd" >> ./streams.log
+ $cmd 2>>./streams.log || die "ERROR during decode of $name"
+
+ ls -1l $name.raw >> ./streams.log
+ ls -1l $name.flac >> ./streams.log
+ ls -1l $name.cmp >> ./streams.log
+
+ echo $ECHO_N "compare..." $ECHO_C
+ if [ "$(wc -c < $name.raw)" -ne "$(wc -c < $name.cmp)" ]; then
+ die "ERROR, length of decoded file not equal to length of original"
+ fi
+
+ echo OK
+}
+
+if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ max_lpc_order=32
+else
+ max_lpc_order=16
+fi
+
+echo "Testing noise through pipes..."
+test_file_piped noise 1 8 "-0"
+
+echo "Testing small files..."
+test_file test01 1 16 "-0 -l $max_lpc_order --lax -m -e -p"
+test_file test02 2 16 "-0 -l $max_lpc_order --lax -m -e -p"
+test_file test03 1 16 "-0 -l $max_lpc_order --lax -m -e -p"
+test_file test04 2 16 "-0 -l $max_lpc_order --lax -m -e -p"
+
+for bps in 8 16 24 32 ; do
+ echo "Testing $bps-bit full-scale deflection streams..."
+ for b in 01 02 03 04 05 06 07 ; do
+ test_file fsd$bps-$b 1 $bps "-0 -l $max_lpc_order --lax -m -e -p"
+ done
+done
+
+echo "Testing 16-bit wasted-bits-per-sample streams..."
+for b in 01 ; do
+ test_file wbps16-$b 1 16 "-0 -l $max_lpc_order --lax -m -e -p"
+done
+
+for bps in 8 16 24 32; do
+ echo "Testing $bps-bit sine wave streams..."
+ for b in 00 ; do
+ test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order --lax -m -e --sample-rate=48000"
+ done
+ for b in 01 ; do
+ test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order --lax -m -e --sample-rate=96000"
+ done
+ for b in 02 03 04 ; do
+ test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order --lax -m -e"
+ done
+ for b in 10 11 ; do
+ test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order --lax -m -e --sample-rate=48000"
+ done
+ for b in 12 ; do
+ test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order --lax -m -e --sample-rate=96000"
+ done
+ for b in 13 14 15 16 17 18 19 ; do
+ test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order --lax -m -e"
+ done
+done
+
+echo "Testing blocksize variations..."
+for disable in '' '--disable-verbatim-subframes --disable-constant-subframes' '--disable-verbatim-subframes --disable-constant-subframes --disable-fixed-subframes' ; do
+ for blocksize in 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
+ for lpc_order in 0 1 2 3 4 5 7 8 9 15 16 17 31 32 ; do
+ if [ $lpc_order = 0 ] || [ $lpc_order -le $blocksize ] ; then
+ test_file noise8m32 1 8 "-8 -p -e -l $lpc_order --lax --blocksize=$blocksize $disable"
+ fi
+ done
+ done
+done
+
+echo "Testing blocksize variations with subdivide apodization..."
+for blocksize in 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
+ for lpc_order in 0 1 2 3 4 5 7 8 9 15 16 17 31 32 ; do
+ if [ $lpc_order = 0 ] || [ $lpc_order -le $blocksize ] ; then
+ test_file noise8m32 1 8 "-8 -p -e -A \"subdivide_tukey(32)\" -l $lpc_order --lax --blocksize=$blocksize"
+ fi
+ done
+done
+
+echo "Testing some frame header variations..."
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax -b $max_lpc_order"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax -b 65535"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=9"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90000"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=9"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90"
+test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90000"
+
+echo "Testing option variations..."
+for f in 00 01 02 03 04 ; do
+ for disable in '' '--disable-verbatim-subframes --disable-constant-subframes' '--disable-verbatim-subframes --disable-constant-subframes --disable-fixed-subframes' ; do
+ if [ -z "$disable" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ for opt in 0 1 2 4 5 6 8 ; do
+ for extras in '' '-p' '-e' ; do
+ if [ -z "$extras" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ test_file sine16-$f 1 16 "-$opt $extras $disable"
+ fi
+ done
+ done
+ if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ test_file sine16-$f 1 16 "-b 16384 -m -r 8 -l $max_lpc_order --lax -e -p $disable"
+ fi
+ fi
+ done
+done
+
+for f in 10 11 12 13 14 15 16 17 18 19 ; do
+ for disable in '' '--disable-verbatim-subframes --disable-constant-subframes' '--disable-verbatim-subframes --disable-constant-subframes --disable-fixed-subframes' ; do
+ if [ -z "$disable" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ for opt in 0 1 2 4 5 6 8 ; do
+ for extras in '' '-p' '-e' ; do
+ if [ -z "$extras" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ test_file sine16-$f 2 16 "-$opt $extras $disable"
+ fi
+ done
+ done
+ if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ test_file sine16-$f 2 16 "-b 16384 -m -r 8 -l $max_lpc_order --lax -e -p $disable"
+ fi
+ fi
+ done
+done
+
+echo "Testing corruption handling..."
+for bps in 8 16 24 ; do
+ for f in 00 01 02 03 04 10 11 12 13 14 15 16 17 18 19; do
+ for disable in '' '--disable-verbatim-subframes --disable-constant-subframes' '--disable-verbatim-subframes --disable-constant-subframes --disable-fixed-subframes' ; do
+ if [ -z "$disable" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ for opt in 0 1 2 4 5 6 8 ; do
+ for extras in '' '-p' '-e' ; do
+ if [ -z "$extras" -o "$FLAC__TEST_LEVEL" -gt 0 ] && { [ "$bps" -eq 16 -a "$f" -lt 15 ] || [ "$FLAC__TEST_LEVEL" -gt 1 ]; } ; then
+ if [ "$f" -lt 10 ] ; then
+ test_corrupted_file sine$bps-$f 1 $bps "-$opt $extras $disable"
+ else
+ test_corrupted_file sine$bps-$f 2 $bps "-$opt $extras $disable"
+ fi
+ fi
+ done
+ done
+ fi
+ done
+ done
+done
+
+echo "Testing noise..."
+for disable in '' '--disable-verbatim-subframes --disable-constant-subframes' '--disable-verbatim-subframes --disable-constant-subframes --disable-fixed-subframes' ; do
+ if [ -z "$disable" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ for channels in 1 2 4 8 ; do
+ if [ $channels -le 2 ] || [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ for bps in 8 16 24 32; do
+ for opt in 0 1 2 3 4 5 6 7 8 ; do
+ for extras in '' '-p' '-e' ; do
+ if { [ -z "$extras" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ]; } && { [ "$extras" != '-p' ] || [ "$opt" -gt 2 ]; } ; then
+ for blocksize in '' '--lax -b 32' '--lax -b 32768' '--lax -b 65535' ; do
+ if [ -z "$blocksize" ] || [ "$FLAC__TEST_LEVEL" -gt 0 ] ; then
+ test_file noise $channels $bps "-$opt $extras $blocksize $disable"
+ fi
+ done
+ fi
+ done
+ done
+ if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
+ test_file noise $channels $bps "-b 16384 -m -r 8 -l $max_lpc_order --lax -e -p $disable"
+ fi
+ done
+ fi
+ done
+ fi
+done
diff --git a/test/write_iff.pl b/test/write_iff.pl
new file mode 100755
index 0000000..f9efa74
--- /dev/null
+++ b/test/write_iff.pl
@@ -0,0 +1,211 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+require Math::BigInt;
+
+my $usage = "
+$0 <format> <bps> <channels> <sample-rate> <#samples> <sample-type>
+
+ <format> is one of aiff,wave,wave64,rf64
+ <bps> is 8,16,24,32
+ <channels> is 1-8
+<sample-rate> is any 32-bit value
+ <#samples> is 0-2^64-1
+<sample-type> is one of zero,rand
+
+";
+
+die $usage unless @ARGV == 6;
+
+my %formats = ( 'aiff'=>1, 'wave'=>1, 'wave64'=>1, 'rf64'=>1 );
+my %sampletypes = ( 'zero'=>1, 'rand'=>1 );
+my @channelmask = ( 0, 1, 3, 7, 0x33, 0x607, 0x60f, 0, 0 ); #@@@@@@ need proper masks for 7,8
+
+my ($format, $bps, $channels, $samplerate, $samples, $sampletype) = @ARGV;
+my $bigsamples = new Math::BigInt $samples;
+
+die $usage unless defined $formats{$format};
+die $usage unless $bps == 8 || $bps == 16 || $bps == 24 || $bps == 32;
+die $usage unless $channels >= 1 && $channels <= 8;
+die $usage unless $samplerate >= 0 && $samplerate <= 4294967295;
+die $usage unless defined $sampletypes{$sampletype};
+
+# convert bits-per-sample to bytes-per-sample
+$bps /= 8;
+
+my $datasize = $samples * $bps * $channels;
+my $bigdatasize = $bigsamples * $bps * $channels;
+
+my $padding = int($bigdatasize & 1); # for aiff/wave/rf64 chunk alignment
+my $padding8 = 8 - int($bigdatasize & 7); $padding8 = 0 if $padding8 == 8; # for wave64 alignment
+# wave-ish file needs to be WAVEFORMATEXTENSIBLE?
+my $wavx = ($format eq 'wave' || $format eq 'wave64' || $format eq 'rf64') && ($channels > 2 || ($bps != 8 && $bps != 16));
+
+# write header
+
+if ($format eq 'aiff') {
+ die "sample data too big for format\n" if 46 + $datasize + $padding > 4294967295;
+ # header
+ print "FORM";
+ print pack('N', 46 + $datasize + $padding);
+ print "AIFF";
+ # COMM chunk
+ print "COMM";
+ print pack('N', 18); # chunk size = 18
+ print pack('n', $channels);
+ print pack('N', $samples);
+ print pack('n', $bps * 8);
+ print pack_sane_extended($samplerate);
+ # SSND header
+ print "SSND";
+ print pack('N', $datasize + 8); # chunk size
+ print pack('N', 0); # ssnd_offset_size
+ print pack('N', 0); # blocksize
+}
+elsif ($format eq 'wave' || $format eq 'wave64' || $format eq 'rf64') {
+ die "sample data too big for format\n" if $format eq 'wave' && ($wavx?60:36) + $datasize + $padding > 4294967295;
+ # header
+ if ($format eq 'wave') {
+ print "RIFF";
+ # +4 for WAVE
+ # +8+{40,16} for fmt chunk
+ # +8 for data chunk header
+ print pack('V', 4 + 8+($wavx?40:16) + 8 + $datasize + $padding);
+ print "WAVE";
+ }
+ elsif ($format eq 'wave64') {
+ # RIFF GUID 66666972-912E-11CF-A5D6-28DB04C10000
+ print "\x72\x69\x66\x66\x2E\x91\xCF\x11\xD6\xA5\x28\xDB\x04\xC1\x00\x00";
+ # +(16+8) for RIFF GUID + size
+ # +16 for WAVE GUID
+ # +16+8+{40,16} for fmt chunk
+ # +16+8 for data chunk header
+ my $bigriffsize = $bigdatasize + (16+8) + 16 + 16+8+($wavx?40:16) + (16+8) + $padding8;
+ print pack_64('V', $bigriffsize);
+ # WAVE GUID 65766177-ACF3-11D3-8CD1-00C04F8EDB8A
+ print "\x77\x61\x76\x65\xF3\xAC\xD3\x11\xD1\x8C\x00\xC0\x4F\x8E\xDB\x8A";
+ }
+ else {
+ print "RF64";
+ print pack('V', 0xffffffff);
+ print "WAVE";
+ # ds64 chunk
+ print "ds64";
+ print pack('V', 28); # chunk size
+ # +4 for WAVE
+ # +(8+28) for ds64 chunk
+ # +8+{40,16} for fmt chunk
+ # +8 for data chunk header
+ my $bigriffsize = $bigdatasize + 4 + (8+28) + 8+($wavx?40:16) + 8 + $padding;
+ print pack_64('V', $bigriffsize);
+ print pack_64('V', $bigdatasize);
+ print pack_64('V', $bigsamples);
+ print pack('V', 0); # table size
+ }
+ # fmt chunk
+ if ($format ne 'wave64') {
+ print "fmt ";
+ print pack('V', $wavx?40:16); # chunk size
+ }
+ else { # wave64
+ # fmt GUID 20746D66-ACF3-11D3-8CD1-00C04F8EDB8A
+ print "\x66\x6D\x74\x20\xF3\xAC\xD3\x11\xD1\x8C\x00\xC0\x4F\x8E\xDB\x8A";
+ print pack('V', 16+8+($wavx?40:16)); # chunk size (+16+8 for GUID and size fields)
+ print pack('V', 0); # ...is 8 bytes for wave64
+ }
+ print pack('v', $wavx?65534:1); # compression code
+ print pack('v', $channels);
+ print pack('V', $samplerate);
+ print pack('V', $samplerate * $channels * $bps);
+ print pack('v', $channels * $bps); # block align = channels*((bps+7)/8)
+ print pack('v', $bps * 8); # bits per sample = ((bps+7)/8)*8
+ if ($wavx) {
+ print pack('v', 22); # cbSize
+ print pack('v', $bps * 8); # validBitsPerSample
+ print pack('V', $channelmask[$channels]);
+ # GUID = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
+ print "\x01\x00\x00\x00\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71";
+ }
+ # data header
+ if ($format ne 'wave64') {
+ print "data";
+ print pack('V', $format eq 'wave'? $datasize : 0xffffffff);
+ }
+ else { # wave64
+ # data GUID 61746164-ACF3-11D3-8CD1-00C04F8EDB8A
+ print "\x64\x61\x74\x61\xF3\xAC\xD3\x11\xD1\x8C\x00\xC0\x4F\x8E\xDB\x8A";
+ print pack_64('V', $bigdatasize+16+8); # +16+8 for GUID and size fields
+ }
+}
+else {
+ die;
+}
+
+# write sample data
+
+if ($sampletype eq 'zero') {
+ my $chunk = 4096;
+ my $buf = pack("x[".($channels*$bps*$chunk)."]");
+ for (my $s = $samples; $s > 0; $s -= $chunk) {
+ if ($s < $chunk) {
+ print substr($buf, 0, $channels*$bps*$s);
+ }
+ else {
+ print $buf;
+ }
+ }
+}
+elsif ($sampletype eq 'rand') {
+ for (my $s = 0; $s < $samples; $s++) {
+ for (my $c = 0; $c < $channels; $c++) {
+ for (my $b = 0; $b < $bps; $b++) {
+ print pack('C', int(rand(256)));
+ }
+ }
+ }
+}
+else {
+ die;
+}
+
+# write padding
+if ($format eq 'wave64') {
+ print pack("x[$padding8]") if $padding8;
+}
+else {
+ print "\x00" if $padding;
+}
+
+exit 0;
+
+sub pack_sane_extended
+{
+ my $val = shift;
+ die unless $val > 0;
+ my $shift;
+ for ($shift = 0; ($val>>(31-$shift)) == 0; ++$shift) {
+ }
+ $val <<= $shift;
+ my $exponent = 63 - ($shift + 32);
+ return pack('nNN', $exponent + 16383, $val, 0);
+}
+
+sub pack_64
+{
+ my $c = shift; # 'N' for big-endian, 'V' for little-endian, ala pack()
+ my $v1 = shift; # value, must be Math::BigInt
+ my $v2 = $v1->copy();
+ if ($c eq 'V') {
+ $v1->band(0xffffffff);
+ $v2->brsft(32);
+ }
+ elsif ($c eq 'N') {
+ $v2->band(0xffffffff);
+ $v1->brsft(32);
+ }
+ else {
+ die;
+ }
+ return pack("$c$c", 0+$v1->bstr(), 0+$v2->bstr());
+}