diff options
Diffstat (limited to 'gnuradio-runtime/lib/pmt/qa_pmt_prims.cc')
-rw-r--r-- | gnuradio-runtime/lib/pmt/qa_pmt_prims.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc index 2f46b014db..2b3ca32293 100644 --- a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc +++ b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc @@ -125,6 +125,15 @@ qa_pmt_prims::test_reals() CPPUNIT_ASSERT_EQUAL(-1.0, pmt::to_double(m1)); CPPUNIT_ASSERT_EQUAL(1.0, pmt::to_double(p1)); CPPUNIT_ASSERT_EQUAL(1.0, pmt::to_double(pmt::from_long(1))); + + pmt::pmt_t p2 = pmt::from_float(1); + pmt::pmt_t m2 = pmt::from_float(-1); + CPPUNIT_ASSERT(pmt::is_real(p2)); + CPPUNIT_ASSERT(pmt::is_real(m2)); + CPPUNIT_ASSERT_THROW(pmt::to_float(pmt::PMT_T), pmt::wrong_type); + CPPUNIT_ASSERT_EQUAL(float(-1.0), pmt::to_float(m2)); + CPPUNIT_ASSERT_EQUAL(float(1.0), pmt::to_float(p2)); + CPPUNIT_ASSERT_EQUAL(float(1.0), pmt::to_float(pmt::from_long(1))); } void |