#!/usr/bin/env python
#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
class test_encoder (gr_unittest.TestCase):
def setUp (self):
- self.fg = gr.flow_graph ()
+ self.tb = gr.top_block ()
def tearDown (self):
- self.fg = None
+ self.tb = None
def test_diff_encdec_000(self):
random.seed(0)
enc = gr.diff_encoder_bb(modulus)
dec = gr.diff_decoder_bb(modulus)
dst = gr.vector_sink_b()
- self.fg.connect(src, enc, dec, dst)
- self.fg.run() # run the graph and wait for it to finish
+ self.tb.connect(src, enc, dec, dst)
+ self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
self.assertEqual(expected_result, actual_result)
enc = gr.diff_encoder_bb(modulus)
dec = gr.diff_decoder_bb(modulus)
dst = gr.vector_sink_b()
- self.fg.connect(src, enc, dec, dst)
- self.fg.run() # run the graph and wait for it to finish
+ self.tb.connect(src, enc, dec, dst)
+ self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
self.assertEqual(expected_result, actual_result)
enc = gr.diff_encoder_bb(modulus)
dec = gr.diff_decoder_bb(modulus)
dst = gr.vector_sink_b()
- self.fg.connect(src, enc, dec, dst)
- self.fg.run() # run the graph and wait for it to finish
+ self.tb.connect(src, enc, dec, dst)
+ self.tb.run() # run the graph and wait for it to finish
actual_result = dst.data() # fetch the contents of the sink
self.assertEqual(expected_result, actual_result)