summaryrefslogtreecommitdiff
path: root/src/sound.test.c
blob: 60dcdd1248a32d5ab1ae9fcb97a56cbd9e42f751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
}