tests/python/src/temporal/a_weighting.py: moved from adesign.py
authorPaul Brossier <piem@piem.org>
Tue, 29 Sep 2009 23:24:56 +0000 (01:24 +0200)
committerPaul Brossier <piem@piem.org>
Tue, 29 Sep 2009 23:24:56 +0000 (01:24 +0200)
tests/python/src/temporal/a_weighting.py [moved from tests/python/src/temporal/adesign.py with 77% similarity]

similarity index 77%
rename from tests/python/src/temporal/adesign.py
rename to tests/python/src/temporal/a_weighting.py
index 8b4b98fb66fb0ffd69803339eee9d6fc4a30fe12..9a7f78bacb1ab3c1925839db0387c3a5392814e3 100644 (file)
@@ -1,5 +1,4 @@
-from template import aubio_unit_template
-from aubio.aubiowrapper import *
+from localaubio import *
 
 samplerate = 44100
 buf_size = 1024
@@ -8,10 +7,10 @@ channels = 2
 class adsgn_filter_unit(aubio_unit_template):
 
   def setUp(self):
-    self.o = new_aubio_adsgn_filter(samplerate, channels)
+    self.o = new_aubio_filter_a_weighting (samplerate, channels)
 
   def tearDown(self):
-    del_aubio_adsgn_filter(self.o)
+    del_aubio_filter (self.o)
 
   def test_creation(self):
     pass
@@ -19,7 +18,7 @@ class adsgn_filter_unit(aubio_unit_template):
   def test_filter_zeroes(self):
     """ check filter run on a vector full of zeroes returns zeros """
     vec = new_fvec(buf_size, channels)
-    aubio_adsgn_filter_do(self.o, vec)
+    aubio_filter_do (self.o, vec)
     for index in range(buf_size):
       for channel in range(channels):
         self.assertEqual(0., fvec_read_sample(vec,channel,index))
@@ -30,7 +29,7 @@ class adsgn_filter_unit(aubio_unit_template):
     for index in range(buf_size):
       for channel in range(channels):
         fvec_write_sample(vec, 1., channel, index)
-    aubio_adsgn_filter_do(self.o, vec)
+    aubio_filter_do (self.o, vec)
     for index in range(buf_size):
       for channel in range(channels):
         self.assertNotEqual(0., fvec_read_sample(vec,channel,index))
@@ -40,12 +39,13 @@ class adsgn_filter_unit(aubio_unit_template):
     vec = new_fvec(buf_size, channels)
     for index in range(buf_size):
       for channel in range(channels):
-        fvec_write_sample(vec, 1.e-37, channel, index)
-    aubio_adsgn_filter_do(self.o, vec)
+        fvec_write_sample(vec, 2.e-42, channel, index)
+    aubio_filter_do (self.o, vec)
     for index in range(buf_size):
       for channel in range(channels):
         self.assertEqual(0., fvec_read_sample(vec,channel,index))
     del_fvec(vec)
 
 if __name__ == '__main__':
+  import unittest
   unittest.main()