summaryrefslogtreecommitdiffstats
path: root/tests/auto/qvariant/tst_qvariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qvariant/tst_qvariant.cpp')
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 62babdb..fef7ec2 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -3232,18 +3232,21 @@ struct MyData
{
void *ptr;
MyData() : ptr(this) {}
- ~MyData() { Q_ASSERT(ptr == this); }
+ ~MyData()
+ {
+ if (ptr != this) qWarning("MyData::~MyData(): object has moved");
+ }
MyData(const MyData& o) : ptr(this) { Q_ASSERT(o.ptr == &o); }
MyData &operator=(const MyData &o)
{
- Q_ASSERT(ptr == this);
- Q_ASSERT(o.ptr == &o);
+ if (ptr != this) qWarning("MyData::operator=(): object has moved");
+ if (o.ptr != &o) qWarning("MyData::operator=(): other object has moved");
return *this;
}
bool operator==(const MyData &o) const
{
- Q_ASSERT(ptr == this);
- Q_ASSERT(o.ptr == &o);
+ if (ptr != this) qWarning("MyData::operator==(): object has moved");
+ if (o.ptr != &o) qWarning("MyData::operator==(): other object has moved");
return true;
}
};