#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)); free(dest.left); free(dest.right); } void suite_sound() { lily_run_test(test_sound_copy); }