shithub: aubio

Download patch

ref: 175a218dca84c1e346e54650ae09803778c71412
parent: 413d4bf1d989020078e76348b303557283b995c1
author: Paul Brossier <piem@piem.org>
date: Mon Dec 30 11:50:29 EST 2013

src/lvec.c: add missing lvec_set_sample, improve test

--- a/src/lvec.c
+++ b/src/lvec.c
@@ -36,9 +36,10 @@
   AUBIO_FREE(s);
 }
 
-void lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position) {
+void lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position) {
   s->data[position] = data;
 }
+
 lsmp_t lvec_get_sample(lvec_t *s, uint_t position) {
   return s->data[position];
 }
--- a/tests/src/test-lvec.c
+++ b/tests/src/test-lvec.c
@@ -1,9 +1,17 @@
 #include <aubio.h>
+#include "utils_tests.h"
 
 int main()
 {
-  uint_t win_s = 1024; // window size
+  uint_t win_s = 32; // window size
   lvec_t * sp = new_lvec (win_s); // input buffer
+  lvec_set_sample (sp, 2./3., 0);
+  PRINT_MSG("%lf\n", lvec_get_sample (sp, 0));
+  lvec_print (sp);
+  lvec_ones (sp);
+  lvec_print (sp);
+  lvec_set_all (sp, 3./5.);
+  lvec_print (sp);
   del_lvec(sp);
   return 0;
 }
--