コード例 #1
0
    def test_002(self):

        src_data = [1, 2, 3, 4]
        expected_result = [16777216, 33554432, 50331648, 67108864]

        src = gr.vector_source_i(src_data)
        op = gr.endian_swap(4)
        dst = gr.vector_sink_i()

        self.tb.connect(src, op, dst)
        self.tb.run()
        result_data = list(dst.data())

        self.assertEqual(expected_result, result_data)
コード例 #2
0
    def test_002(self):

        src_data = [1,2,3,4]
        expected_result = [16777216, 33554432, 50331648, 67108864];

        src = gr.vector_source_i(src_data)
        op = gr.endian_swap(gr.sizeof_int)
        dst = gr.vector_sink_i()

        self.tb.connect(src, op, dst)
        self.tb.run()
        result_data = list(dst.data())
    
        self.assertEqual(expected_result, result_data)
コード例 #3
0
    def test_001(self):

        src_data = [1, 2, 3, 4]
        expected_result = [256, 512, 768, 1024]

        src = gr.vector_source_s(src_data)
        op = gr.endian_swap(2)
        dst = gr.vector_sink_s()

        self.tb.connect(src, op, dst)
        self.tb.run()
        result_data = list(dst.data())

        self.assertEqual(expected_result, result_data)
コード例 #4
0
    def test_001(self):

        src_data = [1,2,3,4]
        expected_result = [256, 512, 768, 1024];

        src = gr.vector_source_s(src_data)
        op = gr.endian_swap(gr.sizeof_short)
        dst = gr.vector_sink_s()

        self.tb.connect(src, op, dst)
        self.tb.run()
        result_data = list(dst.data())

        self.assertEqual(expected_result, result_data)