Commit d5948bc4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotest

parent 4e5c0984
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment