summaryrefslogtreecommitdiff
path: root/axfer/test
Commit message (Collapse)AuthorAgeFilesLines
* aplay,axfer: Replace off64_t with off_tKhem Raj2023-01-232-3/+3
| | | | | | | | | | | | | | | | | | Also replace lseek64 with lseek. _FILE_OFFSET_BITS=64 is passed to needed platforms since configure uses AC_SYS_LARGEFILE macro. Therefore off_t is already 64-bit and lseek is same as lseek64. Additionally this fixes buils with latest musl where these lfs64 functions are moved out from _GNU_SOURCE and under _LARGEFILE64_SOURCE macro alone. This makes the builds fail on 32-bit platforms even though default off_t on musl is 64-bit always. Fixes: https://github.com/alsa-project/alsa-utils/pull/183 Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: reduce test case for maximum number of samples per frameTakashi Sakamoto2021-03-111-1/+1
| | | | | | | | | This commit reduces test case for maximum number of samples per frame so that overall time is shortened. The count of total iteration is also reduced by one quarter. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Revert "axfer: test - add run-test-in-tmpdir.sh script"Takashi Sakamoto2021-03-111-19/+0
| | | | | | | | This reverts commit e1551de8dd28c3a63f8d7c146952a8d2649ac9de since tests run for in-memory files now. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: reduce test case for maximum number of frame countTakashi Sakamoto2021-03-111-1/+1
| | | | | | | | This commit reduces test case for maximum number of frame count so that overall time is shortened. The count of total iteration is still the same. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: use memfd_create() for mapper-testTakashi Sakamoto2021-03-111-3/+14
| | | | | | | | | | | The mapper test program writes audio data frame to files, and read them from the files, then validate them. For the operations, usage of any in-memory file is good to shorten time of overall operations. This commit uses shm by memfd_create(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: minor code arrangement to use the same file descriptor for ↵Takashi Sakamoto2021-03-111-39/+34
| | | | | | | | | | | | | mappter-test In mapper test program, two set of file descriptors open to the same files for container builder and parser contexts, however the same file descriptor is available for the case. This commit arranges to use the same file descriptor for the contexts. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: use memfd_create() for container-testTakashi Sakamoto2021-03-111-4/+13
| | | | | | | | | | | | | | | | | | | The container test program writes audio data frame to file, and read them from the file, then validate them. For the operations, usage of any in-memory file is good to shorten time of overall operations. This commit uses shm via memfd_create(). As a result, overall time to run is shorten one half of before, depending on machine environment. I note that we can achieve the same result by using O_TMPFILE flag in open(2) system call, however the implementation of O_TMPFILE is to add i-node without name on underling file system, thus it has overhead depending on implementation in each file system. On the other hand, memfd_create() is directly relevant to shm and expected to be less overhead. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: minor code arrangement to use the same file descriptor for ↵Takashi Sakamoto2021-03-111-17/+23
| | | | | | | | | | | | | container-test In container test program, two file descriptors open to the same file for builder and parser contexts, however the same file descriptor is available for the case. This commit arranges to use the same file descriptor for the contexts. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: maintain lifetime of file descriptor outside of container moduleTakashi Sakamoto2021-03-112-12/+34
| | | | | | | | | This commit closes file descriptor outside of container module so that maintenance of lifetime for the descriptor is delegated to container user. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: open file descriptor outside of container moduleTakashi Sakamoto2021-03-112-7/+24
| | | | | | | | | | | | | | Internal container module operates file descriptor to media file. For this purpose, the structure has fd member and any file operation is done internally. However, the case to use special file descriptor such as memfd requires to maintain file descriptor externally. This commit opens file descriptor outside of container module. The internal APIs to initialize container get an argument for the file descriptor instead of file path. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test - add run-test-in-tmpdir.sh scriptJaroslav Kysela2021-03-061-0/+19
| | | | | BugLink: https://github.com/alsa-project/alsa-utils/issues/19 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: test: fix invalid comparison of 64 bit storage in ILP32 data typeTakashi Sakamoto2019-07-313-85/+85
| | | | | | | | | | | | | In system V ABIs with ILP32 data model, bit shift for '1ul' can brings undefined behaviour when the calculation result is over 32 bit width. This commit fixes the bug. Reported-by: Rolf Eike Beer <eike@sf-mail.de> Reference: https://bugs.gentoo.org/681652 Reference: https://github.com/alsa-project/alsa-utils/issues/23 Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* axfer/test: fix uninitialized warningTakashi Sakamoto2019-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | This commit fixes uninitialized return value from a call of test_mux() and text_demux() to suppress warnings below: $ make check ... gcc -DHAVE_CONFIG_H -I. -I../../include -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c mapper-test.c: In function ‘test_mapper’: mapper-test.c:241:9: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized] return err; ^~~ mapper-test.c:231:5: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (err < 0) ^ Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer/test: fix uninitialized warningTakashi Sakamoto2019-05-071-1/+3
| | | | | | | | | | | | | | | This commit fixes uninitialized return value from a call of test_vector() to suppress a warning below. gcc -DHAVE_CONFIG_H -I. -I../../include -O2 -Wall -pipe -g -MT mapper-test.o -MD -MP -MF .deps/mapper-test.Tpo -c -o mapper-test.o mapper-test.c mapper-test.c: In function ‘test_vector’: mapper-test.c:293:6: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized] int err; ^~~ Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: add missing header file of unit test to distributionTakashi Sakamoto2019-01-291-0/+2
| | | | | | | | | | | | The file 'axfer/test/generator.h' is missing in distribution and brings FTBFS for unit tests of axfer. This commit fixes to add it. Reported-by: Elimar Riesebieter <riesebie@lxtec.de> Fixes: b878df1ff0b0: ('axfer: add unit test for container interface') Fixes: 39d1ab8a0cb4: ('axfer: add a unit test for mapper interface') Signed-off-by: Takashi Iwai <tiwai@suse.de>
* axfer: add a unit test for mapper interfaceTakashi Sakamoto2018-11-132-2/+509
| | | | | | | | | | | In former commits, mapper module gets supports of muxer/demuxer for single/multiple targets for playback source or capture destination. This commit adds a unit test for them. This includes positive test cases only. The test cases actually generate I/O to file systems for many test cases. It takes a bit long time to finish. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* axfer: add unit test for container interfaceTakashi Sakamoto2018-11-134-0/+621
In former commits, container module gets supports of parser/builder for several types of file format. This commit adds a unit test for them. This includes positive test cases only. The test cases actually generate I/O to file systems for many test cases. It takes a long time to finish. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>