Just comparing the constData() of two QBAs fails to check the sizes
match, and only compares up to the first '\0' byte; but QCOMPARE()
will also check size and checks all bytes. It's also perfectly capable
of comparing a QBAV to a C string literal (by turning the latter into
a QBAV), so save some allocations by doing that. Some tests were
overtly comparing both size() and constData(), but of course the
latter still only compared up to the first '\0' byte, still. So also
replace such pairs with a straight QGA comparison.
One test genuinely used a constData() comparison because it was
testing streaming of the constData(), so hadn't streamed size info and
thus wasn't reading it back again. Record that this is why that one
remains testing constData(), to save future readers wondering.
At the same time, test a QBuffer's (read-only) .data() in preference
to its (mutable) .buffer(), so it's clear (because we use the latter)
when we actually need mutating access to the raw data. (One test does,
with .buffer().clear(), indeed do that.)
Change-Id: I2b565469456bde9c003894abc8128ec5bc38a370
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>