projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0512fca
)
[tests] improve test-sink
author
Paul Brossier
<piem@piem.org>
Mon, 17 Dec 2018 14:14:39 +0000
(15:14 +0100)
committer
Paul Brossier
<piem@piem.org>
Mon, 17 Dec 2018 14:14:39 +0000
(15:14 +0100)
tests/src/io/base-sink_custom.h
patch
|
blob
|
history
tests/src/io/test-sink.c
patch
|
blob
|
history
tests/src/io/test-sink_apple_audio.c
patch
|
blob
|
history
tests/src/io/test-sink_sndfile.c
patch
|
blob
|
history
tests/src/io/test-sink_wavwrite.c
patch
|
blob
|
history
diff --git
a/tests/src/io/base-sink_custom.h
b/tests/src/io/base-sink_custom.h
index
fe55b74
..
0c5219d
100644
(file)
--- a/
tests/src/io/base-sink_custom.h
+++ b/
tests/src/io/base-sink_custom.h
@@
-116,9
+116,14
@@
int test_wrong_params(void)
if (aubio_sink_custom_preset_channels(s, channels)) return 1;
if (aubio_sink_custom_preset_samplerate(s, samplerate)) return 1;
if (aubio_sink_custom_preset_channels(s, channels)) return 1;
if (aubio_sink_custom_preset_samplerate(s, samplerate)) return 1;
+ if (aubio_sink_custom_get_samplerate(s) != samplerate) return 1;
+ if (aubio_sink_custom_get_channels(s) != channels) return 1;
+
mat = new_fmat(channels, hop_size);
// check writing a vector with valid length
aubio_sink_custom_do_multi(s, mat, hop_size);
mat = new_fmat(channels, hop_size);
// check writing a vector with valid length
aubio_sink_custom_do_multi(s, mat, hop_size);
+ // check writing 0 frames
+ aubio_sink_custom_do_multi(s, mat, 0);
// check writing more than in the input
aubio_sink_custom_do_multi(s, mat, hop_size+1);
del_fmat(mat);
// check writing more than in the input
aubio_sink_custom_do_multi(s, mat, hop_size+1);
del_fmat(mat);
diff --git
a/tests/src/io/test-sink.c
b/tests/src/io/test-sink.c
index
aa86050
..
79a9602
100644
(file)
--- a/
tests/src/io/test-sink.c
+++ b/
tests/src/io/test-sink.c
@@
-112,9
+112,14
@@
int test_wrong_params(void)
if (aubio_sink_preset_channels(s, channels)) return 1;
if (aubio_sink_preset_samplerate(s, samplerate)) return 1;
if (aubio_sink_preset_channels(s, channels)) return 1;
if (aubio_sink_preset_samplerate(s, samplerate)) return 1;
+ if (aubio_sink_get_samplerate(s) != samplerate) return 1;
+ if (aubio_sink_get_channels(s) != channels) return 1;
+
mat = new_fmat(channels, hop_size);
// check writing a vector with valid length
aubio_sink_do_multi(s, mat, hop_size);
mat = new_fmat(channels, hop_size);
// check writing a vector with valid length
aubio_sink_do_multi(s, mat, hop_size);
+ // check writing 0 frames
+ aubio_sink_do_multi(s, mat, 0);
// check writing more than in the input
aubio_sink_do_multi(s, mat, hop_size+1);
del_fmat(mat);
// check writing more than in the input
aubio_sink_do_multi(s, mat, hop_size+1);
del_fmat(mat);
diff --git
a/tests/src/io/test-sink_apple_audio.c
b/tests/src/io/test-sink_apple_audio.c
index
bcffb10
..
8349cc8
100644
(file)
--- a/
tests/src/io/test-sink_apple_audio.c
+++ b/
tests/src/io/test-sink_apple_audio.c
@@
-14,6
+14,8
@@
#define aubio_sink_custom_close aubio_sink_apple_audio_close
#define aubio_sink_custom_preset_samplerate aubio_sink_apple_audio_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_apple_audio_preset_channels
#define aubio_sink_custom_close aubio_sink_apple_audio_close
#define aubio_sink_custom_preset_samplerate aubio_sink_apple_audio_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_apple_audio_preset_channels
+#define aubio_sink_custom_get_samplerate aubio_sink_apple_audio_get_samplerate
+#define aubio_sink_custom_get_channels aubio_sink_apple_audio_get_channels
#endif /* HAVE_SINK_APPLE_AUDIO */
#include "base-sink_custom.h"
#endif /* HAVE_SINK_APPLE_AUDIO */
#include "base-sink_custom.h"
diff --git
a/tests/src/io/test-sink_sndfile.c
b/tests/src/io/test-sink_sndfile.c
index
0cd0208
..
5195086
100644
(file)
--- a/
tests/src/io/test-sink_sndfile.c
+++ b/
tests/src/io/test-sink_sndfile.c
@@
-14,6
+14,8
@@
#define aubio_sink_custom_close aubio_sink_sndfile_close
#define aubio_sink_custom_preset_samplerate aubio_sink_sndfile_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_sndfile_preset_channels
#define aubio_sink_custom_close aubio_sink_sndfile_close
#define aubio_sink_custom_preset_samplerate aubio_sink_sndfile_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_sndfile_preset_channels
+#define aubio_sink_custom_get_samplerate aubio_sink_sndfile_get_samplerate
+#define aubio_sink_custom_get_channels aubio_sink_sndfile_get_channels
#endif /* HAVE_SNDFILE */
#include "base-sink_custom.h"
#endif /* HAVE_SNDFILE */
#include "base-sink_custom.h"
diff --git
a/tests/src/io/test-sink_wavwrite.c
b/tests/src/io/test-sink_wavwrite.c
index
6385be7
..
e219fe6
100644
(file)
--- a/
tests/src/io/test-sink_wavwrite.c
+++ b/
tests/src/io/test-sink_wavwrite.c
@@
-14,6
+14,8
@@
#define aubio_sink_custom_close aubio_sink_wavwrite_close
#define aubio_sink_custom_preset_samplerate aubio_sink_wavwrite_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_wavwrite_preset_channels
#define aubio_sink_custom_close aubio_sink_wavwrite_close
#define aubio_sink_custom_preset_samplerate aubio_sink_wavwrite_preset_samplerate
#define aubio_sink_custom_preset_channels aubio_sink_wavwrite_preset_channels
+#define aubio_sink_custom_get_samplerate aubio_sink_wavwrite_get_samplerate
+#define aubio_sink_custom_get_channels aubio_sink_wavwrite_get_channels
#endif /* HAVE_WAVWRITE */
#include "base-sink_custom.h"
#endif /* HAVE_WAVWRITE */
#include "base-sink_custom.h"