Index: unittests/Support/StreamingMemoryObject.cpp =================================================================== --- unittests/Support/StreamingMemoryObject.cpp +++ unittests/Support/StreamingMemoryObject.cpp @@ -27,3 +27,13 @@ StreamingMemoryObject O(DS); EXPECT_TRUE(O.isValidAddress(32 * 1024)); } + +TEST(StreamingMemoryObject, TestSetKnownObjectSize) { + auto *DS = new NullDataStreamer(); + StreamingMemoryObject O(DS); + uint8_t Buf[32]; + EXPECT_EQ((uint64_t) 16, O.readBytes(Buf, 16, 0)); + O.setKnownObjectSize(24); + // TODO: Fix so that the following returns 8. + EXPECT_EQ((uint64_t) 16, O.readBytes(Buf, 16, 16)); +}