diff options
author | sanine <sanine.not@pm.me> | 2022-08-28 11:25:44 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-08-28 11:25:44 -0500 |
commit | 0d6ece00397ebb9215ccf1af06cce22c3a94197e (patch) | |
tree | 022cc796822a998a59d8bf8896f02599ce6d3700 /src/sound.test.c | |
parent | a4dd0ad63c00f4dee3b86dfd3075d1d61b2b3180 (diff) |
begin plibsys refactor
Diffstat (limited to 'src/sound.test.c')
-rw-r--r-- | src/sound.test.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/sound.test.c b/src/sound.test.c new file mode 100644 index 0000000..60dcdd1 --- /dev/null +++ b/src/sound.test.c @@ -0,0 +1,31 @@ +#include "test/mossrose-test.h" + +#include "sound.c" + + +void test_sound_copy() +{ + struct mossrose_sound_t src, dest; + float left[] = { 0.1, 0.2, 0.3 }; + float right[] = { 0.0, 0.5, 1.0 }; + src.left = left; + src.right = right; + src.len = 3; + + dest.left = NULL; + dest.right = NULL; + + sound_copy(&dest, &src); + + lily_assert_int_equal(dest.len, 3); + lily_assert_not_null(dest.left); + lily_assert_memory_equal(dest.left, left, 3*sizeof(float)); + lily_assert_not_null(dest.right); + lily_assert_memory_equal(dest.right, right, 3*sizeof(float)); +} + + +void suite_sound() +{ + lily_run_test(test_sound_copy); +} |