Exemple #1
0
    def test_002(self):
	src_data=(-100,-99,-98,-97,-96,-1)
	expected_result = (float(max(src_data)),)

	src = blocks.vector_source_f(src_data)
	s2v = blocks.stream_to_vector(gr.sizeof_float, len(src_data))
	op = blocks.max_ff(len(src_data))
	dst = blocks.vector_sink_f()

	self.tb.connect(src, s2v, op, dst)
	self.tb.run()
	result_data = dst.data()
	self.assertEqual(expected_result, result_data)
Exemple #2
0
    def test_001(self):
        src_data = (0,0.2,-0.3,0,12,0)
        expected_result = (float(max(src_data)),)

        src = gr.vector_source_f(src_data)
        s2v = blocks.stream_to_vector(gr.sizeof_float, len(src_data))
        op = blocks.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)
Exemple #3
0
    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 = blocks.stream_to_vector(gr.sizeof_float, len(src_data))
	op = blocks.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)
Exemple #4
0
    def test_001(self):
        src_data = (0, 0.2, -0.3, 0, 12, 0)
        expected_result = (float(max(src_data)), )

        src = blocks.vector_source_f(src_data)
        s2v = blocks.stream_to_vector(gr.sizeof_float, len(src_data))
        op = blocks.max_ff(len(src_data))
        dst = blocks.vector_sink_f()

        self.tb.connect(src, s2v, op, dst)
        self.tb.run()
        result_data = dst.data()
        self.assertEqual(expected_result, result_data)