summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-10 06:57:05 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-10 06:57:05 (GMT)
commitf16009ca8d5f281ab846a57426b90148f1fac338 (patch)
treeaf0aef4c4aa4486a2f63bf9e8d2de6d42e579c7c
parent1dbf2f02d2db25ad22fb489e9b88a4e87c48ab0e (diff)
Compare clone
-rw-r--r--autotests/attributetest.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/autotests/attributetest.cpp b/autotests/attributetest.cpp
index 47282e5..cf28e50 100644
--- a/autotests/attributetest.cpp
+++ b/autotests/attributetest.cpp
@@ -176,9 +176,12 @@ void AttributeTest::testSerialization()
QCOMPARE(beh, a->sentBehaviour());
QCOMPARE(id, a->moveToCollection().id());
QCOMPARE(sendSilently, a->sendSilently());
+ SentBehaviourAttribute *copy = a->clone();
+ QCOMPARE(copy->sentBehaviour(), beh);
+ QCOMPARE(copy->moveToCollection().id(), id);
+ QCOMPARE(copy->sendSilently(), sendSilently);
delete a;
- SentBehaviourAttribute::SentBehaviour copy = beh;
- QCOMPARE(beh, copy);
+ delete copy;
}
//Delete + silently
@@ -196,9 +199,13 @@ void AttributeTest::testSerialization()
//When delete we move to -1
QCOMPARE(a->moveToCollection().id(), -1);
QCOMPARE(sendSilently, a->sendSilently());
+ SentBehaviourAttribute *copy = a->clone();
+ QCOMPARE(copy->sentBehaviour(), beh);
+ //When delete we move to -1
+ QCOMPARE(copy->moveToCollection().id(), -1);
+ QCOMPARE(copy->sendSilently(), sendSilently);
delete a;
- SentBehaviourAttribute::SentBehaviour copy = beh;
- QCOMPARE(beh, copy);
+ delete copy;
}
//MoveToDefaultSentCollection + silently
@@ -216,10 +223,13 @@ void AttributeTest::testSerialization()
//When movetodefaultsendCollection we move to -1
QCOMPARE(a->moveToCollection().id(), -1);
QCOMPARE(sendSilently, a->sendSilently());
+ SentBehaviourAttribute *copy = a->clone();
+ QCOMPARE(copy->sentBehaviour(), beh);
+ //When movetodefaultsendCollection we move to -1
+ QCOMPARE(copy->moveToCollection().id(), -1);
+ QCOMPARE(copy->sendSilently(), sendSilently);
delete a;
- SentBehaviourAttribute::SentBehaviour copy = beh;
- QCOMPARE(beh, copy);
-
+ delete copy;
}
{