Commit graph

17 commits

Author SHA1 Message Date
Gregory Maxwell
de95da9bf1 Fix several issues with multistream argument validation.
As reported by Mark Warner opus_multistream_*_create were depending on
 the behavior of malloc(0) in order to correctly report some kinds of
 argument errors. Bad arguments could be incorrectly reported as
 allocation failures. This changes multistream to explicitly check the
 arguments like the single stream _create functions. The unit tests were
 enough to catch this on systems where malloc(0) returns NULL but didn't
 catch it on other systems because the later _init call would catch the
 bad arguments and trigger the correct error if and only if the malloc
 didn't return a null pointer.

In multistream_encoder_init failures of the internal non-multistream
 init calls were not being caught and propagated. Decode didn't have
 this problem. This propagates the errors and adds additional tests
 (the multistream encoder api is sill under tested) that would have
 detected this error.

Plus add some stronger tests for things like error==NULL for the _create
 functions that take a pointer for error output.
2012-10-27 13:42:48 -04:00
Ralph Giles
662ae9bb18 Include process.h for _getpid on windows.
Previously the test programmes happened to link because _getpid
returns an int, which is the default prototype. Instead, include
the appropriate header to supply a real declaration, fixing the
associated warning.

I moved the getpid->_getpid define to the site of the header
inclusion to make clear what's going on, rather than have it
floating in win32/config.h.
2012-10-23 13:04:36 -07:00
Gregory Maxwell
e23b15f1ea Add some more multistream encoder API tests. 2012-09-26 08:33:16 -04:00
Gregory Maxwell
582eba6f4f Additional multistream tests and reject channels<1 in MS API. 2012-08-21 16:08:35 -04:00
Gregory Maxwell
ce87883686 Fix headers by mingw broken by recent win32 changes. 2012-07-14 11:00:24 -04:00
Gian-Carlo Pascutto
c0edd63737 Make tests work on MSVC.
Add project files for Opus tests, fixup test source for Win32.
2012-07-12 18:00:46 -04:00
Gregory Maxwell
d6737c8522 Avoid an inconsequential memory leak in tests/test_opus_encode.c. 2012-06-01 00:52:51 -04:00
Jean-Marc Valin
cb05e7cd96 s/FOUNDATION/COPYRIGHT OWNER/ in CELT code and "glue code"
Also added 3rd clause to "master" COPYING file
2012-04-20 16:41:42 -04:00
Gregory Maxwell
a26b2be2f9 Improvements to the tests, add a TEST_OPUS_NOFUZZ to disable testing corrupted input.
No changes to the codec itself.
2012-01-25 12:04:17 +13:00
Gregory Maxwell
e699c1989c Testing tools improvements (no impact on draft) 2011-11-25 23:53:15 -05:00
Gregory Maxwell
afd05aca0c Fix multistream packet corruption, implement GET_FINAL_RANGE for multistream, and add many tests.
Multistream encode was failing to add the length of the extra length for
self-delimited packets causing corrupted output. Multistream decode was
not properly handling lost frames (and potentially reading out of bounds
as a result).

GET_FINAL_RANGE has been implemented as the xor of the final range of all
the streams in the packet.

test_opus_encode now does the mono narrowband tests using dual-mono
multistream.
2011-10-30 19:57:22 -04:00
Gregory Maxwell
54a3495a52 Minor changes to test_opus_encode to improve coverage a little bit. 2011-10-29 18:19:23 -04:00
Gregory Maxwell
8fcfe02bc0 Update test_opus_encode / test_opus_decode for better LBRR/PLC testing and to reduce stack usage. 2011-10-28 23:15:04 -04:00
Ralph Giles
7931a60135 Remove relative paths to opus.h.
Files are already compiled with -I./include, the relative
path in the #include line isn't necessary.
2011-10-28 11:30:57 -07:00
Gregory Maxwell
71c04dc00c Improve test_opus_encode's coverage of some high rate cases. 2011-10-27 18:07:40 -04:00
Jean-Marc Valin
4923f3f80e Moves the main headers from src/ to include/ 2011-10-26 21:36:57 -04:00
Gregory Maxwell
a5ff49ecdc Renames test_opus to opus_demo and adds the test_opus_api, test_opus_encode, test_opus_decode test programs. 2011-10-26 19:59:49 -04:00