USE_FUNAMBOL_NAMESPACE BEGIN_TEST(DummyTest) { int i = 3; int k = 3; WIN_ASSERT_EQUAL(i, k); }
END_TEST BEGIN_TEST(StringBufferTest) { StringBuffer first("string"); StringBuffer second("string"); WIN_ASSERT_EQUAL(first, second); }
END_TEST BEGIN_TEST(ItemTestGetLongDescription) { string s = "This is an example of a really really long description. Our descriptions will be shorter than this so this is a good way to test they will all work!"; Item newItem = Item(s); WIN_ASSERT_EQUAL(s, newItem.getDesc()); }
END_TEST /** * Removed the STATUS from the winevent parser */ BEGIN_TEST(WinEventNoSTATUS) { int ret = 0; SyncItem* item = NULL; WCHAR* internalKey = NULL; wstring propValue; WindowsSyncSource* ss = createAppointmentWindowsSyncSource(); WIN_ASSERT_NOT_NULL(ss, TEXT("The syncSource is null.")); StringBuffer VCal; VCal.append("BEGIN:VCALENDAR\r\n"); VCal.append("VERSION:1.0\r\n"); VCal.append("BEGIN:VEVENT\r\n"); VCal.append("X-FUNAMBOL-FOLDER:DEFAULT_FOLDER\r\n"); VCal.append("X-FUNAMBOL-ALLDAY:1\r\n"); VCal.append("DTSTART:20110407\r\n"); VCal.append("DTEND:20110408\r\n"); VCal.append("X-MICROSOFT-CDO-BUSYSTATUS:FREE\r\n"); VCal.append("CATEGORIES:\r\n"); VCal.append("DESCRIPTION:\r\n"); VCal.append("LOCATION:Roma\r\n"); VCal.append("PRIORITY:1\r\n"); VCal.append("STATUS:NEED ACTION\r\n"); VCal.append("X-MICROSOFT-CDO-REPLYTIME:\r\n"); VCal.append("SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Da test\r\n"); VCal.append("CLASS:PUBLIC\r\n"); VCal.append("AALARM:20110406T060000Z;;0;\r\n"); VCal.append("RRULE:\r\n"); VCal.append("X-FUNAMBOL-BILLINGINFO:\r\n"); VCal.append("X-FUNAMBOL-COMPANIES:\r\n"); VCal.append("X-FUNAMBOL-MILEAGE:\r\n"); VCal.append("X-FUNAMBOL-NOAGING:0 \r\n"); VCal.append("END:VEVENT\r\n"); VCal.append("END:VCALENDAR"); item = new SyncItem(TEXT("GUID")); item->setData(VCal.c_str(), VCal.length()); WCHAR* tt = toWideChar(VCal.c_str()); WinEvent d(tt); printf("%S", d.toString().c_str()); // insert test item ret = ss->addItem(*item); WIN_ASSERT_EQUAL(ret, 201, TEXT("Adding item is not correct")); internalKey = (WCHAR*)item->getKey(); delete item; delete ss; }
END_TEST BEGIN_TEST(addRegion1) { Region r1 = Region(1,2,3,4); v.addRegion(r1); WIN_ASSERT_EQUAL(v.clickableRegions.exists(), r1); }
END_TESTF BEGIN_TESTF(DeleteFileShouldFailIfFileIsReadOnly, DeleteFileFixture) { // Set file to read-only DWORD fileAttributes = GetFileAttributes(s_tempFileName); WIN_ASSERT_WINAPI_SUCCESS( SetFileAttributes(s_tempFileName, fileAttributes | FILE_ATTRIBUTE_READONLY)); // Verify that DeleteFile fails with ERROR_ACCESS_DENIED // (according to spec) WIN_ASSERT_FALSE(DeleteFile(s_tempFileName)); WIN_ASSERT_EQUAL(ERROR_ACCESS_DENIED, GetLastError()); }
END_TEST WinContact* updateOutlookItem(WindowsSyncSource* ss, SyncItem* item) { int ret = ss->updateItem(*item); WIN_ASSERT_EQUAL(ret, 200, TEXT("Update item is not correct")); wstring keyModified = item->getKey(); SyncItem* itemTmp = ss->getItemFromId(keyModified.c_str()); WIN_ASSERT_NOT_NULL(item, TEXT("The item retrieved from the backend is null.")); WCHAR* wcon = toWideChar((const char*)itemTmp->getData()); wstring wcontact(wcon); delete [] wcon; WinContact* winC = new WinContact(wcontact); return winC; }
END_TEST /** * The test must be executed with an already installed Outlook client */ BEGIN_TEST(WinContactPhotoIsTheSame) { int ret = 0; SyncItem* item = NULL; WCHAR* internalKey = NULL; wstring propValue; WindowsSyncSource* ss = createContactWindowsSyncSource(); WIN_ASSERT_NOT_NULL(ss, TEXT("The syncSource is null.")); StringBuffer VCard; VCard.append("BEGIN:VCARD\r\n"); VCard.append("VERSION:2.1\r\n"); VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n"); VCard.append("BDAY:20100901\r\n"); VCard.append("NOTE:\r\n"); VCard.append("TEL;WORK;FAX:4444444444\r\n"); VCard.append("TEL;VOICE;WORK:22222222222\r\n"); VCard.append("TEL;VOICE;WORK:333333333333\r\n"); VCard.append("TEL;CAR;VOICE:66666666666\r\n"); VCard.append("CATEGORIES:\r\n"); VCard.append("TEL;WORK;PREF:777777777777\r\n"); VCard.append("FN:Paperino, Paolino Middle\r\n"); VCard.append("EMAIL;INTERNET:[email protected]\r\n"); VCard.append("EMAIL;INTERNET;HOME:[email protected]\r\n"); VCard.append("EMAIL;INTERNET;WORK:[email protected]\r\n"); VCard.append("TITLE:JobTitle\r\n"); VCard.append("TEL;VOICE;HOME:8888888888888\r\n"); VCard.append("TEL;VOICE;HOME:999999999999\r\n"); VCard.append("TEL;HOME;FAX:000000000\r\n"); VCard.append("URL;HOME:\r\n"); VCard.append("TEL;CELL:1212121212121\r\n"); VCard.append("NICKNAME:nickname\r\n"); VCard.append("TEL;FAX:14141414141\r\n"); VCard.append("TEL;VOICE:131313131313\r\n"); VCard.append("TEL;PAGER:151515151\r\n"); VCard.append("TEL;PREF;VOICE:16161616161\r\n"); VCard.append("ROLE:profession\r\n"); VCard.append("URL:www.web.com\r\n"); VCard.append("ORG:Company;department;office\r\n"); VCard.append("ADR;HOME:;;Via Riviera 55;pavia;pv;27100;Italy\r\n"); VCard.append("ADR:;;Via Naples 23;milano;mi;3993;Italy\r\n"); VCard.append("ADR;WORK:;;Via Roma;New york;NY;20111;Italy\r\n"); VCard.append(" /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQY\r\n"); VCard.append(" GBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa\r\n"); VCard.append(" KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAAR\r\n"); VCard.append(" CAA2AEgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA\r\n"); VCard.append(" AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK\r\n"); VCard.append(" FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG\r\n"); VCard.append(" h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl\r\n"); VCard.append(" 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA\r\n"); VCard.append(" AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk\r\n"); VCard.append(" NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE\r\n"); VCard.append(" hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk\r\n"); VCard.append(" 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCfxl4r1qy8S69Aut61bW9vqMysHmlCRxu7\r\n"); VCard.append(" BSrKeFHbsBjpivOm8d+KAQreJtdSVE8uRW1CbnGSJFGemB+tbXxIef8A4THxCDaXAjF/dees\r\n"); VCard.append(" t1tjuYhMxG0Z4xXnN9dwNAkTTJIAodFlRi6jkbAfoc14+HUuaTu3r/X9Py6n0s3FQjdJaLdW\r\n"); VCard.append(" v99vw8007pnZaf418TSW0lxceK9eUjaVRb6U9eSuN3pjmki8beKhOF/4SnWAQcfNqExAx1zg\r\n"); VCard.append(" +tcL9qMSxqc+WoABxt8zBwMep55zVyzlclwxJl+6Y2kC/MTnp3rrcZK7uYQ5FJJr+v8AhtvT\r\n"); VCard.append(" RbHoFn4z8Qmf7NL4p1tVbBybyRmLHsDngZ7VqP4p8SxHYfEOsEoNzn7bIck9FHzVx8Yit7SL\r\n"); VCard.append(" M8Ksko3nAZ93XgDqK1IyWRbi4iaNC2Y1I+82eGPevLrTle6bsfTYKEGuWpFX7WX9fgj0f4Z+\r\n"); VCard.append(" JvEUt4H1PWLtrQnGLudmLk9hk9q91tpJpFBM0hyP7xr5d8MTeVqcVzK4Yq3yjzAQzemK+gdD\r\n"); VCard.append(" 1rdax+YArY5Gc0YfFqM3GbPJzvDLn5qaXyRuam1wIG8ueVTjqrkUVXudQR4D0NFTipxlO6kz\r\n"); VCard.append(" yKMZRjZo+WvippZi8c+JmW1VojcTytLdTEj5nJJQdsE4xXBXxaaCZ/tE5DwxmIvags4UjO0j\r\n"); VCard.append(" oB616f43uGfxX4kgtrW5ucalcfajcSfucea2wY9B1Fcrb6LfraahdWs4lkgk+zs6yARpCwyy\r\n"); VCard.append(" qOua0jX9m37R6p/13td/gep7HmpLk6r9H2tffzfmcdNZt5rSIXO9TLBJcDHnJ0IUdM5rRsra\r\n"); VCard.append(" Ozk+z3Bt4wrhBBeptYbh1LD0qe408vYs9nZSXdhM4jiTBae2VTyfYHnH0rRsoEk3ix1KKW3N\r\n"); VCard.append(" zGyJqEW5gMdc+ma6Z17x3/r8bf1YzpUXz2S/p3+9PTXW6tcdpVu0LL9k/siEnMRl3FiW9Rxk\r\n"); VCard.append(" H0NbMiAW28CSWVsh5X65H931qIfZ7JmkkTSkZZyCYY9xX8PQ1oWn+mlfJikmbcWAb5Vj+ntX\r\n"); VCard.append(" l1qjb5+n9dT6DCwVFa6eX/AsjS8MbIriF7i3jRzgRsyEkfX0r2rSbLzbdCWRmxztrhPDOm2U\r\n"); VCard.append(" yhZoZI7t1w+GO0H2rfFvq2hvvtibi367T1FdGCnCrHmWp5+Omq0rRdn5nWNpDMuASPoaKqaR\r\n"); VCard.append(" 4rgmwlwDFJ3Vxiiu7kpvc8Wf1iDs0eA/EMMvjTXZb65kNs+pzq1vFxuVZGxn9K5qNvJSIXu+\r\n"); VCard.append(" DTZBJNDHGfmJ7Z716r460xpte1u6KIu28lC7x/DvOT+NcI2kXUrtdxx+bDGhTa3Rc+lcDqxb\r\n"); VCard.append(" l2Tt218vPzPYpwXs1UjLay/K9328kUI9X1HTrm8acGKWdIpIxF91VxjJH40+U3Mas1pcW062\r\n"); VCard.append(" bY5XDMj8nP0P8q0zp8ttfSK7ec4gCHcP4SOlX38LfZ7dJ4Y1+WMEn+9+FYynSi4tpJy28+nr\r\n"); VCard.append(" tp8zoVNpqMpb3afXv6f8BGRFFPE2w2tnOEjwzIOSp5/MV19hokl3psN1bOHwmJI06g0umaEl\r\n"); VCard.append(" 9BHPbRgMRtkUcV13hq2TS5mjePaH4J9az9lOp70d4vVF1a3IrxfvL0Mu0uHtliVt8ciDAY9f\r\n"); VCard.append(" xrttC1qO5QRXON386XU9Dh1C33KAGxwwrjbizu9Mnw6ttB4YV2fVuR89LR/gedy0sTdrSR6P\r\n"); VCard.append(" PolpdjeEUk98UVh+GdfLFYZzg9j60V0xrRt76szz6ixFKXKmc349zNq17HnG+7kB+gY0+Cwj\r\n"); VCard.append(" t9EWNAP3h5OKKK4cVBLAysuv6nYm44KFjMnsEGtIGwQVCn3Fbt1pccKrCrHZ5fGaKKzx0I+x\r\n"); VCard.append(" oytqmjbEzkvZ2ZmeGv8ARL+SEcrursrqySWLfwDiiiu+OlZ27E4ttVE0P0K9dJTbv8wHQ1t3\r\n"); VCard.append(" enw3MeWUc+tFFdrSaPNxPuVLx0OcvdHht2LxYUj0ooorwsVJqpodMJykk2z/2Q==\r\n"); VCard.append("\r\n"); VCard.append("X-ANNIVERSARY:20100902\r\n"); VCard.append("X-FUNAMBOL-BILLINGINFO:\r\n"); VCard.append("TEL;X-FUNAMBOL-CALLBACK:5555555555\r\n"); VCard.append("X-FUNAMBOL-CHILDREN:\r\n"); VCard.append("X-FUNAMBOL-COMPANIES:\r\n"); VCard.append("X-FUNAMBOL-FOLDER:DEFAULT_FOLDER\r\n"); VCard.append("X-FUNAMBOL-HOBBIES:\r\n"); VCard.append("EMAIL;INTERNET;HOME;X-FUNAMBOL-INSTANTMESSENGER:IMaddress\r\n"); VCard.append("X-FUNAMBOL-INITIALS:P.M.P.\r\n"); VCard.append("X-FUNAMBOL-LANGUAGES:\r\n"); VCard.append("X-MANAGER:managerName\r\n"); VCard.append("X-FUNAMBOL-MILEAGE:\r\n"); VCard.append("X-FUNAMBOL-ORGANIZATIONALID:\r\n"); VCard.append("TEL;X-FUNAMBOL-RADIO:1717171717\r\n"); VCard.append("X-SPOUSE:spuse\r\n"); VCard.append("X-FUNAMBOL-SUBJECT:Paolino Middle Paperino suffix\r\n"); VCard.append("TEL;X-FUNAMBOL-TELEX:1181818181818\r\n"); VCard.append("X-FUNAMBOL-YOMICOMPANYNAME:\r\n"); VCard.append("X-FUNAMBOL-YOMIFIRSTNAME:\r\n"); VCard.append("X-FUNAMBOL-YOMILASTNAME:\r\n"); VCard.append("END:VCARD"); item = new SyncItem(TEXT("GUID")); item->setData(VCard.c_str(), VCard.length()); // insert test item ret = ss->addItem(*item); WIN_ASSERT_EQUAL(ret, 201, TEXT("Adding item is not correct")); internalKey = (WCHAR*)item->getKey(); // // remove work and car tel number // VCard.reset(); VCard.append("BEGIN:VCARD\r\n"); VCard.append("VERSION:2.1\r\n"); VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n"); VCard.append("PHOTO;ENCODING=b;TYPE=JPEG:\r\n"); VCard.append(" /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQY\r\n"); VCard.append(" GBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa\r\n"); VCard.append(" KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAAR\r\n"); VCard.append(" CAA2AEgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA\r\n"); VCard.append(" AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK\r\n"); VCard.append(" FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG\r\n"); VCard.append(" h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl\r\n"); VCard.append(" 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA\r\n"); VCard.append(" AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk\r\n"); VCard.append(" NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE\r\n"); VCard.append(" hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk\r\n"); VCard.append(" 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCfxl4r1qy8S69Aut61bW9vqMysHmlCRxu7\r\n"); VCard.append(" BSrKeFHbsBjpivOm8d+KAQreJtdSVE8uRW1CbnGSJFGemB+tbXxIef8A4THxCDaXAjF/dees\r\n"); VCard.append(" t1tjuYhMxG0Z4xXnN9dwNAkTTJIAodFlRi6jkbAfoc14+HUuaTu3r/X9Py6n0s3FQjdJaLdW\r\n"); VCard.append(" v99vw8007pnZaf418TSW0lxceK9eUjaVRb6U9eSuN3pjmki8beKhOF/4SnWAQcfNqExAx1zg\r\n"); VCard.append(" +tcL9qMSxqc+WoABxt8zBwMep55zVyzlclwxJl+6Y2kC/MTnp3rrcZK7uYQ5FJJr+v8AhtvT\r\n"); VCard.append(" RbHoFn4z8Qmf7NL4p1tVbBybyRmLHsDngZ7VqP4p8SxHYfEOsEoNzn7bIck9FHzVx8Yit7SL\r\n"); VCard.append(" M8Ksko3nAZ93XgDqK1IyWRbi4iaNC2Y1I+82eGPevLrTle6bsfTYKEGuWpFX7WX9fgj0f4Z+\r\n"); VCard.append(" JvEUt4H1PWLtrQnGLudmLk9hk9q91tpJpFBM0hyP7xr5d8MTeVqcVzK4Yq3yjzAQzemK+gdD\r\n"); VCard.append(" 1rdax+YArY5Gc0YfFqM3GbPJzvDLn5qaXyRuam1wIG8ueVTjqrkUVXudQR4D0NFTipxlO6kz\r\n"); VCard.append(" yKMZRjZo+WvippZi8c+JmW1VojcTytLdTEj5nJJQdsE4xXBXxaaCZ/tE5DwxmIvags4UjO0j\r\n"); VCard.append(" oB616f43uGfxX4kgtrW5ucalcfajcSfucea2wY9B1Fcrb6LfraahdWs4lkgk+zs6yARpCwyy\r\n"); VCard.append(" qOua0jX9m37R6p/13td/gep7HmpLk6r9H2tffzfmcdNZt5rSIXO9TLBJcDHnJ0IUdM5rRsra\r\n"); VCard.append(" Ozk+z3Bt4wrhBBeptYbh1LD0qe408vYs9nZSXdhM4jiTBae2VTyfYHnH0rRsoEk3ix1KKW3N\r\n"); VCard.append(" zGyJqEW5gMdc+ma6Z17x3/r8bf1YzpUXz2S/p3+9PTXW6tcdpVu0LL9k/siEnMRl3FiW9Rxk\r\n"); VCard.append(" H0NbMiAW28CSWVsh5X65H931qIfZ7JmkkTSkZZyCYY9xX8PQ1oWn+mlfJikmbcWAb5Vj+ntX\r\n"); VCard.append(" l1qjb5+n9dT6DCwVFa6eX/AsjS8MbIriF7i3jRzgRsyEkfX0r2rSbLzbdCWRmxztrhPDOm2U\r\n"); VCard.append(" yhZoZI7t1w+GO0H2rfFvq2hvvtibi367T1FdGCnCrHmWp5+Omq0rRdn5nWNpDMuASPoaKqaR\r\n"); VCard.append(" 4rgmwlwDFJ3Vxiiu7kpvc8Wf1iDs0eA/EMMvjTXZb65kNs+pzq1vFxuVZGxn9K5qNvJSIXu+\r\n"); VCard.append(" DTZBJNDHGfmJ7Z716r460xpte1u6KIu28lC7x/DvOT+NcI2kXUrtdxx+bDGhTa3Rc+lcDqxb\r\n"); VCard.append(" l2Tt218vPzPYpwXs1UjLay/K9328kUI9X1HTrm8acGKWdIpIxF91VxjJH40+U3Mas1pcW062\r\n"); VCard.append(" bY5XDMj8nP0P8q0zp8ttfSK7ec4gCHcP4SOlX38LfZ7dJ4Y1+WMEn+9+FYynSi4tpJy28+nr\r\n"); VCard.append(" tp8zoVNpqMpb3afXv6f8BGRFFPE2w2tnOEjwzIOSp5/MV19hokl3psN1bOHwmJI06g0umaEl\r\n"); VCard.append(" 9BHPbRgMRtkUcV13hq2TS5mjePaH4J9az9lOp70d4vVF1a3IrxfvL0Mu0uHtliVt8ciDAY9f\r\n"); VCard.append(" xrttC1qO5QRXON386XU9Dh1C33KAGxwwrjbizu9Mnw6ttB4YV2fVuR89LR/gedy0sTdrSR6P\r\n"); VCard.append(" PolpdjeEUk98UVh+GdfLFYZzg9j60V0xrRt76szz6ixFKXKmc349zNq17HnG+7kB+gY0+Cwj\r\n"); VCard.append(" t9EWNAP3h5OKKK4cVBLAysuv6nYm44KFjMnsEGtIGwQVCn3Fbt1pccKrCrHZ5fGaKKzx0I+x\r\n"); VCard.append(" oytqmjbEzkvZ2ZmeGv8ARL+SEcrursrqySWLfwDiiiu+OlZ27E4ttVE0P0K9dJTbv8wHQ1t3\r\n"); VCard.append(" enw3MeWUc+tFFdrSaPNxPuVLx0OcvdHht2LxYUj0ooorwsVJqpodMJykk2z/2Q==\r\n"); VCard.append("\r\n"); VCard.append("END:VCARD"); // update item item->setData(VCard.c_str(), VCard.length()); WinContact* winC = updateOutlookItem(ss, item); WIN_ASSERT_NOT_NULL(winC, TEXT("The item retrieved from the backend is null.")); // check some modifications winC->getProperty(L"Email1Address", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Email2Address is not null")); winC->getProperty(L"Email3Address", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Email3Address is not null")); winC->getProperty(L"Email2Address", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Email2Address is not null")); winC->getProperty(L"Birthday", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Birthday is not null")); winC->getProperty(L"OtherAddress", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The OtherAddress is not null")); winC->getProperty(L"MobileTelephoneNumber", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The MobileTelephoneNumber is not null")); winC->getProperty(L"Photo", propValue); WIN_ASSERT_TRUE(!propValue.empty(), TEXT("The BusinessAddress is not null")); delete winC; // // delete the test item // ret = ss->deleteItem(*item); WIN_ASSERT_EQUAL(ret, 200, TEXT("delete item is not correct")); delete item; }
END_TEST /** * The test must be executed with an already installed Outlook client */ BEGIN_TEST(WinContactRemoveEmail) { int ret = 0; SyncItem* item = NULL; WCHAR* internalKey = NULL; wstring propValue; WindowsSyncSource* ss = createContactWindowsSyncSource(); WIN_ASSERT_NOT_NULL(ss, TEXT("The syncSource is null.")); StringBuffer VCard; VCard.append("BEGIN:VCARD\r\n"); VCard.append("VERSION:2.1\r\n"); VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n"); VCard.append("BDAY:20100901\r\n"); VCard.append("TEL;WORK;FAX:4444444444\r\n"); VCard.append("TEL;VOICE;WORK:22222222222\r\n"); VCard.append("TEL;VOICE;WORK:333333333333\r\n"); VCard.append("TEL;CAR;VOICE:66666666666\r\n"); VCard.append("EMAIL;INTERNET:[email protected]\r\n"); VCard.append("EMAIL;INTERNET;HOME:[email protected]\r\n"); VCard.append("EMAIL;INTERNET;WORK:[email protected]\r\n"); VCard.append("ADR;HOME:;;Via Riviera 55;pavia;pv;27100;Italy\r\n"); VCard.append("ADR:;;Via Naples 23;milano;mi;3993;Italy\r\n"); VCard.append("ADR;WORK:;;Via Roma;New york;NY;20111;Italy\r\n"); VCard.append("END:VCARD"); item = new SyncItem(TEXT("GUID")); item->setData(VCard.c_str(), VCard.length()); // insert test item ret = ss->addItem(*item); WIN_ASSERT_EQUAL(ret, 201, TEXT("Adding item is not correct")); internalKey = (WCHAR*)item->getKey(); // // remove work and car tel number // VCard.reset(); VCard.append("BEGIN:VCARD\r\n"); VCard.append("VERSION:2.1\r\n"); VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n"); VCard.append("TEL;WORK;FAX:4444444444\r\n"); VCard.append("TEL;VOICE;WORK:22222222222\r\n"); VCard.append("TEL;VOICE;WORK:333333333333\r\n"); VCard.append("TEL;CAR;VOICE:66666666666\r\n"); VCard.append("EMAIL;INTERNET;HOME:[email protected]\r\n"); VCard.append("ADR;HOME:;;Via Riviera 55;pavia;pv;27100;Italy\r\n"); VCard.append("ADR;WORK:;;Via Roma;New york;NY;20111;Italy\r\n"); VCard.append("END:VCARD"); // update item item->setData(VCard.c_str(), VCard.length()); WinContact* winC = updateOutlookItem(ss, item); WIN_ASSERT_NOT_NULL(winC, TEXT("The item retrieved from the backend is null.")); // check modifications // Mapping is: // Email1Address <-> EMAIL;INTERNET: // Email2Address <-> EMAIL;INTERNET;HOME: // Email3Address <-> EMAIL;INTERNET;WORK: winC->getProperty(L"Email1Address", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Email2Address is not null")); winC->getProperty(L"Email3Address", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Email3Address is not null")); winC->getProperty(L"Birthday", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The Birthday is not null")); winC->getProperty(L"OtherAddress", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The OtherAddress is not null")); delete winC; // // remove one work tel number // VCard.reset(); VCard.reset(); VCard.append("BEGIN:VCARD\r\n"); VCard.append("VERSION:2.1\r\n"); VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n"); VCard.append("TEL;WORK;FAX:4444444444\r\n"); VCard.append("TEL;VOICE;WORK:22222222222\r\n"); VCard.append("TEL;VOICE;WORK:333333333333\r\n"); VCard.append("TEL;CAR;VOICE:66666666666\r\n"); VCard.append("EMAIL;INTERNET;HOME:[email protected]\r\n"); VCard.append("END:VCARD"); item->setData(VCard.c_str(), VCard.length()); winC = updateOutlookItem(ss, item); WIN_ASSERT_NOT_NULL(winC, TEXT("The item retrieved from the backend is null.")); winC->getProperty(L"HomeAddress", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The HomeAddress is not null")); winC->getProperty(L"BusinessAddress", propValue); WIN_ASSERT_TRUE(propValue.empty(), TEXT("The BusinessAddress is not null")); delete winC; // // delete the test item // ret = ss->deleteItem(*item); WIN_ASSERT_EQUAL(ret, 200, TEXT("delete item is not correct")); delete item; delete ss; }
#include "View.h" #include <string> #include "WinUnit.h" Image m = Image(); //image stuffs here View vList[] = null; Region rList[] = null; View v = View("main", m, v, rList); BEGIN_TEST(ViewCreateTest1) { WIN_ASSERT_EQUAL(v.getDescription(), "main") } END_TEST BEGIN_TEST(ViewCreateTest2) { WIN_ASSERT_EQUAL(v.clickableRegions(), rList) } END_TEST BEGIN_TEST(ViewCreateTest3) { WIN_ASSERT_EQUAL(v.getViews(),vList)