Poco::Var operator== throws exception #769

This commit is contained in:
Alex Fabijanic
2015-04-03 10:46:07 -05:00
parent fea66f4dbc
commit 25cd53d953
2 changed files with 6 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ const Var Var::operator -- (int)
bool Var::operator == (const Var& other) const
{
if (isEmpty() && !other.isEmpty()) return false;
if (isEmpty() != other.isEmpty()) return false;
if (isEmpty() && other.isEmpty()) return true;
return convert<std::string>() == other.convert<std::string>();
}

View File

@@ -2473,6 +2473,11 @@ void VarTest::testEmpty()
assert (da == da);
assert (!(da != da));
assert (da != Var(1));
assert (!(da == Var(1)));
assert (Var(1) != da);
assert (!(Var(1) == da));
assert (da != "");
assert ("" != da);
assert (!(da == ""));