diff --git a/coding/coding_tests/dd_vector_test.cpp b/coding/coding_tests/dd_vector_test.cpp index a166d6bd14..9eadfb87b2 100644 --- a/coding/coding_tests/dd_vector_test.cpp +++ b/coding/coding_tests/dd_vector_test.cpp @@ -22,3 +22,22 @@ UNIT_TEST(DDVector) for (size_t i = 0; i < v.size(); ++i, ++it) TEST_EQUAL(v[i], *it, ()); } + +UNIT_TEST(DDVector_IncorrectSize) +{ + typedef DDVector Vector; + char const data[] = "ab"; + MemReader reader(data, ARRAY_SIZE(data)); + + bool exceptionCaught = false; + try + { + Vector v(reader); + } + catch (Vector::OpenException & e) + { + exceptionCaught = true; + } + + TEST(exceptionCaught, ()); +}