summaryrefslogtreecommitdiff
path: root/unittests/Support/StreamingMemoryObject.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-05-27 18:44:32 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-05-27 18:44:32 +0000
commit5a5ac124e1efaf208671f01c46edb15f29ed2a0b (patch)
treea6140557876943cdd800ee997c9317283394b22c /unittests/Support/StreamingMemoryObject.cpp
parentf03b5bed27d0d2eafd68562ce14f8b5e3f1f0801 (diff)
Diffstat (limited to 'unittests/Support/StreamingMemoryObject.cpp')
-rw-r--r--unittests/Support/StreamingMemoryObject.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Support/StreamingMemoryObject.cpp b/unittests/Support/StreamingMemoryObject.cpp
index 20136491ab8bd..c043efbb5e473 100644
--- a/unittests/Support/StreamingMemoryObject.cpp
+++ b/unittests/Support/StreamingMemoryObject.cpp
@@ -27,3 +27,12 @@ TEST(StreamingMemoryObject, Test) {
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);
+ EXPECT_EQ((uint64_t) 8, O.readBytes(Buf, 16, 16));
+}