Poco::Var operator== throws exception #769

This commit is contained in:
Alex Fabijanic 2015-04-03 10:37:07 -05:00
parent d495abd4b1
commit e26d1ffa13
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

@ -2465,6 +2465,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));
da = "123";
int i = da.convert<int>();
assert (123 == i);