From 7d449043818864fa94cd1c29ade71f06abd7ce0a Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Thu, 6 Aug 2015 14:05:15 +0200 Subject: Add test for negative list length --- test/read_test.cpp | 7 +++++++ test/testfiles/errortest_neg_length | Bin 0 -> 47 bytes 2 files changed, 7 insertions(+) create mode 100644 test/testfiles/errortest_neg_length (limited to 'test') diff --git a/test/read_test.cpp b/test/read_test.cpp index 85970fc069..a45d74b1f6 100644 --- a/test/read_test.cpp +++ b/test/read_test.cpp @@ -167,6 +167,13 @@ void test_read_errors() ASSERT(file); EXPECT_EXCEPTION(reader.read_tag(), io::input_error); ASSERT(!file); + + //Negative list length + file.close(); + file.open("errortest_neg_length", std::ios::binary); + ASSERT(file); + EXPECT_EXCEPTION(reader.read_tag(), io::input_error); + ASSERT(!file); } int main() diff --git a/test/testfiles/errortest_neg_length b/test/testfiles/errortest_neg_length new file mode 100644 index 0000000000..228de89545 Binary files /dev/null and b/test/testfiles/errortest_neg_length differ -- cgit 0.0.5-2-1-g0f52