forked from organicmaps/organicmaps
Add a unit test for incorrect DDVector size.
This commit is contained in:
parent
dfb2db05de
commit
0b94624aa9
1 changed files with 19 additions and 0 deletions
|
@ -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<uint16_t, MemReader> 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, ());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue