gnuradio / pmt

pmt
GNU Lesser General Public License v3.0
11 stars 11 forks source link

PMT wrapping an empty pmt vector fails #16

Closed mormj closed 2 years ago

mormj commented 2 years ago

The following test fails when templated for std::complex

TYPED_TEST(PmtVectorFixture, PmtVectorNull)
{
    auto pmtw = pmt_wrap(pmt_vector<TypeParam>({}));
}

The failure is deep in the flatbuffers code

qa_pmt_vector: /usr/local/include/flatbuffers/flatbuffers.h:351: flatbuffers::Vector<T>::mutable_return_type flatbuffers::Vector<T>::GetMutableObject(flatbuffers::uoffset_t) const [with T = const pmtf::Complex64*; flatbuffers::Vector<T>::mutable_return_type = pmtf::Complex64*; flatbuffers::uoffset_t = unsigned int]: Assertion `i < size()' failed.

So there is a problem with pmt wrapping an empty pmt_vector, but only with std::complex

This works fine:

auto pmtv = pmt_vector<TypeParam>({});
mormj commented 2 years ago

closed with https://github.com/gnuradio/pmt/pull/17