Commit Graph

501 Commits

Author SHA1 Message Date
Erik de Castro Lopo
5d4d1feca0 Remove redundant libsndfile.def.in 2017-10-31 18:42:40 +11:00
Erik de Castro Lopo
9b4fdaccc1 tests/header_test.tpl: Fix a memory leak
Found using AddressSanitizer.
2017-10-26 19:21:06 +11:00
David Seifert
b17f14d613 Make git checkout buildable out-of-tree
Currently, libsndfile requires in-tree bootstrapping and creation
of the tarball. For Gentoo, some users might want to build the
latest git checkout. This commit makes out-of-tree building of all
the necessary dependencies possible.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-10-08 18:23:58 +11:00
Erik de Castro Lopo
cc5e831a75 A couple of minor cstyle fixes 2017-10-01 16:33:41 +11:00
David Seifert
e6c42ff027 Make build system completely non-recursive 2017-09-26 19:35:56 +10:00
Erik de Castro Lopo
beee21e5c2 Revert "tests/Makefile.am: Switch away from GNU make rules"
This reverts commit ff26310437.

The GNU make rules actually work. The old style suffix rules do not.
2017-08-10 20:22:18 +10:00
Henner Zeller
f96e5a2047 Add test for flac regression update-header-before-write
Explicitly writing the header with SFC_UPDATE_HEADER_NOW before
the first sf_write() was making sf_write() calls fail. This is a
test to verify that the fix works.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-08-10 20:09:55 +10:00
Erik de Castro Lopo
9923b2a0a2 src/aiff.c: Remove INST chunk writing
This code had egregious errors in the way things were being passed
to psf_binheader_writef and neither the compiler nor the tests
caught it. It was however found when adding safety macros to enforce
correct type being passed to psf_binheader_writef.
2017-05-16 21:03:22 +10:00
evpobr
44269a0892 Tests: Fix win32_ordinal_test 2017-05-06 01:55:14 +10:00
Erik de Castro Lopo
b506de463d Fix MSAN errors
Fix multiple errors uncovered by Clang's Memory Sanitizer.

Closes: https://github.com/erikd/libsndfile/issues/248
2017-05-04 18:42:24 +10:00
Erik de Castro Lopo
cecc9a7498 RF64 tweaks
* Comments.
* Improve the `rf64_long_file_downgrade_test` test.
2017-04-18 20:07:10 +10:00
Erik de Castro Lopo
ff26310437 tests/Makefile.am: Switch away from GNU make rules
Avoid `'%'-style pattern rules are a GNU make extension` warnings.
2017-04-16 19:58:15 +10:00
Erik de Castro Lopo
bf83b95fd9 RF64: Fix an RF64_AUTO_DOWNGRADE bug
Also add a test for this. The test is disabled by default because it
needs to write a 4 Gig file.

Closes: https://github.com/erikd/libsndfile/issues/238
2017-04-16 19:11:45 +10:00
evpobr
a3287d88eb tests: Fix typos in fixes for MSVC
* src/test_main.c: Fix typo in HAVE_SYS_TYPES_H definition
* tests/win32_ordinal_test.c: Use correct "direct.h" header instead of "dirent.h"

Related: https://github.com/erikd/libsndfile/issues/154, https://github.com/erikd/libsndfile/pull/234
2017-04-15 07:45:45 +10:00
Erik de Castro Lopo
197ceb315b tests/Makefile.am: Another fix for autogen file rules
For Make to do its stuff, there needs to be a rule to make both the
`*.h` file and the `*.c` file.
2017-04-14 17:30:37 +10:00
Erik de Castro Lopo
7f7fc24dc3 Fix 'make distcheck'
* tests/pedantic-header-test.sh.in:
  Commit 58737ceb48 started using "sfconfig.h" in the test files,
  which made this test script fail.

* .travis.yaml:
  Add `distcheck` that so PRs are checked.
2017-04-14 16:10:45 +10:00
evpobr
58737ceb48 tests: Fixes for MSVC
* src/test_main.c: Fix undeclared off_t type with MSVC
* tests/misc_test.c: Fix undefined S_ISCHR & S_ISBLK with MSVC
* tests/stdin_test.c: Fix undefined STDIN_FILENO with MSVC
* tests/win32_ordinal_test.c: Fix undeclared getcwd() with MSVC
* Fix missing unistd.h under Win32

Related: https://github.com/erikd/libsndfile/issues/154
2017-04-14 13:03:27 +10:00
Erik de Castro Lopo
261a0dd489 tests/Makefile.am : Fix rules for autogen-ed files
Previously, the `*.c` file was only being rebuilt if the `*.def`
file was changed and not if the `*.tpl` file was changed.
2017-04-14 11:23:44 +10:00
Erik de Castro Lopo
5bcfd5ff0a Include sfconfig.h as needed 2017-04-03 18:54:49 +10:00
Erik de Castro Lopo
798c285506 tests/write_read_test.tpl: Fix function name 2017-04-02 17:43:22 +10:00
Erik de Castro Lopo
6bbd5a9caf tests: Don't use /tmp for temporary files
When the program is run under American Fuzzy Lop, writing to
/tmp/ fails.
2017-03-26 13:04:51 +11:00
Erik de Castro Lopo
8dc7478ee7 tests/error_test.c: Fix uninitialized value error
The `SF_INFO` struct was not initialized before being passed to
`sf_open`.

Closes: https://github.com/erikd/libsndfile/issues/209
2017-03-21 18:35:12 +11:00
Erik de Castro Lopo
3b45c061d2 src/sndfile.c: Check return of write_header()
For some formats (like FLAC) the headers are written *just* before
the first bit of audio data. Until now, there was not check for that
the header write function returned zero.

Test included.
2017-01-30 21:48:56 +11:00
David Seifert
1bfb5a908f Refactor generation of test-suite
It's more preferable to generate the testsuite when running 'make dist'
or 'make distcheck' instead of running it from the configure script.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-01-28 21:16:21 +11:00
Erik de Castro Lopo
4a171f8f5f tests/write_read_test.tpl: One more check 2016-12-11 20:14:57 +11:00
Erik de Castro Lopo
0818c1685e tests/chunk_test.c: Add test for large free chunks 2016-11-27 20:02:06 +11:00
Erik de Castro Lopo
1d7b55b483 tests/chunk_test.c: Add wav_subchunk_test 2016-11-09 06:46:07 +11:00
Erik de Castro Lopo
08dfe89c61 tests: Remove need for POSIX truncate function
Windows doesn't have `truncate` and since it was only being used
to truncate the file to zero length, implement a cross platform
`truncate_file_to_zero`.

Based on an idea from <evpobr@gmail.com>.
2016-09-09 19:15:42 +10:00
Erik de Castro Lopo
ba352a1ce7 Remove all use of Variable Length Arrays
VLAs are somewhat unsound and are being made an optional part of ISO
C specification.
2016-09-03 18:11:56 +10:00
Erik de Castro Lopo
05288ca11e Revert "Drop use of __USE_MINGW_ANSI_STDIO"
This reverts commit ac0c02de3c.

This define is needed when cross compiling from Linux to Windows.
2016-07-03 19:02:03 +10:00
Erik de Castro Lopo
ac0c02de3c Drop use of __USE_MINGW_ANSI_STDIO 2016-07-03 11:05:08 +10:00
Erik de Castro Lopo
7b7e0d913b SF_CUES: Fix for big-endian CPUs 2016-04-15 22:27:08 +10:00
Erik de Castro Lopo
9ea30b4c19 Add SFC_GET_CUE_COUNT command
This allows retrieval of the cue marker count before retrieval.
2016-04-15 21:11:40 +10:00
Erik de Castro Lopo
eeae9a0ddc Cues: Rename SF_CUES fields 2016-04-11 19:55:10 +10:00
Lars Palo
b0ab4e6bee Updates to original patch
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2016-04-11 19:55:10 +10:00
Lars Palo
f36189554b Added tests for cues
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2016-04-11 19:55:10 +10:00
Erik de Castro Lopo
95828ca2e9 Rename EXTERNAL_* to EXTERNAL_XIPH_*`
New naming makes sense because adding Wavpack support would not
depend on any of the existing Xiph.Org libraries.
2016-03-14 08:17:45 +11:00
Erik de Castro Lopo
15259c2de4 tests/utils.tpl: Add test_format_or_die()
And use it in tests/write_read_test.tpl.
2016-02-20 11:35:54 +11:00
Erik de Castro Lopo
39b05b60c2 tests/test_wrapper.sh.in: Tweak for running under Wine
Recent versions of Wine from Debian seem to print information
to stdout which was screwing up the tests. Should be able to
remove/improve this when Debian fixes:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814572
2016-02-13 17:40:13 +11:00
Erik de Castro Lopo
e2a737247a Makefile.am: Clean up autogen usage 2016-02-08 12:02:30 +11:00
Erik de Castro Lopo
aaed5ac8f7 tests/write_read_test.tpl: Fix valgrind warning 2016-02-06 11:53:16 +11:00
Erik de Castro Lopo
fe29202250 RF64: Add support for custom chunks
Tests included.
2016-01-11 14:42:57 +11:00
Erik de Castro Lopo
c17c6f5768 RF64: Add 'PEAK' chunk read/write support
Tests included.
2016-01-06 08:39:03 +11:00
Erik de Castro Lopo
318ce3de97 RF64: Add string metadata read/write capabilities
Tests included.
2016-01-05 21:06:58 +11:00
Erik de Castro Lopo
b64b37777f Add tests for CAF string metadata read/write 2016-01-03 16:26:54 +11:00
Erik de Castro Lopo
03cb3c46ff tests/floating_point_test.tpl: Fix compiler warning 2015-12-17 22:37:38 +11:00
Erik de Castro Lopo
f29c0dc209 src/sndfile.c: Another seekable flag fix
Pointed out by Jeremy Friesner <jfriesne@gmail.com>.
2015-12-07 06:43:55 +11:00
Erik de Castro Lopo
776308d728 src/sndfile.c: Fix seekable regression
This was broken as an unintended side-effect of 19e12f564.

Also add a test to tests/write_read_test.tpl.
2015-12-01 20:45:58 +11:00
Kylie McClain
7fbbc35b1b Fix build on musl libc
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-11-24 06:18:45 +11:00
Erik de Castro Lopo
b520099bbc tests/floating_point_test.tpl: Fix compiler warnings
* Clang complained about taking the absolute value of an unsigned number.
* GCC complained about a signed/unsigned compare operation.
2015-11-22 20:45:04 +11:00