From 0d6ece00397ebb9215ccf1af06cce22c3a94197e Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 28 Aug 2022 11:25:44 -0500 Subject: begin plibsys refactor --- src/sound.test.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/sound.test.c (limited to 'src/sound.test.c') 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); +} -- cgit v1.2.1