def test_exceptions(self):
     self.assertRaises(ValueError, lambda: cc.blockinterleaver_vbb(2, 1, 3))
     self.assertRaises(ValueError,
                       lambda: cc.blockinterleaver_vbb(20, 20, 3))
     self.assertRaises(ValueError,
                       lambda: cc.blockinterleaver_bb(20, 20, 3))
     self.assertRaises(ValueError,
                       lambda: cc.blockdeinterleaver_vbb(2, 1, 3))
     self.assertRaises(ValueError,
                       lambda: cc.blockdeinterleaver_vbb(20, 20, 3))
     self.assertRaises(ValueError,
                       lambda: cc.blockdeinterleaver_bb(20, 20, 3))
    def test_stream_interleaving_symbols(self):
        n_rows = 32
        n_cols = 128
        src = gr.glfsr_source_b(32)
        head = gr.head(gr.sizeof_char, n_rows * n_cols * 3)
        interleaver = cc.blockinterleaver_bb(n_rows, n_cols)
        deinterleaver = cc.blockdeinterleaver_bb(n_rows, n_cols)
        ber = cc.ber_b(8)

        self.tb.connect(src, head, interleaver, deinterleaver, ber)
        self.tb.connect(head, (ber, 1))
        self.tb.run()
        self.assertEqual(ber.ber(), 0)
 def test_exceptions (self):
     self.assertRaises(ValueError,
                         lambda: cc.blockinterleaver_vbb(2, 1, 3))
     self.assertRaises(ValueError,
                         lambda: cc.blockinterleaver_vbb(20, 20, 3))
     self.assertRaises(ValueError,
                         lambda: cc.blockinterleaver_bb(20, 20, 3))
     self.assertRaises(ValueError,
                         lambda: cc.blockdeinterleaver_vbb(2, 1, 3))
     self.assertRaises(ValueError,
                         lambda: cc.blockdeinterleaver_vbb(20, 20, 3))
     self.assertRaises(ValueError,
                         lambda: cc.blockdeinterleaver_bb(20, 20, 3))
    def test_stream_interleaving_symbols(self):
        n_rows = 32
        n_cols = 128
        src = gr.glfsr_source_b(32)
        head = gr.head(gr.sizeof_char, n_rows * n_cols * 3)
        interleaver = cc.blockinterleaver_bb(n_rows, n_cols)
        deinterleaver = cc.blockdeinterleaver_bb(n_rows, n_cols)
        ber = cc.ber_b(8)

        self.tb.connect(src, head, interleaver, deinterleaver, ber)
        self.tb.connect(head, (ber, 1))
        self.tb.run()
        self.assertEqual(ber.ber(), 0)