Test ownership also for BinaryWriter class
This commit is contained in:
parent
1d4a4bd2be
commit
f2b8ee4184
|
@ -223,6 +223,15 @@ void IoTests::testBinaryWriter()
|
||||||
for (char c : testData) {
|
for (char c : testData) {
|
||||||
CPPUNIT_ASSERT(c == static_cast<char>(testFile.get()));
|
CPPUNIT_ASSERT(c == static_cast<char>(testFile.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test ownership
|
||||||
|
writer.setStream(nullptr, true);
|
||||||
|
writer.setStream(new fstream(), true);
|
||||||
|
BinaryWriter writer2(writer);
|
||||||
|
CPPUNIT_ASSERT(writer2.stream() == writer.stream());
|
||||||
|
CPPUNIT_ASSERT(!writer2.hasOwnership());
|
||||||
|
writer.setStream(&testFile, false);
|
||||||
|
writer.setStream(new fstream(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue