mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
Poco::Var operator== throws exception #769
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
|
||||
@@ -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 == ""));
|
||||
|
||||
Reference in New Issue
Block a user