When writing a FLAC file with over 2^36 samples, the total samples
entry in streaminfo will overflow and wrap around. Setting it to 0
(which means unknown number of samples) makes sure the decoder
doesn't rely on this number
Co-authored-by: Ralph Giles <giles@thaumas.net>
With this commit, it is possible to run the full test suite on
Windows machines when busybox-w32 is installed. This program is
available through chocolatey with 'choco install busybox'
CMake tests for availability of busybox and use if available. As
chocolatey is the preferred method of fetching software for
Github actions, this commit paves the way for running the full
test suite on Windows for CI
The main test harnesses are written in unix shell script, so
they don't work on windows. A stanza was added to the cmake
config to skip all tests there to get a green build.
This is misleading, since no testing was done at all on Windows.
Instead, construct a separate set of tests on non-unix platforms,
calling the two api test programs, which of necessity are
compiled executables. Also invoke the two front-end programs
with just the --help switch to verify they at least start.
Thanks to Marcus Asteborg for the suggestion.
When decoding to WAV, the legacy wFormatTag of WAVE_FORMAT_PCM should
only be used if the bitwidth is 8 or 16. For all other bitwidths,
use WAVEFORMATEXTENSIBLE.
Two of the test programs/scripts also needed updating.
With this change, flac now accepts cuesheets where the ISRC field is
enclosed in double quotes. Added a test for this as well.
Closes: https://sourceforge.net/p/flac/bugs/436/
* test_bin.sh looks like it was a personal use script for the original
developer Josh Coalson and referenced directories outside the actual
repository.
* test_wrapper.sh was trivial and un-used.
An output file was being set to read only and hence could not be
overwritten by a later test. Not sure why this only affected the
'make distcheck' target.
* Pipe un-needed strerr output to /dev/null.
* Pass --silent and --no-seektable to the flac executable.
* When generating tones, use --output-name=....
Jan Stary reported that on OpenBSD bash isn't located in /bin/
which means that the test fail. He also noted that there didn't
seem to be anything bash specific in the tests.
This patch takes some suggestions from Jan, plus a few fixes tested
on Debian using the bin/sh provided by bash and dash.
Suggested-by: Jan Stary <hans@stare.cz>
On Mac OSX, the 'wc -c' command returns a number with leading whitespace
which then results in a syntax error when the shell parser expects a
number when it really has a string containing a number. The easy fix is
to use string interpolation.
Closes: https://sourceforge.net/p/flac/bugs/420/
Reported-by: Mark Harris <mark.hsj@gmail.com>
The retune of compression levels makes this test fail. This is due
to a few approximations used in the encoder that determine which
LP coefficient should result in the smallest file. Differences are
usually very small, but in my case this resulted in compression
level 6 giving a 3 byte bigger file.
This patch lets the compression test pass even if the a compression
level results in a file that is up to 10 byte larger than the
previous level
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>