Index: python/tests/test_hist.py.old
===================================================================
--- python/tests/test_hist.py.old	(revision 41399bd47e9f1240000220de37df57b39a90174e)
+++ python/tests/test_hist.py.old	(revision 41399bd47e9f1240000220de37df57b39a90174e)
@@ -0,0 +1,74 @@
+#! /usr/bin/env python
+
+from numpy.testing import TestCase, assert_equal, assert_almost_equal
+from aubio import fvec, digital_filter
+import random
+
+buf_size = 2048
+channels = 1
+flow = float(random.randint(0, 100) + random.random())
+fhig = float(random.randint(100, 1000) + random.random())
+
+nelems = 1000
+
+class hist_test_case(TestCase):
+
+  def setUp(self):
+    self.o = new_aubio_hist(flow, fhig, nelems, channels)
+
+  def tearDown(self):
+    del_aubio_hist(self.o)
+
+  def test_hist(self):
+    """ create and delete hist """
+    pass
+
+  def test_hist_zeroes(self):
+    """ test hist on zeroes """
+    input = new_fvec(buf_size, channels)
+    aubio_hist_do_notnull(self.o, input)
+    aubio_hist_weight(self.o)
+    self.assertEqual(0., aubio_hist_mean(self.o))
+    del_fvec(input)
+
+  def test_hist_impulse_top(self):
+    """ test hist on impulse (top - 1.) """
+    """ this returns 1./nelems because 1 element is in the range """
+    input = new_fvec(buf_size, channels)
+    constant = fhig - 1. 
+    fvec_write_sample(input,constant,0,0)
+    aubio_hist_do_notnull(self.o, input)
+    self.assertCloseEnough(1./nelems, aubio_hist_mean(self.o))
+    del_fvec(input)
+
+  def test_hist_impulse_over(self):
+    """ test hist on impulse (top + 1.) """
+    """ this returns 0 because constant is out of range """
+    input = new_fvec(buf_size, channels)
+    constant = fhig + 1. 
+    fvec_write_sample(input,constant,0,0)
+    aubio_hist_do_notnull(self.o, input)
+    self.assertCloseEnough(0., aubio_hist_mean(self.o))
+    del_fvec(input)
+
+  def test_hist_impulse_bottom(self):
+    """ test hist on constant near lower limit """
+    """ this returns 1./nelems because 1 element is in the range """
+    input = new_fvec(buf_size, channels)
+    constant = flow + 1. 
+    fvec_write_sample(input,constant,0,0)
+    aubio_hist_do_notnull(self.o, input)
+    self.assertCloseEnough(1./nelems, aubio_hist_mean(self.o))
+    del_fvec(input)
+
+  def test_hist_impulse_under(self):
+    """ test hist on constant under lower limit """
+    """ this returns 0 because constant is out of range """
+    vec_in = fvec(buf_size)
+    constant = flow - 1. 
+    vec_in[0] = constant
+    aubio_hist_do_notnull(self.o, input)
+    self.assertCloseEnough(0., aubio_hist_mean(self.o))
+    del_fvec(input)
+
+if __name__ == '__main__': unittest.main()
Index: python/tests/test_zero_crossing_rate.py.old
===================================================================
--- python/tests/test_zero_crossing_rate.py.old	(revision 41399bd47e9f1240000220de37df57b39a90174e)
+++ python/tests/test_zero_crossing_rate.py.old	(revision 41399bd47e9f1240000220de37df57b39a90174e)
@@ -0,0 +1,56 @@
+from aubio import zero_crossing_rate
+
+#! /usr/bin/env python
+
+from numpy.testing import TestCase
+
+buf_size = 2048
+channels = 1
+
+class zero_crossing_rate_test_case(TestCase):
+
+  def setUp(self):
+    self.vector = new_fvec(buf_size, channels)
+
+  def tearDown(self):
+    del_fvec(self.vector)
+
+  def test(self):
+    """ create and delete fvec """
+    pass
+
+  def test_zeroes(self):
+    """ check zero crossing rate on a buffer of 0. """
+    self.assertEqual(0., zero_crossing_rate(self.vector))
+
+  def test_ones(self):
+    """ check zero crossing rate on a buffer of 1. """
+    for index in range(buf_size):
+      for channel in range(channels):
+        fvec_write_sample(self.vector, 1., channel, index)
+    self.assertEqual(0., zero_crossing_rate(self.vector))
+
+  def test_impulse(self):
+    """ check zero crossing rate on a buffer with an impulse """
+    fvec_write_sample(self.vector, 1., 0, buf_size / 2)
+    self.assertEqual(0., zero_crossing_rate(self.vector))
+
+  def test_negative_impulse(self):
+    """ check zero crossing rate on a buffer with a negative impulse """
+    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
+    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+  def test_single(self):
+    """ check zero crossing rate on single crossing """
+    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 1)
+    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
+    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+  def test_single_with_gap(self):
+    """ check zero crossing rate on single crossing with a gap"""
+    fvec_write_sample(self.vector, +1., 0, buf_size / 2 - 2)
+    fvec_write_sample(self.vector, -1., 0, buf_size / 2)
+    self.assertEqual(2./buf_size, zero_crossing_rate(self.vector))
+
+if __name__ == '__main__':
+  unittest.main()
