void CFindTest::DoTestsL() { iTest.Title(); iTest.Start(_L("@SYMTestCaseID:PIM-T-CNTFINDALL-INC049017-0001 CREATING THE DATABASE")); iDb=CContactDatabase::ReplaceL(iDbFileName); iTemplate=STATIC_CAST(CContactTemplate*,iDb->ReadContactL(iDb->TemplateId())); iTest.Next(_L("ADDING COMPACT CONTACTS")); { iLog->LogLine(_L("Adding The Contacts.")); // AddContactCompactL(aFirstName,aLastName,aCompanyName,aWorkPhone, // aHomePhone,& aWorkMobile,aHomeMobile,aWorkEmail) AddContactCompactL(_L("Robert"),_L("Jordan"),_L("Software Solutions"),_L("015672354658"), _L("01617246900"), _L("077962345100"),_L("07785674300"),_L("rj2@software_solutions.com")); AddContactCompactL(_L("Amanda"),_L("Jordan"),_L("Software Solutions"),_L("015672354658"), _L("01617246900"), _L("077962345101"),_L("07785674301"),_L("aj1@software_solutions.com")); AddContactCompactL(_L("Ben"),_L("Turner"),_L("High Res Solutions"),_L("017652354658"), _L("01717246901"), _L("07896543210"),_L("07987654321"),_L("*****@*****.**")); AddContactCompactL(_L("Chris"),_L("Andrews"),_L("Soft Kicks"),_L("1234567890"), _L("01712345678"), _L("07234567890"),_L("07234567891"),_L("*****@*****.**")); } //start of tests for defect where identity fields were not searched when using KUidMatchInAllFields iTest.Next(_L("FINDING CONTACTS BY NAME FROM GIVEN NAME FIELD.")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM GIVEN NAME FIELD.")); FindNameInFirstNameFieldL(_L("Chris"),1); FindNameInFirstNameFieldL(_L("Turner"),0); FindNameInFirstNameFieldL(_L("e"),2); } iTest.Next(_L("FINDING CONTACTS BY NAME FROM FAMILY NAME FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM FAMILY NAME FIELD.")); FindNameInLastNameFieldL(_L("Turner"),1); FindNameInLastNameFieldL(_L("Jordan"),2); FindNameInLastNameFieldL(_L("r"),4); FindNameInLastNameFieldL(_L("Chris"),0); } iTest.Next(_L("FINDING CONTACTS BY NAME FROM ALL FIELDS")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM ALL FIELDS")); FindInAllFieldsL(_L("Ben"),1); FindInAllFieldsL(_L("Jordan"),2); FindInAllFieldsL(_L("r"),4); FindInAllFieldsL(_L("xxxxxxxxx"),0); } iTest.Next(_L("FINDING CONTACTS BY COMPANY FROM COMPANY NAME FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS COMPANY FROM COMPANY NAME FIELD")); FindInCompanyFieldL(_L("Ben"),0); FindInCompanyFieldL(_L("High Res Solutions"),1); FindInCompanyFieldL(_L("Software Solutions"),2); FindInCompanyFieldL(_L("s"),4); } iTest.Next(_L("FINDING CONTACTS BY COMPANY FROM ALL FIELDS")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY COMPANY FROM ALL FIELDS")); FindInAllFieldsL(_L("Kick"),1); FindInAllFieldsL(_L("High Res Solutions"),1); FindInAllFieldsL(_L("Software Solutions"),2); FindInAllFieldsL(_L("s"),4); } //end of tests for defect where identity fields were not searched when using KUidMatchInAllFields //start of Async tests for defect where identity fields were not searched when using KUidMatchInAllFields iTest.Next(_L("FINDING CONTACTS BY NAME FROM GIVEN NAME FIELD ASYNCHRONOUSLY")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM GIVEN NAME FIELD ASYNCHRONOUSLY.")); FindNameInFirstNameFieldL(_L("Chris"),1,ETrue); FindNameInFirstNameFieldL(_L("Turner"),0,ETrue); FindNameInFirstNameFieldL(_L("e"),2,ETrue); } iTest.Next(_L("FINDING CONTACTS BY NAME FROM FAMILY NAME FIELD ASYNCHRONOUSLY")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM FAMILY NAME FIELD ASYNCHRONOUSLY.")); FindNameInLastNameFieldL(_L("Turner"),1,ETrue); FindNameInLastNameFieldL(_L("Jordan"),2,ETrue); FindNameInLastNameFieldL(_L("r"),4,ETrue); FindNameInLastNameFieldL(_L("Chris"),0,ETrue); } iTest.Next(_L("FINDING CONTACTS BY NAME FROM ALL FIELDS ASYNCHRONOUSLY")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NAME FROM ALL FIELDS ASYNCHRONOUSLY")); FindInAllFieldsL(_L("Ben"),1,ETrue); FindInAllFieldsL(_L("Jordan"),2,ETrue); FindInAllFieldsL(_L("r"),4,ETrue); FindInAllFieldsL(_L("xxxxxxxxx"),0,ETrue); } iTest.Next(_L("FINDING CONTACTS BY COMPANY FROM COMPANY NAME FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS COMPANY FROM COMPANY NAME FIELD ASYNCHRONOUSLY")); FindInCompanyFieldL(_L("Ben"),0,ETrue); FindInCompanyFieldL(_L("High Res Solutions"),1,ETrue); FindInCompanyFieldL(_L("Software Solutions"),2,ETrue); FindInCompanyFieldL(_L("s"),4,ETrue); } iTest.Next(_L("FINDING CONTACTS BY COMPANY FROM ALL FIELDS ASYNCHRONOUSLY")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY COMPANY FROM ALL FIELDS ASYNCHRONOUSLY")); FindInAllFieldsL(_L("Kick"),1,ETrue); FindInAllFieldsL(_L("High Res Solutions"),1,ETrue); FindInAllFieldsL(_L("Software Solutions"),2,ETrue); FindInAllFieldsL(_L("s"),4,ETrue); } //end of Async tests for defect where identity fields were not searched when using KUidMatchInAllFields //the following tests were not part of the defect but included as regression testing iTest.Next(_L("FINDING CONTACTS BY WORK PHONE NUMBER FROM PHONE FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY WORK PHONE NUMBER FROM PHONE FIELD")); FindPhoneNumberL(_L("015672354658"),2); FindPhoneNumberL(_L("017652354658"),1); FindPhoneNumberL(_L("999999999999"),0); } iTest.Next(_L("FINDING CONTACTS BY HOME PHONE NUMBER FROM PHONE FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY HOME PHONE NUMBER FROM PHONE FIELD")); FindPhoneNumberL(_L("01617246900"),2); FindPhoneNumberL(_L("01712345678"),1); FindPhoneNumberL(_L("999999999999"),0); } iTest.Next(_L("FINDING CONTACTS BY WORK MOBILE NUMBER FROM PHONE FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY WORK MOBILE NUMBER FROM PHONE FIELD")); FindPhoneNumberL(_L("077962345100"),1); FindPhoneNumberL(_L("077962345101"),1); FindPhoneNumberL(_L("07896543210"),1); FindPhoneNumberL(_L("999999999999"),0); } iTest.Next(_L("FINDING CONTACTS BY HOME MOBILE NUMBER FROM PHONE FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY HOME MOBILE NUMBER FROM PHONE FIELD")); FindPhoneNumberL(_L("07234567891"),1); FindPhoneNumberL(_L("07785674301"),1); FindPhoneNumberL(_L("07785674300"),1); FindPhoneNumberL(_L("999999999999"),0); } iTest.Next(_L("FINDING CONTACTS BY PHONE NUMBER FROM ALL FIELDS")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY PHONE NUMBER FROM ALL FIELDS")); FindInAllFieldsL(_L("015672354658"),2); FindInAllFieldsL(_L("01617246900"),2); FindInAllFieldsL(_L("017652354658"),1); FindInAllFieldsL(_L("01712345678"),1); FindInAllFieldsL(_L("999999999999"),0); } iTest.Next(_L("FINDING CONTACTS BY EMAIL FROM EMAIL FIELD")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY EMAIL FROM EMAIL FIELD")); FindEmailAddressL(_L("@@"),0); FindEmailAddressL(_L("aj1@software_solutions.com"),1); FindEmailAddressL(_L("software_solutions.com"),2); FindEmailAddressL(_L("soft"),3); FindEmailAddressL(_L("@"),4); } iTest.Next(_L("FINDING CONTACTS BY EMAIL FROM ALL FIELDS")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY EMAIL FROM ALL FIELDS")); FindInAllFieldsL(_L("@@"),0); FindInAllFieldsL(_L("aj1@software_solutions.com"),1); FindInAllFieldsL(_L("software_solutions.com"),2); FindInAllFieldsL(_L("soft"),3); FindInAllFieldsL(_L("@"),4); } iTest.Next(_L("FINDING CONTACTS BY NOTES FROM NOTES FIELDS")); { iLog->LogLine(_L("\r\nFINDING CONTACTS BY NOTES FROM NOTES FIELDS")); FindNotesL(_L("dummy"),4); FindNotesL(_L("dummy"),4, ETrue); FindNotesL(_L("nonexistant"),0); FindNotesL(_L("nonexistant"),0, ETrue); } iTest.Next(_L("FINDING NOTES FROM ALL FIELDS")); { iLog->LogLine(_L("\r\nFINDING NOTES FROM ALL FIELDS")); FindInAllFieldsL(_L("dummy"),4); FindInAllFieldsL(_L("dummy"),4, ETrue); FindInAllFieldsL(_L("nonexistant"),0); FindInAllFieldsL(_L("nonexistant"),0, ETrue); } iTest.End(); }
GLDEF_C void FindUsingKUidContactFieldMatchAllL() { //create the database CntTest->CreateDatabaseL(); //add the contacts //AddFindRecordL(const TDesC &aFirstName, const TDesC &aLastName, const TDesC &aCompanyName, const TDesC &aAddress) AddFindRecordL(_L("Robert"),_L("Jordan"),_L("Software Solutions"),_L(" ")); AddFindRecordL(_L("Amanda"),_L("Jordan"),_L("Software Solutions"),_L(" ")); AddFindRecordL(_L("Ben"),_L("Turner"),_L("High Res Solutions"),_L(" ")); AddFindRecordL(_L("Chris"),_L("Andrews"),_L("Soft Kicks"),_L(" ")); //start of tests for defect where identity fields were not searched when using KUidMatchInAllFields test.Next(_L("@SYMTestCaseID:PIM-T-FIND-INC049017-0001 FINDING CONTACTS BY NAME FROM GIVEN NAME FIELD.")); { FindNameInFirstNameFieldL(_L("Chris"),1); FindNameInFirstNameFieldL(_L("Turner"),0); FindNameInFirstNameFieldL(_L("e"),2); } test.Next(_L("FINDING CONTACTS BY NAME FROM FAMILY NAME FIELD")); { FindNameInLastNameFieldL(_L("Turner"),1); FindNameInLastNameFieldL(_L("Jordan"),2); FindNameInLastNameFieldL(_L("r"),4); FindNameInLastNameFieldL(_L("Chris"),0); } test.Next(_L("FINDING CONTACTS BY NAME FROM ALL FIELDS")); { FindInAllFieldsL(_L("Ben"),1); FindInAllFieldsL(_L("Jordan"),2); FindInAllFieldsL(_L("r"),4); FindInAllFieldsL(_L("xxxxxxxxx"),0); } test.Next(_L("FINDING CONTACTS BY COMPANY FROM COMPANY NAME FIELD")); { FindInCompanyFieldL(_L("Ben"),0); FindInCompanyFieldL(_L("High Res Solutions"),1); FindInCompanyFieldL(_L("Software Solutions"),2); FindInCompanyFieldL(_L("s"),4); } test.Next(_L("FINDING CONTACTS BY COMPANY FROM ALL FIELDS")); { FindInAllFieldsL(_L("Kick"),1); FindInAllFieldsL(_L("High Res Solutions"),1); FindInAllFieldsL(_L("Software Solutions"),2); FindInAllFieldsL(_L("s"),4); } //end of tests for defect where identity fields were not searched when using KUidMatchInAllFields //start of Async tests for defect where identity fields were not searched when using KUidMatchInAllFields test.Next(_L("FINDING CONTACTS BY NAME FROM GIVEN NAME FIELD ASYNCHRONOUSLY")); { FindNameInFirstNameFieldL(_L("Chris"),1,ETrue); FindNameInFirstNameFieldL(_L("Turner"),0,ETrue); FindNameInFirstNameFieldL(_L("e"),2,ETrue); } test.Next(_L("FINDING CONTACTS BY NAME FROM FAMILY NAME FIELD ASYNCHRONOUSLY")); { FindNameInLastNameFieldL(_L("Turner"),1,ETrue); FindNameInLastNameFieldL(_L("Jordan"),2,ETrue); FindNameInLastNameFieldL(_L("r"),4,ETrue); FindNameInLastNameFieldL(_L("Chris"),0,ETrue); } test.Next(_L("FINDING CONTACTS BY NAME FROM ALL FIELDS ASYNCHRONOUSLY")); { FindInAllFieldsL(_L("Ben"),1,ETrue); FindInAllFieldsL(_L("Jordan"),2,ETrue); FindInAllFieldsL(_L("r"),4,ETrue); FindInAllFieldsL(_L("xxxxxxxxx"),0,ETrue); } test.Next(_L("FINDING CONTACTS BY COMPANY FROM COMPANY NAME FIELD ASYNCHRONOUSLY")); { FindInCompanyFieldL(_L("Ben"),0,ETrue); FindInCompanyFieldL(_L("High Res Solutions"),1,ETrue); FindInCompanyFieldL(_L("Software Solutions"),2,ETrue); FindInCompanyFieldL(_L("s"),4,ETrue); } test.Next(_L("FINDING CONTACTS BY COMPANY FROM ALL FIELDS ASYNCHRONOUSLY")); { FindInAllFieldsL(_L("Kick"),1,ETrue); FindInAllFieldsL(_L("High Res Solutions"),1,ETrue); FindInAllFieldsL(_L("Software Solutions"),2,ETrue); FindInAllFieldsL(_L("s"),4,ETrue); } //end of Async tests for defect where identity fields were not searched when using KUidMatchInAllFields CntTest->CloseDatabase(); CntTest->DeleteDatabaseL(); }