History

python/: use Py_RETURN_NONE, fixing a memory bug triggered after opening many sinks

Paul Brossier committed 13 years ago

Commit 9e6695d1 parent 90a8f2f5 files · +21 −12Browse files

Showing the changes to python/tests (1 of 5 files). Show all

Unified · Split

python/tests/test_sink.py+12−3
@@ -13,6 +13,15 @@ class aubio_sink_test_case(TestCase): · 12 unmodified lines
1313 def setUp(self):
1414 if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'')
1515
16+ def test_many_sinks(self):
17+ for i in range(100):
18+ g = sink('/tmp/f.wav', 0)
19+ write = 256
20+ for n in range(200):
21+ vec = fvec(write)
22+ g(vec, write)
23+ del g
24+
1625 def test_read(self):
1726 for path in list_of_sounds:
1827 for samplerate, hop_size in zip([0, 44100, 8000, 32000], [512, 1024, 64, 256]):
@@ -30,8 +39,8 @@ class aubio_sink_test_case(TestCase): · 11 unmodified lines
3039 print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")",
3140 print "from", f.uri,
3241 print "to", g.uri
42+ #del f, g
3343
3444 if __name__ == '__main__':
35− from unittest import main
36− main()
37−
45+ from unittest import main
46+ main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t