diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch) | |
tree | 5ac38a06f3dde268dc7927dc155896926aaf7012 /kabc/vcardparser/testread2.cpp | |
download | tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kabc/vcardparser/testread2.cpp')
-rw-r--r-- | kabc/vcardparser/testread2.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/kabc/vcardparser/testread2.cpp b/kabc/vcardparser/testread2.cpp new file mode 100644 index 000000000..19a02e3c9 --- /dev/null +++ b/kabc/vcardparser/testread2.cpp @@ -0,0 +1,42 @@ +#include "testutils.h" +#include <kabc/addressee.h> +#include <vcardconverter.h> +#include <kdebug.h> + +using namespace KABC; + +int +main() +{ + Addressee::List l = vCardsAsAddresseeList(); + QString vcards = vCardsAsText(); + + VCardConverter vct; + + Addressee::List parsed = vct.parseVCards( vcards ); + + if ( l.size() != parsed.size() ) { + kdDebug()<<"\tSize - FAILED : "<<l.size()<<" vs. parsed "<<parsed.size()<<endl; + } else { + kdDebug()<<"\tSize - PASSED"<<endl; + } + + Addressee::List::iterator itr1; + Addressee::List::iterator itr2; + for ( itr1 = l.begin(), itr2 = parsed.begin(); + itr1 != l.end(); ++itr1, ++itr2 ) { + if ( (*itr1).fullEmail() == (*itr2).fullEmail() && + (*itr1).organization() == (*itr2).organization() && + (*itr1).phoneNumbers() == (*itr2).phoneNumbers() && + (*itr1).emails() == (*itr2).emails() && + (*itr1).role() == (*itr2).role() ) { + kdDebug()<<"\tAddressee - PASSED"<<endl; + kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; + } else { + kdDebug()<<"\tAddressee - FAILED"<<endl; + (*itr1).dump(); + (*itr2).dump(); + //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; + } + } +} |