1 #include "soundpipe.h"
2 #include "md5.h"
3 #include "tap.h"
4 #include "test.h"
5 
6 
7 typedef struct {
8     sp_noise *ns;
9     sp_tbvcf *tn;
10 } UserData;
11 
t_tbvcf(sp_test * tst,sp_data * sp,const char * hash)12 int t_tbvcf(sp_test *tst, sp_data *sp, const char *hash)
13 {
14     uint32_t n;
15     int fail = 0;
16 
17     sp_srand(sp, 0);
18     UserData ud;
19     sp_noise_create(&ud.ns);
20     sp_tbvcf_create(&ud.tn);
21     sp_noise_init(sp, ud.ns);
22     sp_tbvcf_init(sp, ud.tn);
23     ud.tn->dist = 1.0;
24     SPFLOAT in = 0;
25 
26     for(n = 0; n < tst->size; n++) {
27         in = 0;
28 
29         sp_noise_compute(sp, ud.ns, NULL, &in);
30         sp_tbvcf_compute(sp, ud.tn, &in, &sp->out[0]);
31         sp_test_add_sample(tst, sp->out[0]);
32     }
33 
34     fail = sp_test_verify(tst, hash);
35 
36     sp_noise_destroy(&ud.ns);
37     sp_tbvcf_destroy(&ud.tn);
38 
39     if(fail) return SP_NOT_OK;
40     else return SP_OK;
41 }
42