mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 21:40:36 -04:00
new msg items to store srcid/from address for rs messages
also updated tests for new rsitems git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3594 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cfa10c6f80
commit
9bdf222418
4 changed files with 224 additions and 1 deletions
|
@ -104,6 +104,14 @@ RsSerialType* init_item(RsMsgTags& mt)
|
|||
return new RsMsgSerialiser();
|
||||
}
|
||||
|
||||
RsSerialType* init_item(RsMsgSrcId& ms)
|
||||
{
|
||||
ms.msgId = rand()%434;
|
||||
randString(SHORT_STR, ms.srcId);
|
||||
|
||||
return new RsMsgSerialiser();
|
||||
}
|
||||
|
||||
|
||||
bool operator ==(const RsChatMsgItem& cmiLeft,const RsChatMsgItem& cmiRight)
|
||||
{
|
||||
|
@ -182,6 +190,14 @@ bool operator ==(const RsMsgTags& mtLeft, const RsMsgTags& mtRight)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool operator ==(const RsMsgSrcId& msLeft, const RsMsgSrcId& msRight)
|
||||
{
|
||||
if(msLeft.msgId != msRight.msgId) return false;
|
||||
if(msLeft.srcId != msRight.srcId) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsChatMsgItem");
|
||||
|
@ -190,6 +206,7 @@ int main()
|
|||
test_RsItem<RsMsgItem >(); REPORT("Serialise/Deserialise RsMsgItem");
|
||||
test_RsItem<RsMsgTagType>(); REPORT("Serialise/Deserialise RsMsgTagType");
|
||||
test_RsItem<RsMsgTags>(); REPORT("Serialise/Deserialise RsMsgTags");
|
||||
test_RsItem<RsMsgSrcId>(); REPORT("Serialise/Deserialise RsMsgSrcId");
|
||||
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ RsSerialType* init_item(RsChatAvatarItem& );
|
|||
RsSerialType* init_item(RsMsgItem& );
|
||||
RsSerialType* init_item(RsMsgTagType& );
|
||||
RsSerialType* init_item(RsMsgTags& );
|
||||
RsSerialType* init_item(RsMsgSrcId& );
|
||||
|
||||
bool operator ==(const RsChatMsgItem& ,const RsChatMsgItem& );
|
||||
bool operator ==(const RsChatStatusItem& , const RsChatStatusItem& );
|
||||
|
@ -44,6 +45,6 @@ bool operator ==(const RsChatAvatarItem&, const RsChatAvatarItem& );
|
|||
bool operator ==(const RsMsgTagType&, const RsMsgTagType& );
|
||||
bool operator ==(const RsMsgTags&, const RsMsgTags& );
|
||||
bool operator ==(const RsMsgItem&, const RsMsgItem& );
|
||||
|
||||
bool operator ==(const RsMsgSrcId&, const RsMsgSrcId& );
|
||||
|
||||
#endif /* MSGITEM_TEST_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue