kabc Library: testread2.cpp Source File (kabc Library)

| # kabc Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# testread2.cpp

    00001 #include "testutils.h"
    00002 #include <kabc/addressee.h>
    00003 #include <vcardconverter.h>
    00004 #include <kdebug.h>
    00005
    00006 using namespace KABC;
    00007
    00008 int
    00009 main()
    00010 {
    00011     Addressee::List l = vCardsAsAddresseeList();
    00012     QString vcards = vCardsAsText();
    00013
    00014     VCardConverter vct;
    00015
    00016     Addressee::List parsed = vct.parseVCards( vcards );
    00017
    00018     if ( l.size() != parsed.size() ) {
    00019         kdDebug()<<"\tSize - FAILED : "<<l.size()<<" vs. parsed "<<parsed.size()<<endl;
    00020     } else {
    00021         kdDebug()<<"\tSize - PASSED"<<endl;
    00022     }
    00023
    00024     Addressee::List::iterator itr1;
    00025     Addressee::List::iterator itr2;
    00026     for ( itr1 = l.begin(), itr2 = parsed.begin();
    00027           itr1 != l.end(); ++itr1, ++itr2 ) {
    00028         if ( (*itr1).fullEmail() == (*itr2).fullEmail() &&
    00029              (*itr1).organization() == (*itr2).organization() &&
    00030              (*itr1).phoneNumbers() == (*itr2).phoneNumbers()  &&
    00031              (*itr1).emails() == (*itr2).emails() &&
    00032              (*itr1).role() == (*itr2).role()  ) {
    00033             kdDebug()<<"\tAddressee  - PASSED"<<endl;
    00034             kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
    00035         } else {
    00036             kdDebug()<<"\tAddressee  - FAILED"<<endl;
    00037             (*itr1).dump();
    00038             (*itr2).dump();
    00039             //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
    00040         }
    00041     }
    00042 }

This file is part of the documentation for kabc Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:31:31 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003