Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 8eefa22d authored by Laurent Montel's avatar Laurent Montel 😁

Add unittest for Addressee::parseEmailAddress to compare with new version in kcontact

parent ede66996
......@@ -453,3 +453,26 @@ void AddresseeTest::customFieldsTest()
c.removeCustom( QLatin1String( "FirstApp" ), QLatin1String( "FirstKey" ) );
QCOMPARE( c.customs().count(), 2 );
void AddresseeTest::parseEmailAddress_data()
QTest::newRow("simpleemail") << QString(QLatin1String("")) << QString(QLatin1String("")) << QString();
QTest::newRow("email") << QString(QLatin1String("foo <>")) << QString(QLatin1String("")) << QString(QLatin1String("foo"));
void AddresseeTest::parseEmailAddress()
QFETCH(QString, inputEmail);
QFETCH(QString, email);
QFETCH(QString, name);
QString parsedName;
QString parsedEmail;
KABC::Addressee::parseEmailAddress(inputEmail, parsedName, parsedEmail);
QCOMPARE(parsedEmail, email);
QCOMPARE(parsedName, name);
......@@ -37,6 +37,9 @@ class AddresseeTest : public QObject
void fullEmailTest();
void nameFromStringTest();
void customFieldsTest();
void parseEmailAddress_data();
void parseEmailAddress();
Markdown is supported
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