projects
/
debian
/
gnuradio
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updating all python QA programs in gnuradio-core to output XML files.
[debian/gnuradio]
/
gnuradio-core
/
src
/
python
/
gnuradio
/
gr
/
qa_wavefile.py
diff --git
a/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
b/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
index 7ce4ae92f9f68b14d54baf90f72d214e35ab9aa0..d9f38e3f1e885b019ece52e3d1cd3ee4d2a847d4 100755
(executable)
--- a/
gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
+++ b/
gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
@@
-1,6
+1,6
@@
#!/usr/bin/env python
#
#!/usr/bin/env python
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008
,2010
Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
#
# This file is part of GNU Radio
#
@@
-25,7
+25,9
@@
from gnuradio import gr, gr_unittest
import os
from os.path import getsize
import os
from os.path import getsize
-class qa_wavefile(gr_unittest.TestCase):
+g_in_file = os.path.join (os.getenv ("srcdir"), "test_16bit_1chunk.wav")
+
+class test_wavefile(gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def setUp (self):
self.tb = gr.top_block ()
@@
-34,12
+36,11
@@
class qa_wavefile(gr_unittest.TestCase):
self.tb = None
def test_001_checkwavread (self):
self.tb = None
def test_001_checkwavread (self):
- wf = gr.wavfile_source(
"./test_16bit_1chunk.wav"
)
+ wf = gr.wavfile_source(
g_in_file
)
self.assertEqual(wf.sample_rate(), 8000)
self.assertEqual(wf.sample_rate(), 8000)
- # disabled. Fails on PPC
- def xtest_002_checkwavcopy (self):
- infile = "test_16bit_1chunk.wav"
+ def test_002_checkwavcopy (self):
+ infile = g_in_file
outfile = "test_out.wav"
wf_in = gr.wavfile_source(infile)
outfile = "test_out.wav"
wf_in = gr.wavfile_source(infile)
@@
-56,12
+57,13
@@
class qa_wavefile(gr_unittest.TestCase):
in_f = file(infile, 'rb')
out_f = file(outfile, 'rb')
in_f = file(infile, 'rb')
out_f = file(outfile, 'rb')
- in_data = in_f.read(getsize(infile))
- out_data = out_f.read(getsize(outfile))
+ in_data = in_f.read()
+ out_data = out_f.read()
+ out_f.close()
os.remove(outfile)
self.assertEqual(in_data, out_data)
if __name__ == '__main__':
os.remove(outfile)
self.assertEqual(in_data, out_data)
if __name__ == '__main__':
- gr_unittest.
main (
)
+ gr_unittest.
run(test_wavefile, "test_wavefile.xml"
)