mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 22:56:19 +01:00
Poco::Var operator== throws exception #769
This commit is contained in:
parent
d495abd4b1
commit
e26d1ffa13
@ -255,7 +255,7 @@ const Var Var::operator -- (int)
|
|||||||
|
|
||||||
bool Var::operator == (const Var& other) const
|
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;
|
if (isEmpty() && other.isEmpty()) return true;
|
||||||
return convert<std::string>() == other.convert<std::string>();
|
return convert<std::string>() == other.convert<std::string>();
|
||||||
}
|
}
|
||||||
|
@ -2465,6 +2465,11 @@ void VarTest::testEmpty()
|
|||||||
assert (da == da);
|
assert (da == da);
|
||||||
assert (!(da != da));
|
assert (!(da != da));
|
||||||
|
|
||||||
|
assert (da != Var(1));
|
||||||
|
assert (!(da == Var(1)));
|
||||||
|
assert (Var(1) != da);
|
||||||
|
assert (!(Var(1) == da));
|
||||||
|
|
||||||
da = "123";
|
da = "123";
|
||||||
int i = da.convert<int>();
|
int i = da.convert<int>();
|
||||||
assert (123 == i);
|
assert (123 == i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user