1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Fix memory leak in unit test of Bitcode/BitReaderTest.cpp

Fixes obvious memory leak in test
TestForEofAfterReadFailureOnDataStreamer.  Also removes constexpr use
from same test.

Patch by Karl Schimpf.

Differential Revision: http://reviews.llvm.org/D11735

llvm-svn: 243904
This commit is contained in:
Derek Schuff 2015-08-03 21:23:51 +00:00
parent beb716ec99
commit 499fede2fc

View File

@ -118,10 +118,12 @@ TEST(BitReaderTest, TestForEofAfterReadFailureOnDataStreamer) {
// Jump to two bytes before end of stream.
Cursor.JumpToBit((InputSize - 4) * CHAR_BIT);
// Try to read 4 bytes when only 2 are present, resulting in error value 0.
constexpr size_t ReadErrorValue = 0;
const size_t ReadErrorValue = 0;
EXPECT_EQ(ReadErrorValue, Cursor.Read(32));
// Should be at eof now.
EXPECT_TRUE(Cursor.AtEndOfStream());
delete[] Text;
}
TEST(BitReaderTest, MateralizeForwardRefWithStream) {