mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 13:47:10 +01:00
Fixed issue 2945 (#2946)
* Fixed #2945 * Added unit tests for #2945 * Dissalow iterator on empty Var (#2945) * Updated unit tests for #2945 * More concise unit tests for #2945 * Removed some more clutter (#2945)
This commit is contained in:
@@ -2973,8 +2973,15 @@ void VarTest::testEmpty()
|
||||
void VarTest::testIterator()
|
||||
{
|
||||
Var da;
|
||||
assertTrue (da.isEmpty());
|
||||
assertTrue (da.begin() == da.end());
|
||||
try
|
||||
{
|
||||
auto it = da.begin();
|
||||
fail("calling begin() on empty Var must throw");
|
||||
}
|
||||
catch (const InvalidAccessException&) { }
|
||||
|
||||
da = Poco::Dynamic::Array();
|
||||
assertTrue(da.begin() == da.end());
|
||||
|
||||
da = 1;
|
||||
assertTrue (!da.isEmpty());
|
||||
|
||||
Reference in New Issue
Block a user