| 136 | } |
| 137 | |
| 138 | void buffer_readAs_customStruct() { |
| 139 | struct Pair { uint16_t a; uint16_t b; }; |
| 140 | QByteArray d(4, '\0'); |
| 141 | Pair orig{0x1111, 0x2222}; |
| 142 | std::memcpy(d.data(), &orig, 4); |
| 143 | BufferProvider p(d); |
| 144 | Pair result = p.readAs<Pair>(0); |
| 145 | QCOMPARE(result.a, (uint16_t)0x1111); |
| 146 | QCOMPARE(result.b, (uint16_t)0x2222); |
| 147 | } |
| 148 | |
| 149 | // --------------------------------------------------------------- |
| 150 | // BufferProvider -- readBytes |
nothing calls this directly
no outgoing calls
no test coverage detected