summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-10 06:35:55 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-10 06:35:55 (GMT)
commitd5948bc4f03fcfd337497d130f6a82e1f66ad7b0 (patch)
treefcb89eeadd3512278331f1ad39af5a095ccfa607
parent4e5c0984944a3d184b7b8315aaded5a1e08d312e (diff)
Add more autotest
-rw-r--r--autotests/attributetest.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/autotests/attributetest.cpp b/autotests/attributetest.cpp
index 1da9a6a..903a759 100644
--- a/autotests/attributetest.cpp
+++ b/autotests/attributetest.cpp
@@ -162,6 +162,7 @@ void AttributeTest::testSerialization()
delete a;
}
+ //MoveToCollection + silently
{
SentBehaviourAttribute::SentBehaviour beh = SentBehaviourAttribute::MoveToCollection;
Collection::Id id = 123456789012345ll;
@@ -178,6 +179,42 @@ void AttributeTest::testSerialization()
delete a;
}
+ //Delete + silently
+ {
+ SentBehaviourAttribute::SentBehaviour beh = SentBehaviourAttribute::Delete;
+ Collection::Id id = 123456789012345ll;
+ SentBehaviourAttribute *a = new SentBehaviourAttribute(beh, Collection(id));
+ bool sendSilently = true;
+ a->setSendSilently(sendSilently);
+ QByteArray data = a->serialized();
+ delete a;
+ a = new SentBehaviourAttribute;
+ a->deserialize(data);
+ QCOMPARE(beh, a->sentBehaviour());
+ //When delete we move to -1
+ QCOMPARE(a->moveToCollection().id(), -1);
+ QCOMPARE(sendSilently, a->sendSilently());
+ delete a;
+ }
+
+ //MoveToDefaultSentCollection + silently
+ {
+ SentBehaviourAttribute::SentBehaviour beh = SentBehaviourAttribute::MoveToDefaultSentCollection;
+ Collection::Id id = 123456789012345ll;
+ SentBehaviourAttribute *a = new SentBehaviourAttribute(beh, Collection(id));
+ bool sendSilently = true;
+ a->setSendSilently(sendSilently);
+ QByteArray data = a->serialized();
+ delete a;
+ a = new SentBehaviourAttribute;
+ a->deserialize(data);
+ QCOMPARE(beh, a->sentBehaviour());
+ //When movetodefaultsendCollection we move to -1
+ QCOMPARE(a->moveToCollection().id(), -1);
+ QCOMPARE(sendSilently, a->sendSilently());
+ delete a;
+ }
+
{
int id = 3219;
TransportAttribute *a = new TransportAttribute(id);