diff options
Diffstat (limited to 'gruel')
-rw-r--r-- | gruel/src/lib/Makefile.am | 13 | ||||
-rw-r--r-- | gruel/src/lib/pmt/Makefile.am | 9 | ||||
-rw-r--r-- | gruel/src/lib/pmt/pmt.cc | 8 | ||||
-rw-r--r-- | gruel/src/lib/pmt/qa_pmt_prims.cc | 7 | ||||
-rw-r--r-- | gruel/src/lib/test_gruel.cc (renamed from gruel/src/lib/pmt/test_pmt.cc) | 4 |
5 files changed, 24 insertions, 17 deletions
diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am index 6dfb6787c..9afa0d292 100644 --- a/gruel/src/lib/Makefile.am +++ b/gruel/src/lib/Makefile.am @@ -25,6 +25,12 @@ SUBDIRS = pmt msg AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES) + +TESTS = test_gruel + +noinst_PROGRAMS = test_gruel + + lib_LTLIBRARIES = libgruel.la # magic flags @@ -47,3 +53,10 @@ libgruel_la_LIBADD = \ $(PMT_LIB) \ $(MSG_LIB) \ -lstdc++ + + +# ---------------------------------------------------------------- + +test_gruel_SOURCES = test_gruel.cc +test_gruel_LDADD = libgruel.la pmt/libpmt-qa.la + diff --git a/gruel/src/lib/pmt/Makefile.am b/gruel/src/lib/pmt/Makefile.am index 2b710a598..8750cbdf8 100644 --- a/gruel/src/lib/pmt/Makefile.am +++ b/gruel/src/lib/pmt/Makefile.am @@ -23,7 +23,6 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES) -TESTS = test_pmt noinst_LTLIBRARIES = libpmt.la @@ -90,14 +89,6 @@ libpmt_qa_la_LIBADD = \ $(CPPUNIT_LIBS) \ -lstdc++ -noinst_PROGRAMS = \ - test_pmt - - -LIBPMTQA = libpmt-qa.la - -test_pmt_SOURCES = test_pmt.cc -test_pmt_LDADD = $(LIBPMTQA) # Do creation and inclusion of other Makefiles last diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc index 5301529b2..42f25b9de 100644 --- a/gruel/src/lib/pmt/pmt.cc +++ b/gruel/src/lib/pmt/pmt.cc @@ -907,11 +907,15 @@ pmt_make_msg_accepter(gruel::msg_accepter_sptr ma) gruel::msg_accepter_sptr pmt_msg_accepter_ref(const pmt_t &obj) { - return boost::any_cast<gruel::msg_accepter_sptr>(pmt_any_ref(obj)); + try { + return boost::any_cast<gruel::msg_accepter_sptr>(pmt_any_ref(obj)); + } + catch (boost::bad_any_cast &e){ + throw pmt_wrong_type("pmt_msg_accepter_ref", obj); + } } - //////////////////////////////////////////////////////////////////////////// // General Functions //////////////////////////////////////////////////////////////////////////// diff --git a/gruel/src/lib/pmt/qa_pmt_prims.cc b/gruel/src/lib/pmt/qa_pmt_prims.cc index 2c66b8fdb..e2d6ec4c6 100644 --- a/gruel/src/lib/pmt/qa_pmt_prims.cc +++ b/gruel/src/lib/pmt/qa_pmt_prims.cc @@ -456,9 +456,9 @@ qa_pmt_prims::test_any() class qa_pmt_msg_accepter_nop : public gruel::msg_accepter { public: - qa_pmt_msg_accepter_nop(); + qa_pmt_msg_accepter_nop(){}; ~qa_pmt_msg_accepter_nop(); - void post(pmt_t) { }; + void post(pmt_t){}; }; qa_pmt_msg_accepter_nop::~qa_pmt_msg_accepter_nop(){} @@ -478,8 +478,7 @@ qa_pmt_prims::test_msg_accepter() CPPUNIT_ASSERT_EQUAL(ma0.get(), pmt_msg_accepter_ref(p1).get()); CPPUNIT_ASSERT_THROW(pmt_msg_accepter_ref(sym), pmt_wrong_type); - CPPUNIT_ASSERT_THROW(pmt_msg_accepter_ref(p0), pmt_wrong_type); // FIXME - + CPPUNIT_ASSERT_THROW(pmt_msg_accepter_ref(p0), pmt_wrong_type); } // ------------------------------------------------------------------------ diff --git a/gruel/src/lib/pmt/test_pmt.cc b/gruel/src/lib/test_gruel.cc index 034785f4e..669303447 100644 --- a/gruel/src/lib/pmt/test_pmt.cc +++ b/gruel/src/lib/test_gruel.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,7 +21,7 @@ */ #include <cppunit/TextTestRunner.h> -#include <qa_pmt.h> +#include "pmt/qa_pmt.h" int main(int argc, char **argv) |