summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorJohnathan Corgan2010-10-06 18:22:17 -0700
committerJohnathan Corgan2010-10-06 18:22:17 -0700
commitee9fc9cebba1412b1f5134ef8510aff9a373d39d (patch)
tree88227be15a3fe1e0bfa5cb0ed64e0ce0457dde3a /gnuradio-core
parent1c936ad101cbd7edf8e6b96bf3f993163a7dcc7b (diff)
parentd74b45e2b4b5ad5ed772fd452541c2ad7429c0db (diff)
downloadgnuradio-ee9fc9cebba1412b1f5134ef8510aff9a373d39d.tar.gz
gnuradio-ee9fc9cebba1412b1f5134ef8510aff9a373d39d.tar.bz2
gnuradio-ee9fc9cebba1412b1f5134ef8510aff9a373d39d.zip
Merge branch 'master' into next
* master: Checks to make sure XML path is writable before making the XML runner. Ignores it if directory is now writable. Fixed missing set_relative_rate in these two blocks. The others don't actually do it, even though it's counter-intuitive for the pfb_decimate, which is a sync_block (decimation actually care of in the stream_to_streams).
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc4
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc2
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr_unittest.py35
3 files changed, 29 insertions, 12 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc
index 2c5e3a7af..399632003 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc
@@ -35,7 +35,7 @@ gr_pfb_arb_resampler_ccf_sptr gr_make_pfb_arb_resampler_ccf (float rate,
unsigned int filter_size)
{
return gnuradio::get_initial_sptr(new gr_pfb_arb_resampler_ccf (rate, taps,
- filter_size));
+ filter_size));
}
@@ -81,6 +81,8 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate,
create_diff_taps(taps, dtaps);
create_taps(taps, d_taps, d_filters);
create_taps(dtaps, d_dtaps, d_diff_filters);
+
+ set_relative_rate(rate);
}
gr_pfb_arb_resampler_ccf::~gr_pfb_arb_resampler_ccf ()
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
index f86782dad..cb67b8104 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
+++ b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
@@ -60,6 +60,8 @@ gr_pfb_channelizer_ccf::gr_pfb_channelizer_ccf (unsigned int numchans,
if(fltp != 0.0)
throw std::invalid_argument("gr_pfb_channelizer: oversample rate must be N/i for i in [1, N]");
+ set_relative_rate(1.0/intp);
+
d_filters = std::vector<gr_fir_ccf*>(d_numchans);
// Create an FIR filter for each channel and zero out the taps
diff --git a/gnuradio-core/src/python/gnuradio/gr_unittest.py b/gnuradio-core/src/python/gnuradio/gr_unittest.py
index 8ecd83d54..50d484a76 100755
--- a/gnuradio-core/src/python/gnuradio/gr_unittest.py
+++ b/gnuradio-core/src/python/gnuradio/gr_unittest.py
@@ -117,23 +117,36 @@ def run(PUT, filename=None):
# Run this is given a file name
if(filename is not None):
- path = os.getenv("HOME") + "/.gnuradio/unittests/python"
+ homepath = os.getenv("HOME")
+ basepath = homepath + "/.gnuradio"
+ path = homepath + "/.gnuradio/unittests/python"
+
+ xmlrunner = None
+ if os.path.exists(basepath):
+ # only proceed if $HOME/.gnuradio is writable
+ st = os.stat(basepath)[stat.ST_MODE]
+ if(st & stat.S_IWUSR > 0):
+ # Test if path exists; if not, build it
+ if not os.path.exists(path):
+ os.makedirs(path, 0750)
+
+ # Just for safety: make sure we can write here, too
+ st = os.stat(path)[stat.ST_MODE]
+ if(st & stat.S_IWUSR > 0):
+ # Create an XML runner to filename
+ fout = file(path+"/"+filename, "w")
+ xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
- # Test if path exists; if not, build it
- try:
- st = os.stat(path)
- except OSError:
- os.makedirs(path, 0750)
-
- # Create an XML runner to filename
- fout = file(path+"/"+filename, "w")
- xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
txtrunner = TextTestRunner(verbosity=1)
# Run the test; runner also creates XML output file
# FIXME: make xmlrunner output to screen so we don't have to do run and main
suite = TestLoader().loadTestsFromTestCase(PUT)
- xmlrunner.run(suite)
+
+ # use the xmlrunner if we can write the the directory
+ if(xmlrunner is not None):
+ xmlrunner.run(suite)
+
main()
# This will run and fail make check if problem