3 * Copyright 2007 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
27 #include <qa_gr_top_block.h>
28 #include <gr_top_block.h>
30 #include <gr_null_source.h>
31 #include <gr_null_sink.h>
36 void qa_gr_top_block::t0()
38 if (VERBOSE) std::cout << "qa_gr_top_block::t0()\n";
40 gr_top_block_sptr tb = gr_make_top_block("top");
45 void qa_gr_top_block::t1_run()
47 if (VERBOSE) std::cout << "qa_gr_top_block::t1()\n";
49 gr_top_block_sptr tb = gr_make_top_block("top");
51 gr_block_sptr src = gr_make_null_source(sizeof(int));
52 gr_block_sptr head = gr_make_head(sizeof(int), 100000);
53 gr_block_sptr dst = gr_make_null_sink(sizeof(int));
55 tb->connect(src, 0, head, 0);
56 tb->connect(head, 0, dst, 0);
60 void qa_gr_top_block::t2_start_stop_wait()
62 if (VERBOSE) std::cout << "qa_gr_top_block::t2()\n";
64 gr_top_block_sptr tb = gr_make_top_block("top");
66 gr_block_sptr src = gr_make_null_source(sizeof(int));
67 gr_block_sptr head = gr_make_head(sizeof(int), 100000);
68 gr_block_sptr dst = gr_make_null_sink(sizeof(int));
70 tb->connect(src, 0, head, 0);
71 tb->connect(head, 0, dst, 0);
78 void qa_gr_top_block::t3_lock_unlock()
80 if (VERBOSE) std::cout << "qa_gr_top_block::t3()\n";
82 gr_top_block_sptr tb = gr_make_top_block("top");
84 gr_block_sptr src = gr_make_null_source(sizeof(int));
85 gr_block_sptr dst = gr_make_null_sink(sizeof(int));
87 tb->connect(src, 0, dst, 0);
98 void qa_gr_top_block::t4_reconfigure()
100 if (VERBOSE) std::cout << "qa_gr_top_block::t4()\n";
102 gr_top_block_sptr tb = gr_make_top_block("top");
104 gr_block_sptr src = gr_make_null_source(sizeof(int));
105 gr_block_sptr head = gr_make_head(sizeof(int), 100000);
106 gr_block_sptr dst = gr_make_null_sink(sizeof(int));
108 // Start infinite flowgraph
109 tb->connect(src, 0, dst, 0);
112 // Reconfigure with gr_head in the middle
114 tb->disconnect(src, 0, dst, 0);
115 tb->connect(src, 0, head, 0);
116 tb->connect(head, 0, dst, 0);
119 // Wait for flowgraph to end on its own