Checks to make sure XML path is writable before making the XML runner. Ignores it...
[debian/gnuradio] / gnuradio-core / src / python / gnuradio / gr / qa_max.py
index fdf118cd1be0401af54a82e35d27697041a4021c..5aa231623dd87ee3acafe130a3b69cf3599f8bd4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -24,7 +24,7 @@ from gnuradio import gr, gr_unittest
 import math
 
 
-class test_sig_source (gr_unittest.TestCase):
+class test_max (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -50,7 +50,21 @@ class test_sig_source (gr_unittest.TestCase):
         result_data = dst.data()
         self.assertEqual(expected_result, result_data)
 
+    def test_002(self):
+
+       src_data=(-100,-99,-98,-97,-96,-1)
+       expected_result = (float(max(src_data)), )
+
+       src = gr.vector_source_f(src_data)
+       s2v = gr.stream_to_vector(gr.sizeof_float, len(src_data))
+       op = gr.max_ff( len(src_data) )
+       dst = gr.vector_sink_f()
+
+       self.tb.connect(src, s2v, op, dst)
+       self.tb.run()
+       result_data = dst.data()
+       self.assertEqual(expected_result, result_data)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_max, "test_max.xml")