AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
+
+TESTS = test_gruel
+
+noinst_PROGRAMS = test_gruel
+
+
lib_LTLIBRARIES = libgruel.la
# magic flags
$(PMT_LIB) \
$(MSG_LIB) \
-lstdc++
+
+
+# ----------------------------------------------------------------
+
+test_gruel_SOURCES = test_gruel.cc
+test_gruel_LDADD = libgruel.la pmt/libpmt-qa.la
+
AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
-TESTS = test_pmt
noinst_LTLIBRARIES = libpmt.la
$(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
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
////////////////////////////////////////////////////////////////////////////
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(){}
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);
}
// ------------------------------------------------------------------------
+++ /dev/null
-/* -*- 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;
-}
--- /dev/null
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,2009 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 "pmt/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;
+}