diff options
Diffstat (limited to 'gr-howto-write-a-block/lib')
-rw-r--r-- | gr-howto-write-a-block/lib/CMakeLists.txt | 76 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_howto.cc | 41 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_howto.h | 38 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square2_ff.cc | 63 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square2_ff.h | 46 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square_ff.cc | 63 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square_ff.h | 46 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/square2_ff_impl.cc | 98 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/square2_ff_impl.h | 51 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/square_ff_impl.cc | 105 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/square_ff_impl.h | 52 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/test_howto.cc | 43 |
12 files changed, 0 insertions, 722 deletions
diff --git a/gr-howto-write-a-block/lib/CMakeLists.txt b/gr-howto-write-a-block/lib/CMakeLists.txt deleted file mode 100644 index 2c995b868b..0000000000 --- a/gr-howto-write-a-block/lib/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2011,2012 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 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup library -######################################################################## -include(GrPlatform) #define LIB_SUFFIX - -include_directories(${Boost_INCLUDE_DIR}) -link_directories(${Boost_LIBRARY_DIRS}) - -add_library(gnuradio-howto SHARED square_ff_impl.cc square2_ff_impl.cc) -target_link_libraries(gnuradio-howto - ${Boost_LIBRARIES} - ${GRUEL_LIBRARIES} - ${GNURADIO_CORE_LIBRARIES} - ${LOG4CXX_LIBRARIES} -) - -set_target_properties(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS") - -if(ENABLE_GR_CTRLPORT) - ADD_DEFINITIONS(-DGR_CTRLPORT) - include_directories(${ICE_INCLUDE_DIR}) -endif(ENABLE_GR_CTRLPORT) - -######################################################################## -# Install built library files -######################################################################## -install(TARGETS gnuradio-howto - LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file - ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file - RUNTIME DESTINATION bin # .dll file -) - -######################################################################## -# Build and register unit test -######################################################################## -include(GrTest) - -include_directories(${CPPUNIT_INCLUDE_DIRS}) - -list(APPEND test_howto_sources - ${CMAKE_CURRENT_SOURCE_DIR}/test_howto.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_howto.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_square_ff.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_square2_ff.cc -) - -add_executable(test-howto ${test_howto_sources}) - -target_link_libraries( - test-howto - ${GNURADIO_CORE_LIBRARIES} - ${Boost_LIBRARIES} - ${CPPUNIT_LIBRARIES} - gnuradio-howto -) - -GR_ADD_TEST(test_howto test-howto) diff --git a/gr-howto-write-a-block/lib/qa_howto.cc b/gr-howto-write-a-block/lib/qa_howto.cc deleted file mode 100644 index 6200da9b48..0000000000 --- a/gr-howto-write-a-block/lib/qa_howto.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * This class gathers together all the test cases for the gr-filter - * directory into a single test suite. As you create new test cases, - * add them here. - */ - -#include "qa_howto.h" -#include "qa_square_ff.h" -#include "qa_square2_ff.h" - -CppUnit::TestSuite * -qa_howto::suite() -{ - CppUnit::TestSuite *s = new CppUnit::TestSuite("howto"); - - s->addTest(gr::howto::qa_square_ff::suite()); - s->addTest(gr::howto::qa_square2_ff::suite()); - - return s; -} diff --git a/gr-howto-write-a-block/lib/qa_howto.h b/gr-howto-write-a-block/lib/qa_howto.h deleted file mode 100644 index 8eff956b61..0000000000 --- a/gr-howto-write-a-block/lib/qa_howto.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_HOWTO_H_ -#define _QA_HOWTO_H_ - -#include <gruel/attributes.h> -#include <cppunit/TestSuite.h> - -//! collect all the tests for the gr-filter directory - -class __GR_ATTR_EXPORT qa_howto -{ - public: - //! return suite of tests for all of gr-filter directory - static CppUnit::TestSuite *suite(); -}; - -#endif /* _QA_HOWTO_H_ */ diff --git a/gr-howto-write-a-block/lib/qa_square2_ff.cc b/gr-howto-write-a-block/lib/qa_square2_ff.cc deleted file mode 100644 index 672e75691b..0000000000 --- a/gr-howto-write-a-block/lib/qa_square2_ff.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "qa_square2_ff.h" -#include <cppunit/TestAssert.h> - -#include <vector> -#include <gr_top_block.h> -#include <gr_vector_source_f.h> -#include <gr_vector_sink_f.h> -#include <howto/square2_ff.h> - -namespace gr { - namespace howto { - - void - qa_square2_ff::t1() - { - std::vector<float> data(5,0); - std::vector<float> result(5,0); - std::vector<float> output(5,0); - for(size_t i = 0; i < data.size(); i++) { - data[i] = i; - result[i] = i*i; - } - - gr_top_block_sptr tb = gr_make_top_block("dial_tone"); - gr_vector_source_f_sptr src = gr_make_vector_source_f(data); - gr_vector_sink_f_sptr snk = gr_make_vector_sink_f(); - - square2_ff::sptr op = square2_ff::make(); - - tb->connect(src, 0, op, 0); - tb->connect(op, 0, snk, 0); - tb->run(); - - output = snk->data(); - - for(size_t i = 0; i < data.size(); i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(output[i], result[i], 0.0001); - } - } - - } /* namespace howto */ -} /* namespace gr */ diff --git a/gr-howto-write-a-block/lib/qa_square2_ff.h b/gr-howto-write-a-block/lib/qa_square2_ff.h deleted file mode 100644 index 5260cabda9..0000000000 --- a/gr-howto-write-a-block/lib/qa_square2_ff.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_SQUARE2_FF_H_ -#define _QA_SQUARE2_FF_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -namespace gr { - namespace howto { - - class qa_square2_ff : public CppUnit::TestCase - { - public: - CPPUNIT_TEST_SUITE(qa_square2_ff); - CPPUNIT_TEST(t1); - CPPUNIT_TEST_SUITE_END(); - - private: - void t1(); - }; - - } /* namespace howto */ -} /* namespace gr */ - -#endif /* _QA_SQUARE2_FF_H_ */ diff --git a/gr-howto-write-a-block/lib/qa_square_ff.cc b/gr-howto-write-a-block/lib/qa_square_ff.cc deleted file mode 100644 index dedd934e16..0000000000 --- a/gr-howto-write-a-block/lib/qa_square_ff.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "qa_square_ff.h" -#include <cppunit/TestAssert.h> - -#include <vector> -#include <gr_top_block.h> -#include <gr_vector_source_f.h> -#include <gr_vector_sink_f.h> -#include <howto/square_ff.h> - -namespace gr { - namespace howto { - - void - qa_square_ff::t1() - { - std::vector<float> data(5,0); - std::vector<float> result(5,0); - std::vector<float> output(5,0); - for(size_t i = 0; i < data.size(); i++) { - data[i] = i; - result[i] = i*i; - } - - gr_top_block_sptr tb = gr_make_top_block("dial_tone"); - gr_vector_source_f_sptr src = gr_make_vector_source_f(data); - gr_vector_sink_f_sptr snk = gr_make_vector_sink_f(); - - square_ff::sptr op = square_ff::make(); - - tb->connect(src, 0, op, 0); - tb->connect(op, 0, snk, 0); - tb->run(); - - output = snk->data(); - - for(size_t i = 0; i < data.size(); i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(output[i], result[i], 0.0001); - } - } - - } /* namespace howto */ -} /* namespace gr */ diff --git a/gr-howto-write-a-block/lib/qa_square_ff.h b/gr-howto-write-a-block/lib/qa_square_ff.h deleted file mode 100644 index eed699b0be..0000000000 --- a/gr-howto-write-a-block/lib/qa_square_ff.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_SQUARE_FF_H_ -#define _QA_SQUARE_FF_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -namespace gr { - namespace howto { - - class qa_square_ff : public CppUnit::TestCase - { - public: - CPPUNIT_TEST_SUITE(qa_square_ff); - CPPUNIT_TEST(t1); - CPPUNIT_TEST_SUITE_END(); - - private: - void t1(); - }; - - } /* namespace howto */ -} /* namespace gr */ - -#endif /* _QA_SQUARE_FF_H_ */ diff --git a/gr-howto-write-a-block/lib/square2_ff_impl.cc b/gr-howto-write-a-block/lib/square2_ff_impl.cc deleted file mode 100644 index f508a6e05b..0000000000 --- a/gr-howto-write-a-block/lib/square2_ff_impl.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * config.h is generated by configure. It contains the results - * of probing for features, options etc. It should be the first - * file included in your .cc file. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "square2_ff_impl.h" -#include <gr_io_signature.h> - -namespace gr { - namespace howto { - - /* - * Create a new instance of howto_square2_ff and return a boost - * shared_ptr. This is effectively the public constructor. - */ - square2_ff::sptr - square2_ff::make() - { - return gnuradio::get_initial_sptr - (new square2_ff_impl()); - } - - /* - * Specify constraints on number of input and output streams. - * This info is used to construct the input and output signatures - * (2nd & 3rd args to gr_block's constructor). The input and - * output signatures are used by the runtime system to check that - * a valid number and type of inputs and outputs are connected to - * this block. In this case, we accept only 1 input and 1 output. - */ - static const int MIN_IN = 1; // mininum number of input streams - static const int MAX_IN = 1; // maximum number of input streams - static const int MIN_OUT = 1; // minimum number of output streams - static const int MAX_OUT = 1; // maximum number of output streams - - /* - * The private constructor - */ - square2_ff_impl::square2_ff_impl() - : gr_sync_block("square2_ff", - gr_make_io_signature(MIN_IN, MAX_IN, sizeof(float)), - gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof(float))) - { - // nothing else required in this example - } - - /* - * Our virtual destructor. - */ - square2_ff_impl::~square2_ff_impl() - { - // nothing else required in this example - } - - int - square2_ff_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const float *in = (const float*)input_items[0]; - float *out = (float*)output_items[0]; - - for(int i = 0; i < noutput_items; i++) { - out[i] = in[i] * in[i]; - } - - // Tell runtime system how many output items we produced. - return noutput_items; - } - - } /* namespace howto */ -} /* namespace gr */ diff --git a/gr-howto-write-a-block/lib/square2_ff_impl.h b/gr-howto-write-a-block/lib/square2_ff_impl.h deleted file mode 100644 index 1f7ca7ab37..0000000000 --- a/gr-howto-write-a-block/lib/square2_ff_impl.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_HOWTO_SQUARE2_FF_IMPL_H -#define INCLUDED_HOWTO_SQUARE2_FF_IMPL_H - -#include <howto/square2_ff.h> -#include <gr_sync_block.h> - -namespace gr { - namespace howto { - - class square2_ff_impl : public square2_ff - { - private: - // Nothing to declare in this block. - - public: - square2_ff_impl(); // implementation constructor - ~square2_ff_impl(); // implementation destructor - - // Where all the action really happens - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace howto -} // namespace gr - -#endif /* INCLUDED_HOWTO_SQUARE2_FF_IMPL_H */ diff --git a/gr-howto-write-a-block/lib/square_ff_impl.cc b/gr-howto-write-a-block/lib/square_ff_impl.cc deleted file mode 100644 index d49f72da1e..0000000000 --- a/gr-howto-write-a-block/lib/square_ff_impl.cc +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * config.h is generated by configure. It contains the results - * of probing for features, options etc. It should be the first - * file included in your .cc file. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "square_ff_impl.h" -#include <gr_io_signature.h> - -namespace gr { - namespace howto { - - /* - * Create a new instance of howto_square_ff and return a boost - * shared_ptr. This is effectively the public constructor. - */ - square_ff::sptr - square_ff::make() - { - return gnuradio::get_initial_sptr - (new square_ff_impl()); - } - - /* - * Specify constraints on number of input and output streams. - * This info is used to construct the input and output signatures - * (2nd & 3rd args to gr_block's constructor). The input and - * output signatures are used by the runtime system to - * check that a valid number and type of inputs and outputs - * are connected to this block. In this case, we accept - * only 1 input and 1 output. - */ - static const int MIN_IN = 1; // mininum number of input streams - static const int MAX_IN = 1; // maximum number of input streams - static const int MIN_OUT = 1; // minimum number of output streams - static const int MAX_OUT = 1; // maximum number of output streams - - /* - * The private constructor - */ - square_ff_impl::square_ff_impl() - : gr_block("square_ff", - gr_make_io_signature(MIN_IN, MAX_IN, sizeof(float)), - gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof(float))) - { - // nothing else required in this example - } - - /* - * Our virtual destructor. - */ - square_ff_impl::~square_ff_impl() - { - // nothing else required in this example - } - - int - square_ff_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const float *in = (const float*)input_items[0]; - float *out = (float*)output_items[0]; - - for(int i = 0; i < noutput_items; i++) { - out[i] = in[i] * in[i]; - } - - // Tell runtime system how many input items we consumed on - // each input stream. - - consume_each(noutput_items); - - // Tell runtime system how many output items we produced. - return noutput_items; - } - - } /* namespace howto */ -} /* namespace gr */ diff --git a/gr-howto-write-a-block/lib/square_ff_impl.h b/gr-howto-write-a-block/lib/square_ff_impl.h deleted file mode 100644 index 2f0963423a..0000000000 --- a/gr-howto-write-a-block/lib/square_ff_impl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_HOWTO_SQUARE_FF_IMPL_H -#define INCLUDED_HOWTO_SQUARE_FF_IMPL_H - -#include <howto/square_ff.h> -#include <gr_block.h> - -namespace gr { - namespace howto { - - class square_ff_impl : public square_ff - { - private: - // Nothing to declare in this block. - - public: - square_ff_impl(); // implementation constructor - ~square_ff_impl(); // implementation destructor - - // Where all the action really happens - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace howto -} // namespace gr - -#endif /* INCLUDED_HOWTO_SQUARE_FF_IMPL_H */ diff --git a/gr-howto-write-a-block/lib/test_howto.cc b/gr-howto-write-a-block/lib/test_howto.cc deleted file mode 100644 index bf344265d7..0000000000 --- a/gr-howto-write-a-block/lib/test_howto.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 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 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <cppunit/TextTestRunner.h> -#include <cppunit/XmlOutputter.h> - -#include <gr_unittests.h> -#include "qa_howto.h" -#include <iostream> - -int -main (int argc, char **argv) -{ - CppUnit::TextTestRunner runner; - std::ofstream xmlfile(get_unittest_path("howto.xml").c_str()); - CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); - - runner.addTest(qa_howto::suite()); - runner.setOutputter(xmlout); - - bool was_successful = runner.run("", false); - - return was_successful ? 0 : 1; -} |