summaryrefslogtreecommitdiff
path: root/gruel/src/lib/pmt
diff options
context:
space:
mode:
authorEric Blossom2009-08-18 18:57:33 -0700
committerEric Blossom2009-08-18 18:57:33 -0700
commitf7bc7ed21decef03737effa69402d127e1cb54d9 (patch)
treec764f692c75ee8bf8fc12fced2e84ca6347bd335 /gruel/src/lib/pmt
parent0f90ae17548c89a9ccde112948a6b57b54c2a01c (diff)
downloadgnuradio-f7bc7ed21decef03737effa69402d127e1cb54d9.tar.gz
gnuradio-f7bc7ed21decef03737effa69402d127e1cb54d9.tar.bz2
gnuradio-f7bc7ed21decef03737effa69402d127e1cb54d9.zip
QA code now works.
Diffstat (limited to 'gruel/src/lib/pmt')
-rw-r--r--gruel/src/lib/pmt/Makefile.am9
-rw-r--r--gruel/src/lib/pmt/pmt.cc8
-rw-r--r--gruel/src/lib/pmt/qa_pmt_prims.cc7
-rw-r--r--gruel/src/lib/pmt/test_pmt.cc37
4 files changed, 9 insertions, 52 deletions
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/pmt/test_pmt.cc
deleted file mode 100644
index 034785f4e..000000000
--- a/gruel/src/lib/pmt/test_pmt.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 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 <qa_pmt.h>
-
-int
-main(int argc, char **argv)
-{
-
- CppUnit::TextTestRunner runner;
-
- runner.addTest(qa_pmt::suite ());
-
- bool was_successful = runner.run("", false);
-
- return was_successful ? 0 : 1;
-}