1 // xestiaab_contactload.h - Xestia Address Book Contact Load Unit Tests.
3 // (c) 2012-2017 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <gtest/gtest.h>
20 #include "../contacteditor/cdo/ContactDataObject.h"
22 TEST(ContactLoad, GivenContactDataObjectWhenLoadFileIsCalledWithMissingFileThenReturnFileMissingError)
27 ContactDataObject testFile;
31 ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
32 testFileLoadStatus = testFile.LoadFile("MissingFile.vcf");
36 ASSERT_EQ(CONTACTLOAD_FILEMISSING, testFileLoadStatus);
40 TEST(ContactLoad, GivenContactDataObjectWhenLoadFileIsCalledWithInvalidPermissionsSetThenReturnInvalidPermissionsError)
45 ContactDataObject testFile;
49 ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
50 testFileLoadStatus = testFile.LoadFile("InvalidPermissions.vcf");
54 ASSERT_EQ(CONTACTLOAD_FILEERROR, testFileLoadStatus);
58 TEST(ContactLoad, GivenContactDataObjectWhenLoadFileIsCalledWithInvalidFormatThenReturnInvalidFormatError)
63 ContactDataObject testFile;
67 ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
68 testFileLoadStatus = testFile.LoadFile("LoadCheck-Load1-v3.vcf");
72 ASSERT_EQ(CONTACTLOAD_FILEINVALIDFORMAT, testFileLoadStatus);
76 TEST(ContactLoad, GivenContactDataObjectWhenLoadFileIsCalledWithNonMeetingBaseSpecificationThenReturnFileBaseSpecificationError)
81 ContactDataObject testFile;
85 ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
86 testFileLoadStatus = testFile.LoadFile("LoadCheck-Load3.vcf");
90 ASSERT_EQ(CONTACTLOAD_FILEBASESPECFAIL, testFileLoadStatus);
94 TEST(ContactLoad, GivenContactDataObjectWhenLoadFileIsCalledThenContactLoadedOK)
99 ContactDataObject testFile;
103 ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
104 testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
108 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
112 TEST(ContactLoad, GivenLoadedContactDataObjectWhenContactKindIsCheckedThenContactKindIsIndividual)
115 // Check that the kind status has been set. (KIND).
119 ContactDataObject testFile;
120 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
121 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
125 ContactKindType testFileContactKindStatus = testFile.ContactKind;
128 // Check that the kind status has been set. (KIND).
130 ASSERT_NE(CONTACTKIND_NONE, testFileContactKindStatus);
131 ASSERT_EQ(CONTACTKIND_INDIVIDUAL, testFileContactKindStatus);
135 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListForFirstGroupThenOnlyFirstGroupIsReturned)
138 // Check that the groups have been read (MEMBER).
140 std::map<int,wxString>::iterator testFileIter;
144 ContactDataObject testFile;
145 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
146 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
150 testFileIter = testFile.GroupsList.find(0);
154 ASSERT_NE(testFile.GroupsList.end(), testFileIter);
155 ASSERT_EQ("7a2af44d-6431-4797-a55f-d86d56304fda", testFileIter->second);
159 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListAltIDForFirstGroupThenOnlyFirstGroupAltIDIsReturned)
162 // Check the ALTID parameter for MEMBER.
164 std::map<int,wxString>::iterator testFileIter;
168 ContactDataObject testFile;
169 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
170 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
174 testFileIter = testFile.GroupsListAltID.find(0);
178 ASSERT_NE(testFile.GroupsListAltID.end(), testFileIter);
179 ASSERT_EQ("35", testFileIter->second);
183 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListPIDForFirstGroupThenOnlyFirstGroupPIDIsReturned)
186 // Check the PID parameter for MEMBER.
188 std::map<int,wxString>::iterator testFileIter;
189 std::map<int,int>::iterator testFileIntIter;
190 ContactDataObject testFile;
194 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
195 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
199 testFileIter = testFile.GroupsListPID.find(0);
203 ASSERT_NE(testFile.GroupsListPID.end(), testFileIter);
204 ASSERT_EQ("40", testFileIter->second);
208 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListPreferenceForFirstGroupThenOnlyFirstGroupPreferenceIsReturned)
211 // Check the PREF parameter for MEMBER.
213 std::map<int,wxString>::iterator testFileIter;
214 std::map<int,int>::iterator testFileIntIter;
215 ContactDataObject testFile;
219 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
220 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
224 testFileIntIter = testFile.GroupsListPref.find(0);
228 ASSERT_NE(testFile.GroupsListPref.end(), testFileIntIter);
229 ASSERT_EQ(45, testFileIntIter->second);
233 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListMediatypeForFirstGroupThenOnlyFirstGroupMediatypeIsReturned)
236 // Check the MEDIATYPE parameter for MEMBER.
238 std::map<int,wxString>::iterator testFileIter;
239 std::map<int,int>::iterator testFileIntIter;
240 ContactDataObject testFile;
244 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
245 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
249 testFileIter = testFile.GroupsListMediaType.find(0);
253 ASSERT_NE(testFile.GroupsListMediaType.end(), testFileIter);
254 ASSERT_EQ("text/plain", testFileIter->second);
258 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnGroupsListExtraTokensForFirstGroupThenOnlyFirstGroupExtraTokensIsReturned)
261 // Check the extra tokens parameter for MEMBER.
263 std::map<int,wxString>::iterator testFileIter;
264 std::map<int,int>::iterator testFileIntIter;
265 ContactDataObject testFile;
269 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
270 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
274 testFileIter = testFile.GroupsListTokens.find(0);
278 ASSERT_NE(testFile.GroupsListTokens.end(), testFileIter);
279 ASSERT_EQ("EXAMPLE=Meep", testFileIter->second);
283 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNameForFirstFullNameThenOnlyFirstFullNameIsReturned)
286 // Check that the formatted name has been read (FN).
288 std::map<int,wxString>::iterator testFileIter;
289 std::map<int,int>::iterator testFileIntIter;
290 ContactDataObject testFile;
294 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
295 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
299 testFileIter = testFile.FullNamesList.find(0);
303 ASSERT_NE(testFile.FullNamesList.end(), testFileIter);
304 ASSERT_EQ("Test Contact", testFileIter->second);
308 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNameTypeForFirstFullNameThenOnlyFirstFullNameTypeIsReturned)
311 // Check the TYPE parameter for FN.
313 std::map<int,wxString>::iterator testFileIter;
314 std::map<int,int>::iterator testFileIntIter;
315 ContactDataObject testFile;
319 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
320 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
324 testFileIter = testFile.FullNamesListType.find(0);
328 ASSERT_NE(testFile.FullNamesListType.end(), testFileIter);
329 ASSERT_EQ("work", testFileIter->second);
333 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNameLanguageForFirstFullNameThenOnlyFirstFullNameLanguageIsReturned)
336 // Check the LANGUAGE parameter for FN.
338 std::map<int,wxString>::iterator testFileIter;
339 std::map<int,int>::iterator testFileIntIter;
340 ContactDataObject testFile;
344 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
345 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
349 testFileIter = testFile.FullNamesListLanguage.find(0);
353 ASSERT_NE(testFile.FullNamesListLanguage.end(), testFileIter);
354 ASSERT_EQ("kw", testFileIter->second);
358 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNameAltIDForFirstFullNameThenOnlyFirstFullNameAltIDIsReturned)
361 // Check the ALTID parameter for FN.
363 std::map<int,wxString>::iterator testFileIter;
364 std::map<int,int>::iterator testFileIntIter;
365 ContactDataObject testFile;
369 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
370 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
374 testFileIter = testFile.FullNamesListAltID.find(0);
378 ASSERT_NE(testFile.FullNamesListAltID.end(), testFileIter);
379 ASSERT_EQ("500", testFileIter->second);
383 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNamePIDForFirstFullNameThenOnlyFirstFullNamePIDIsReturned)
386 // Check the PID parameter for FN.
388 std::map<int,wxString>::iterator testFileIter;
389 std::map<int,int>::iterator testFileIntIter;
390 ContactDataObject testFile;
394 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
395 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
399 testFileIter = testFile.FullNamesListPID.find(0);
403 ASSERT_NE(testFile.FullNamesListPID.end(), testFileIter);
404 ASSERT_EQ("40", testFileIter->second);
408 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNamePrefForFirstFullNameThenOnlyFirstFullNamePrefIsReturned)
411 // Check the PREF parameter for FN.
413 std::map<int,wxString>::iterator testFileIter;
414 std::map<int,int>::iterator testFileIntIter;
415 ContactDataObject testFile;
419 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
420 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
424 testFileIntIter = testFile.FullNamesListPref.find(0);
428 ASSERT_NE(testFile.FullNamesListPref.end(), testFileIntIter);
429 ASSERT_EQ(45, testFileIntIter->second);
433 TEST(ContactLoad, GivenContactDataObjectWhenFindIsCalledOnFullNameExtraTokensForFirstFullNameThenOnlyFirstFullNameExtraTokensIsReturned)
436 // Check for the extra tokens parameter for FN.
438 std::map<int,wxString>::iterator testFileIter;
439 std::map<int,int>::iterator testFileIntIter;
440 ContactDataObject testFile;
444 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
445 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
449 testFileIter = testFile.FullNamesListTokens.find(0);
453 ASSERT_NE(testFile.FullNamesListTokens.end(), testFileIter);
454 ASSERT_EQ("EXAMPLE=Baaa", testFileIter->second);
458 TEST(ContactLoad, GivenContactDataObjectWhenNameValuesAreRetrievedThenValuesForNameIsReturned)
461 // Check that the name has been read for N.
463 std::map<int,wxString>::iterator testFileIter;
464 std::map<int,int>::iterator testFileIntIter;
465 ContactDataObject testFile;
469 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
470 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
474 wxString nameSurname = testFile.NameSurname;
475 wxString nameForename = testFile.NameForename;
476 wxString nameOtherNames = testFile.NameOtherNames;
477 wxString nameTitle = testFile.NameTitle;
478 wxString nameSuffix = testFile.NameSuffix;
482 ASSERT_EQ("Contact", nameSurname);
483 ASSERT_EQ("Test", nameForename);
484 ASSERT_EQ("Example", nameOtherNames);
485 ASSERT_EQ("Robot", nameTitle);
486 ASSERT_EQ("LOONY", nameSuffix);
490 TEST(ContactLoad, GivenContactDataObjectWhenNameAltIDIsRetrievedThenValueforNameAltIDIsReturned)
493 // Check the ALTID parameter for N.
495 std::map<int,wxString>::iterator testFileIter;
496 std::map<int,int>::iterator testFileIntIter;
497 ContactDataObject testFile;
501 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
502 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
506 wxString nameAltID = testFile.NameAltID;
510 ASSERT_EQ("3", nameAltID);
514 TEST(ContactLoad, GivenContactDataObjectWhenNameLanguageIsRetrievedThenValueforNameLanguageIsReturned)
517 // Check the LANGUAGE parameter for N.
519 std::map<int,wxString>::iterator testFileIter;
520 std::map<int,int>::iterator testFileIntIter;
521 ContactDataObject testFile;
525 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
526 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
530 wxString nameLanguage = testFile.NameLanguage;
534 ASSERT_EQ("kw", nameLanguage);
538 TEST(ContactLoad, GivenContactDataObjectWhenNameDisplayAsIsRetrievedThenValueforNameDisplayAsIsReturned)
541 // Check the SORT-AS parameter for N.
543 std::map<int,wxString>::iterator testFileIter;
544 std::map<int,int>::iterator testFileIntIter;
545 ContactDataObject testFile;
549 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
550 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
554 wxString nameDisplayAs = testFile.NameDisplayAs;
558 ASSERT_EQ("Contact,Test", nameDisplayAs);
562 TEST(ContactLoad, GivenContactDataObjectWhenNameExtraTokensIsRetrievedThenValueforNameExtraTokensIsReturned)
565 // Check the extra tokens parameter for N.
567 std::map<int,wxString>::iterator testFileIter;
568 std::map<int,int>::iterator testFileIntIter;
569 ContactDataObject testFile;
573 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
574 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
578 wxString nameTokens = testFile.NameTokens;
582 ASSERT_EQ("TEST=Yes", nameTokens);
586 /* TEMPLATE: PLEASE COPY BEFORE USING IT. */
588 TEST(ContactLoad, GivenWhenThen)
591 std::map<int,wxString>::iterator testFileIter;
592 std::map<int,int>::iterator testFileIntIter;
593 ContactDataObject testFile;
597 ContactLoadStatus testFileLoadStatus = testFile.LoadFile("LoadCheck-Load4.vcf");
598 ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
606 /* END OF TEMPLATE: LOOK UP */
608 TEST(ContactLoad, UIDTest){
610 ContactDataObject TestFile;
612 // Check that the vCard 4.0 file loads OK.
614 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
616 ASSERT_EQ("903588-9082374-989120310-AAFECDBCDF", TestFile.UIDToken);
620 TEST(ContactLoad, ClientPIDMapTests){
622 ContactDataObject TestFile;
624 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
626 std::map<int,wxString>::iterator TestFileIter;
628 // Test the first Client PID Map.
630 TestFileIter = TestFile.ClientPIDList.find(0);
631 ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
632 ASSERT_EQ("1;urn;uuid:aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", TestFileIter->second);
634 TestFileIter = TestFile.ClientPIDListTokens.find(0);
635 ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
637 // Test the second Client PID Map.
639 TestFileIter = TestFile.ClientPIDList.find(1);
640 ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
641 ASSERT_EQ("2;urn;uuid:ccccccccc-cccc-cccc-cccc-cccccccccccc", TestFileIter->second);
643 TestFileIter = TestFile.ClientPIDListTokens.find(1);
644 ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
646 // Test the third Client PID Map.
648 TestFileIter = TestFile.ClientPIDListTokens.find(2);
649 ASSERT_NE(TestFile.ClientPIDListTokens.end(), TestFileIter);
650 ASSERT_EQ("MEEP=MOO;WOOP=WOO", TestFileIter->second);
652 TestFileIter = TestFile.ClientPIDList.find(2);
653 ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
654 ASSERT_EQ("3;urn;uuid:bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", TestFileIter->second);
658 TEST(ContactLoad, RevisionTests){
660 ContactDataObject TestFile;
662 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
664 ASSERT_EQ("20151227T033000Z", TestFile.Revision);
665 ASSERT_EQ("TEST=YES;DATA=NO;MORE=MAYBE", TestFile.RevisionTokens);
669 TEST(ContactLoad, SourceTests){
671 ContactDataObject TestFile;
673 // Check that the vCard 4.0 file loads OK.
675 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
677 std::map<int,wxString>::iterator TestFileIter;
678 std::map<int,int>::iterator TestFileIntIter;
680 // Start with a general source address.
682 TestFileIter = TestFile.SourceList.find(0);
683 ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
684 ASSERT_EQ("http://example.com/source/sourcea.vcf", TestFileIter->second);
686 // Check the TYPE section.
688 TestFileIter = TestFile.SourceListType.find(0);
689 ASSERT_EQ(TestFile.SourceListType.end(), TestFileIter);
691 // Check the ALTID section.
693 TestFileIter = TestFile.SourceListAltID.find(0);
694 ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
695 ASSERT_EQ("74", TestFileIter->second);
697 // Check the PID section.
699 TestFileIter = TestFile.SourceListPID.find(0);
700 ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
701 ASSERT_EQ("71", TestFileIter->second);
703 // Check the MEDIATYPE section.
705 TestFileIter = TestFile.SourceListMediatype.find(0);
706 ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
707 ASSERT_EQ("text/plain", TestFileIter->second);
709 // Check the PREF section.
711 TestFileIntIter = TestFile.SourceListPref.find(0);
712 ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
713 ASSERT_EQ(72, TestFileIntIter->second);
715 // Check the extra tokens.
717 TestFileIter = TestFile.SourceListTokens.find(0);
718 ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
719 ASSERT_EQ("STATUS=FEED", TestFileIter->second);
721 // Start with the home source address.
723 TestFileIter = TestFile.SourceList.find(1);
724 ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
725 ASSERT_EQ("http://example.com/source/sourceb.vcf", TestFileIter->second);
727 // Check the TYPE section.
729 TestFileIter = TestFile.SourceListType.find(1);
730 ASSERT_NE(TestFile.SourceListType.end(), TestFileIter);
731 ASSERT_EQ("home", TestFileIter->second);
733 // Check the ALTID section.
735 TestFileIter = TestFile.SourceListAltID.find(1);
736 ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
737 ASSERT_EQ("84", TestFileIter->second);
739 // Check the PID section.
741 TestFileIter = TestFile.SourceListPID.find(1);
742 ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
743 ASSERT_EQ("81", TestFileIter->second);
745 // Check the MEDIATYPE section.
747 TestFileIter = TestFile.SourceListMediatype.find(1);
748 ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
749 ASSERT_EQ("text/plainpaper", TestFileIter->second);
751 // Check the PREF section.
753 TestFileIntIter = TestFile.SourceListPref.find(1);
754 ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
755 ASSERT_EQ(82, TestFileIntIter->second);
757 // Check the extra tokens.
759 TestFileIter = TestFile.SourceListTokens.find(1);
760 ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
761 ASSERT_EQ("STATUS=ONLINE", TestFileIter->second);
763 // Start with the home source address.
765 TestFileIter = TestFile.SourceList.find(2);
766 ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
767 ASSERT_EQ("http://example.com/source/sourcec.vcf", TestFileIter->second);
769 // Check the TYPE section.
771 TestFileIter = TestFile.SourceListType.find(2);
772 ASSERT_NE(TestFile.SourceListType.end(), TestFileIter);
773 ASSERT_EQ("work", TestFileIter->second);
775 // Check the ALTID section.
777 TestFileIter = TestFile.SourceListAltID.find(2);
778 ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
779 ASSERT_EQ("94", TestFileIter->second);
781 // Check the PID section.
783 TestFileIter = TestFile.SourceListPID.find(2);
784 ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
785 ASSERT_EQ("91", TestFileIter->second);
787 // Check the MEDIATYPE section.
789 TestFileIter = TestFile.SourceListMediatype.find(2);
790 ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
791 ASSERT_EQ("text/sandpaper", TestFileIter->second);
793 // Check the PREF section.
795 TestFileIntIter = TestFile.SourceListPref.find(2);
796 ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
797 ASSERT_EQ(92, TestFileIntIter->second);
799 // Check the extra tokens.
801 TestFileIter = TestFile.SourceListTokens.find(2);
802 ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
803 ASSERT_EQ("STATUS=OFFLINE", TestFileIter->second);
807 TEST(ContactLoad, XMLTest){
809 ContactDataObject TestFile;
811 // Check that the vCard 4.0 file loads OK.
813 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
815 std::map<int,wxString>::iterator TestFileIter;
816 std::map<int,int>::iterator TestFileIntIter;
818 // Start with the first XML property.
820 // Start with a general source address.
822 TestFileIter = TestFile.XMLList.find(0);
823 ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
824 ASSERT_EQ("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
825 " href=\"http://example.com/\">Example Page 1</a>", TestFileIter->second);
827 TestFileIter = TestFile.XMLList.find(1);
828 ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
829 ASSERT_EQ("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
830 " href=\"http://example.com/page2.html\">Example Page 2</a>", TestFileIter->second);
832 TestFileIter = TestFile.XMLList.find(2);
833 ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
834 ASSERT_EQ("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
835 " href=\"http://example.com/page3.html\">Example Page 3</a>", TestFileIter->second);
839 TEST(ContactLoad, NicknameTests){
841 ContactDataObject TestFile;
843 // Check that the vCard 4.0 file loads OK.
845 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
847 std::map<int,wxString>::iterator TestFileIter;
848 std::map<int,int>::iterator TestFileIntIter;
850 // Check that the nickname has been read (NICKNAME). General.
852 TestFileIter = TestFile.GeneralNicknamesList.find(0);
853 ASSERT_NE(TestFile.GeneralNicknamesList.end(), TestFileIter);
854 ASSERT_EQ("Tester", TestFileIter->second);
856 // Check the ALTID parameter.
858 TestFileIter = TestFile.GeneralNicknamesListAltID.find(0);
859 ASSERT_NE(TestFile.GeneralNicknamesListAltID.end(), TestFileIter);
860 ASSERT_EQ("35", TestFileIter->second);
862 // Check the PID parameter.
864 TestFileIter = TestFile.GeneralNicknamesListPID.find(0);
865 ASSERT_NE(TestFile.GeneralNicknamesListPID.end(), TestFileIter);
866 ASSERT_EQ("50", TestFileIter->second);
868 // Check the PREF parameter.
870 TestFileIntIter = TestFile.GeneralNicknamesListPref.find(0);
871 ASSERT_NE(TestFile.GeneralNicknamesListPref.end(), TestFileIntIter);
872 ASSERT_EQ(40, TestFileIntIter->second);
874 // Check the LANGUAGE parameter.
876 TestFileIter = TestFile.GeneralNicknamesListLanguage.find(0);
877 ASSERT_NE(TestFile.GeneralNicknamesListLanguage.end(), TestFileIter);
878 ASSERT_EQ("kw", TestFileIter->second);
880 // Check the extra tokens parameter.
882 TestFileIter = TestFile.GeneralNicknamesListTokens.find(0);
883 ASSERT_NE(TestFile.GeneralNicknamesListTokens.end(), TestFileIter);
884 ASSERT_EQ("YAY=Nope;Beep=Boop", TestFileIter->second);
886 // Repeat for the home type.
888 TestFileIter = TestFile.HomeNicknamesList.find(1);
889 ASSERT_NE(TestFile.HomeNicknamesList.end(), TestFileIter);
890 ASSERT_EQ("Testy", TestFileIter->second);
892 // Check the ALTID parameter.
894 TestFileIter = TestFile.HomeNicknamesListAltID.find(1);
895 ASSERT_NE(TestFile.HomeNicknamesListAltID.end(), TestFileIter);
896 ASSERT_EQ("17", TestFileIter->second);
898 // Check the PID parameter.
900 TestFileIter = TestFile.HomeNicknamesListPID.find(1);
901 ASSERT_NE(TestFile.HomeNicknamesListPID.end(), TestFileIter);
902 ASSERT_EQ("39", TestFileIter->second);
904 // Check the PREF parameter.
906 TestFileIntIter = TestFile.HomeNicknamesListPref.find(1);
907 ASSERT_NE(TestFile.HomeNicknamesListPref.end(), TestFileIntIter);
908 ASSERT_EQ(78, TestFileIntIter->second);
910 // Check the LANGUAGE parameter.
912 TestFileIter = TestFile.HomeNicknamesListLanguage.find(1);
913 ASSERT_NE(TestFile.HomeNicknamesListLanguage.end(), TestFileIter);
914 ASSERT_EQ("en", TestFileIter->second);
916 // Check the extra tokens parameter.
918 TestFileIter = TestFile.HomeNicknamesListTokens.find(1);
919 ASSERT_NE(TestFile.HomeNicknamesListTokens.end(), TestFileIter);
920 ASSERT_EQ("YAY=Yep;Beep=Boop", TestFileIter->second);
922 // Repeat for the work type.
924 TestFileIter = TestFile.BusinessNicknamesList.find(2);
925 ASSERT_NE(TestFile.BusinessNicknamesList.end(), TestFileIter);
926 ASSERT_EQ("The Testing One", TestFileIter->second);
928 // Check the ALTID parameter.
930 TestFileIter = TestFile.BusinessNicknamesListAltID.find(2);
931 ASSERT_NE(TestFile.BusinessNicknamesListAltID.end(), TestFileIter);
932 ASSERT_EQ("99", TestFileIter->second);
934 // Check the PID parameter.
936 TestFileIter = TestFile.BusinessNicknamesListPID.find(2);
937 ASSERT_NE(TestFile.BusinessNicknamesListPID.end(), TestFileIter);
938 ASSERT_EQ("10", TestFileIter->second);
940 // Check the PREF parameter.
942 TestFileIntIter = TestFile.BusinessNicknamesListPref.find(2);
943 ASSERT_NE(TestFile.BusinessNicknamesListPref.end(), TestFileIntIter);
944 ASSERT_EQ(1, TestFileIntIter->second);
946 // Check the LANGUAGE parameter.
948 TestFileIter = TestFile.BusinessNicknamesListLanguage.find(2);
949 ASSERT_NE(TestFile.BusinessNicknamesListLanguage.end(), TestFileIter);
950 ASSERT_EQ("en-GB", TestFileIter->second);
952 // Check the extra tokens parameter.
954 TestFileIter = TestFile.BusinessNicknamesListTokens.find(2);
955 ASSERT_NE(TestFile.BusinessNicknamesListTokens.end(), TestFileIter);
956 ASSERT_EQ("YAY=Maybe;Boop=Boing", TestFileIter->second);
960 TEST(ContactLoad, GenderTests){
962 // Check that the gender has been read.
964 ContactDataObject TestFile;
966 // Check that the vCard 4.0 file loads OK.
968 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
970 std::map<int,wxString>::iterator TestFileIter;
971 std::map<int,int>::iterator TestFileIntIter;
973 ASSERT_NE("", TestFile.Gender);
974 ASSERT_EQ("F", TestFile.Gender);
975 ASSERT_EQ("Example Text", TestFile.GenderDetails);
976 ASSERT_EQ("BEEP=Boop", TestFile.GenderTokens);
980 TEST(ContactLoad, BirthdayTests){
982 // Check that the birthday has been read.
984 ContactDataObject TestFile;
986 // Check that the vCard 4.0 file loads OK.
988 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
990 std::map<int,wxString>::iterator TestFileIter;
991 std::map<int,int>::iterator TestFileIntIter;
993 ASSERT_NE("", TestFile.Birthday);
994 ASSERT_EQ("20040101", TestFile.Birthday);
996 // Check the ALTID parameter.
998 ASSERT_EQ("35", TestFile.BirthdayAltID);
1000 // Check the CALSCALE parameter.
1002 ASSERT_EQ("georgian", TestFile.BirthdayCalScale);
1004 // Check the extra tokens parameter.
1006 ASSERT_EQ("HAPPY=Days", TestFile.BirthdayTokens);
1008 // Check the VALUE parameter. (Note have to use a different file
1009 // due to the *1 rule in RFC6350.
1011 ContactDataObject TestFileValue;
1012 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4-BDayValue.vcf"));
1014 ASSERT_EQ("Circa 2000s", TestFile.Birthday);
1018 TEST(ContactLoad, AnniversaryTests){
1020 // Check that the anniversary has been read.
1022 ContactDataObject TestFile;
1024 // Check that the vCard 4.0 file loads OK.
1026 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1028 std::map<int,wxString>::iterator TestFileIter;
1029 std::map<int,int>::iterator TestFileIntIter;
1031 ASSERT_NE("", TestFile.Anniversary);
1032 ASSERT_EQ("20200516", TestFile.Anniversary);
1034 // Check the ALTID parameter.
1036 ASSERT_EQ("70", TestFile.AnniversaryAltID);
1038 // Check the CALSCALE parameter.
1040 ASSERT_EQ("georgian", TestFile.AnniversaryCalScale);
1042 // Check the extra tokens parameter.
1044 ASSERT_EQ("WONDERFUL=Day", TestFile.AnniversaryTokens);
1046 // Check the VALUE parameter. (Note have to use a different file
1047 // due to the *1 rule in RFC6350.
1049 ContactDataObject TestFileValue;
1050 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4-BDayValue.vcf"));
1052 ASSERT_EQ("Circa 2020s", TestFile.Anniversary);
1056 TEST(ContactLoad, TimeZoneTests){
1058 ContactDataObject TestFile;
1060 // Check that the vCard 4.0 file loads OK.
1062 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1064 std::map<int,wxString>::iterator TestFileIter;
1065 std::map<int,int>::iterator TestFileIntIter;
1067 // Check that the timezone has been read (TZ). General.
1069 TestFileIter = TestFile.GeneralTZList.find(0);
1070 ASSERT_NE(TestFile.GeneralTZList.end(), TestFileIter);
1071 ASSERT_EQ("Europe/Truro", TestFileIter->second);
1073 // Check the ALTID parameter.
1075 TestFileIter = TestFile.GeneralTZListAltID.find(0);
1076 ASSERT_NE(TestFile.GeneralTZListAltID.end(), TestFileIter);
1077 ASSERT_EQ("35", TestFileIter->second);
1079 // Check the PID parameter.
1081 TestFileIter = TestFile.GeneralTZListPID.find(0);
1082 ASSERT_NE(TestFile.GeneralTZListPID.end(), TestFileIter);
1083 ASSERT_EQ("60", TestFileIter->second);
1085 // Check the PREF parameter.
1087 TestFileIntIter = TestFile.GeneralTZListPref.find(0);
1088 ASSERT_NE(TestFile.GeneralTZListPref.end(), TestFileIntIter);
1089 ASSERT_EQ(20, TestFileIntIter->second);
1091 // Check the LANGUAGE parameter.
1093 TestFileIter = TestFile.GeneralTZListMediatype.find(0);
1094 ASSERT_NE(TestFile.GeneralTZListMediatype.end(), TestFileIter);
1095 ASSERT_EQ("text/plain", TestFileIter->second);
1097 // Check the extra tokens parameter.
1099 TestFileIter = TestFile.GeneralTZListTokens.find(0);
1100 ASSERT_NE(TestFile.GeneralTZListTokens.end(), TestFileIter);
1101 ASSERT_EQ("WHATS=This;A=Potato", TestFileIter->second);
1103 // Check that the timezone has been read (TZ). Home.
1105 TestFileIter = TestFile.HomeTZList.find(1);
1106 ASSERT_NE(TestFile.HomeTZList.end(), TestFileIter);
1107 ASSERT_EQ("Europe/Penzance", TestFileIter->second);
1109 // Check the ALTID parameter.
1111 TestFileIter = TestFile.HomeTZListAltID.find(1);
1112 ASSERT_NE(TestFile.HomeTZListAltID.end(), TestFileIter);
1113 ASSERT_EQ("15", TestFileIter->second);
1115 // Check the PID parameter.
1117 TestFileIter = TestFile.HomeTZListPID.find(1);
1118 ASSERT_NE(TestFile.HomeTZListPID.end(), TestFileIter);
1119 ASSERT_EQ("20", TestFileIter->second);
1121 // Check the PREF parameter.
1123 TestFileIntIter = TestFile.HomeTZListPref.find(1);
1124 ASSERT_NE(TestFile.HomeTZListPref.end(), TestFileIntIter);
1125 ASSERT_EQ(40, TestFileIntIter->second);
1127 // Check the LANGUAGE parameter.
1129 TestFileIter = TestFile.HomeTZListMediatype.find(1);
1130 ASSERT_NE(TestFile.HomeTZListMediatype.end(), TestFileIter);
1131 ASSERT_EQ("text/plain", TestFileIter->second);
1133 // Check the extra tokens parameter.
1135 TestFileIter = TestFile.HomeTZListTokens.find(1);
1136 ASSERT_NE(TestFile.HomeTZListTokens.end(), TestFileIter);
1137 ASSERT_EQ("MAYBE=not", TestFileIter->second);
1139 // Check that the timezone has been read (TZ). Business.
1141 TestFileIter = TestFile.BusinessTZList.find(2);
1142 ASSERT_NE(TestFile.BusinessTZList.end(), TestFileIter);
1143 ASSERT_EQ("Europe/St Austell", TestFileIter->second);
1145 // Check the ALTID parameter.
1147 TestFileIter = TestFile.BusinessTZListAltID.find(2);
1148 ASSERT_NE(TestFile.BusinessTZListAltID.end(), TestFileIter);
1149 ASSERT_EQ("45", TestFileIter->second);
1151 // Check the PID parameter.
1153 TestFileIter = TestFile.BusinessTZListPID.find(2);
1154 ASSERT_NE(TestFile.BusinessTZListPID.end(), TestFileIter);
1155 ASSERT_EQ("70", TestFileIter->second);
1157 // Check the PREF parameter.
1159 TestFileIntIter = TestFile.BusinessTZListPref.find(2);
1160 ASSERT_NE(TestFile.BusinessTZListPref.end(), TestFileIntIter);
1161 ASSERT_EQ(80, TestFileIntIter->second);
1163 // Check the LANGUAGE parameter.
1165 TestFileIter = TestFile.BusinessTZListMediatype.find(2);
1166 ASSERT_NE(TestFile.BusinessTZListMediatype.end(), TestFileIter);
1167 ASSERT_EQ("text/plain", TestFileIter->second);
1169 // Check the extra tokens parameter.
1171 TestFileIter = TestFile.BusinessTZListTokens.find(2);
1172 ASSERT_NE(TestFile.BusinessTZListTokens.end(), TestFileIter);
1173 ASSERT_EQ("MAYBE=yes", TestFileIter->second);
1177 TEST(ContactLoad, AddressTests){
1179 ContactDataObject TestFile;
1181 // Check that the vCard 4.0 file loads OK.
1183 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1185 std::map<int,wxString>::iterator TestFileIter;
1186 std::map<int,int>::iterator TestFileIntIter;
1188 // Start with the general address.
1190 // Check the address street section.
1192 TestFileIter = TestFile.GeneralAddressList.find(0);
1193 ASSERT_NE(TestFile.GeneralAddressList.end(), TestFileIter);
1194 ASSERT_EQ("1 Lovely Lane", TestFileIter->second);
1196 // Check the address town section.
1198 TestFileIter = TestFile.GeneralAddressListTown.find(0);
1199 ASSERT_NE(TestFile.GeneralAddressListTown.end(), TestFileIter);
1200 ASSERT_EQ("Rodney", TestFileIter->second);
1202 // Check the address county section.
1204 TestFileIter = TestFile.GeneralAddressListCounty.find(0);
1205 ASSERT_NE(TestFile.GeneralAddressListCounty.end(), TestFileIter);
1206 ASSERT_EQ("Cornwall", TestFileIter->second);
1208 // Check the address post code section.
1210 TestFileIter = TestFile.GeneralAddressListPostCode.find(0);
1211 ASSERT_NE(TestFile.GeneralAddressListPostCode.end(), TestFileIter);
1212 ASSERT_EQ("PL99 1AA", TestFileIter->second);
1214 // Check the address country section.
1216 TestFileIter = TestFile.GeneralAddressListCountry.find(0);
1217 ASSERT_NE(TestFile.GeneralAddressListCountry.end(), TestFileIter);
1218 ASSERT_EQ("United Kingdom", TestFileIter->second);
1220 // Check the LABEL section.
1222 TestFileIter = TestFile.GeneralAddressListLabel.find(0);
1223 ASSERT_NE(TestFile.GeneralAddressListLabel.end(), TestFileIter);
1224 ASSERT_EQ("\"1 Lovely Lane\nRodney\nCornwall\nPL99 1AA\nCornwall\nUnited Kingdom\"", TestFileIter->second);
1226 // Check the LANGUAGE section.
1228 TestFileIter = TestFile.GeneralAddressListLang.find(0);
1229 ASSERT_NE(TestFile.GeneralAddressListLang.end(), TestFileIter);
1230 ASSERT_EQ("kw", TestFileIter->second);
1232 // Check the ALTID section.
1234 TestFileIter = TestFile.GeneralAddressListAltID.find(0);
1235 ASSERT_NE(TestFile.GeneralAddressListAltID.end(), TestFileIter);
1236 ASSERT_EQ("15", TestFileIter->second);
1238 // Check the PID section.
1240 TestFileIter = TestFile.GeneralAddressListPID.find(0);
1241 ASSERT_NE(TestFile.GeneralAddressListPID.end(), TestFileIter);
1242 ASSERT_EQ("81", TestFileIter->second);
1244 // Check the GEO section.
1246 TestFileIter = TestFile.GeneralAddressListGeo.find(0);
1247 ASSERT_NE(TestFile.GeneralAddressListGeo.end(), TestFileIter);
1248 ASSERT_EQ("geo:1.0, 1.0", TestFileIter->second);
1250 // Check the TZ section.
1252 TestFileIter = TestFile.GeneralAddressListTimezone.find(0);
1253 ASSERT_NE(TestFile.GeneralAddressListTimezone.end(), TestFileIter);
1254 ASSERT_EQ("Europe/Truro", TestFileIter->second);
1256 // Check the MEDIATYPE section.
1258 TestFileIter = TestFile.GeneralAddressListMediatype.find(0);
1259 ASSERT_NE(TestFile.GeneralAddressListMediatype.end(), TestFileIter);
1260 ASSERT_EQ("text/plain", TestFileIter->second);
1262 // Check the PREF section.
1264 TestFileIntIter = TestFile.GeneralAddressListPref.find(0);
1265 ASSERT_NE(TestFile.GeneralAddressListPref.end(), TestFileIntIter);
1266 ASSERT_EQ(98, TestFileIntIter->second);
1268 // Check the extra tokens.
1270 TestFileIter = TestFile.GeneralAddressListTokens.find(0);
1271 ASSERT_NE(TestFile.GeneralAddressListTokens.end(), TestFileIter);
1272 ASSERT_EQ("MAKES=Moo;ANIMAL=Cow", TestFileIter->second);
1274 // Process the home address
1276 // Check the address street section.
1278 TestFileIter = TestFile.HomeAddressList.find(1);
1279 ASSERT_NE(TestFile.HomeAddressList.end(), TestFileIter);
1280 ASSERT_EQ("3 Working Plaice", TestFileIter->second);
1282 // Check the address town section.
1284 TestFileIter = TestFile.HomeAddressListTown.find(1);
1285 ASSERT_NE(TestFile.HomeAddressListTown.end(), TestFileIter);
1286 ASSERT_EQ("Roger", TestFileIter->second);
1288 // Check the address county section.
1290 TestFileIter = TestFile.HomeAddressListCounty.find(1);
1291 ASSERT_NE(TestFile.HomeAddressListCounty.end(), TestFileIter);
1292 ASSERT_EQ("Cornwall", TestFileIter->second);
1294 // Check the address post code section.
1296 TestFileIter = TestFile.HomeAddressListPostCode.find(1);
1297 ASSERT_NE(TestFile.HomeAddressListPostCode.end(), TestFileIter);
1298 ASSERT_EQ("PL75 4ZZ", TestFileIter->second);
1300 // Check the address country section.
1302 TestFileIter = TestFile.HomeAddressListCountry.find(1);
1303 ASSERT_NE(TestFile.HomeAddressListCountry.end(), TestFileIter);
1304 ASSERT_EQ("United Kingdom", TestFileIter->second);
1306 // Check the LABEL section.
1308 TestFileIter = TestFile.HomeAddressListLabel.find(1);
1309 ASSERT_NE(TestFile.HomeAddressListLabel.end(), TestFileIter);
1310 ASSERT_EQ("\"3 Working Plaice\nRoger\nCornwall\nPL75 4ZZ\nCornwall\nUnited Kingdom\"", TestFileIter->second);
1312 // Check the LANGUAGE section.
1314 TestFileIter = TestFile.HomeAddressListLang.find(1);
1315 ASSERT_NE(TestFile.HomeAddressListLang.end(), TestFileIter);
1316 ASSERT_EQ("en", TestFileIter->second);
1318 // Check the ALTID section.
1320 TestFileIter = TestFile.HomeAddressListAltID.find(1);
1321 ASSERT_NE(TestFile.HomeAddressListAltID.end(), TestFileIter);
1322 ASSERT_EQ("40", TestFileIter->second);
1324 // Check the PID section.
1326 TestFileIter = TestFile.HomeAddressListPID.find(1);
1327 ASSERT_NE(TestFile.HomeAddressListPID.end(), TestFileIter);
1328 ASSERT_EQ("13", TestFileIter->second);
1330 // Check the GEO section.
1332 TestFileIter = TestFile.HomeAddressListGeo.find(1);
1333 ASSERT_NE(TestFile.HomeAddressListGeo.end(), TestFileIter);
1334 ASSERT_EQ("geo:4.0, 4.0", TestFileIter->second);
1336 // Check the TZ section.
1338 TestFileIter = TestFile.HomeAddressListTimezone.find(1);
1339 ASSERT_NE(TestFile.HomeAddressListTimezone.end(), TestFileIter);
1340 ASSERT_EQ("Europe/St Ives", TestFileIter->second);
1342 // Check the MEDIATYPE section.
1344 TestFileIter = TestFile.HomeAddressListMediatype.find(1);
1345 ASSERT_NE(TestFile.HomeAddressListMediatype.end(), TestFileIter);
1346 ASSERT_EQ("text/plain", TestFileIter->second);
1348 // Check the PREF section.
1350 TestFileIntIter = TestFile.HomeAddressListPref.find(1);
1351 ASSERT_NE(TestFile.HomeAddressListPref.end(), TestFileIntIter);
1352 ASSERT_EQ(10, TestFileIntIter->second);
1354 // Check the extra tokens.
1356 TestFileIter = TestFile.HomeAddressListTokens.find(1);
1357 ASSERT_NE(TestFile.HomeAddressListTokens.end(), TestFileIter);
1358 ASSERT_EQ("TOAST=Butter", TestFileIter->second);
1360 // Process the business address.
1362 // Check the address street section.
1364 TestFileIter = TestFile.BusinessAddressList.find(2);
1365 ASSERT_NE(TestFile.BusinessAddressList.end(), TestFileIter);
1366 ASSERT_EQ("7 Flyby Drive", TestFileIter->second);
1368 // Check the address town section.
1370 TestFileIter = TestFile.BusinessAddressListTown.find(2);
1371 ASSERT_NE(TestFile.BusinessAddressListTown.end(), TestFileIter);
1372 ASSERT_EQ("Elaine", TestFileIter->second);
1374 // Check the address county section.
1376 TestFileIter = TestFile.BusinessAddressListCounty.find(2);
1377 ASSERT_NE(TestFile.BusinessAddressListCounty.end(), TestFileIter);
1378 ASSERT_EQ("Cornwall", TestFileIter->second);
1380 // Check the address post code section.
1382 TestFileIter = TestFile.BusinessAddressListPostCode.find(2);
1383 ASSERT_NE(TestFile.BusinessAddressListPostCode.end(), TestFileIter);
1384 ASSERT_EQ("PL84 9YE", TestFileIter->second);
1386 // Check the address country section.
1388 TestFileIter = TestFile.BusinessAddressListCountry.find(2);
1389 ASSERT_NE(TestFile.BusinessAddressListCountry.end(), TestFileIter);
1390 ASSERT_EQ("United Kingdom", TestFileIter->second);
1392 // Check the LABEL section.
1394 TestFileIter = TestFile.BusinessAddressListLabel.find(2);
1395 ASSERT_NE(TestFile.BusinessAddressListLabel.end(), TestFileIter);
1396 ASSERT_EQ("\"7 Flyby Drive\nElaine\nCornwall\nPL84 9YE\nCornwall\nUnited Kingdom\"", TestFileIter->second);
1398 // Check the LANGUAGE section.
1400 TestFileIter = TestFile.BusinessAddressListLang.find(2);
1401 ASSERT_NE(TestFile.BusinessAddressListLang.end(), TestFileIter);
1402 ASSERT_EQ("en-GB", TestFileIter->second);
1404 // Check the ALTID section.
1406 TestFileIter = TestFile.BusinessAddressListAltID.find(2);
1407 ASSERT_NE(TestFile.BusinessAddressListAltID.end(), TestFileIter);
1408 ASSERT_EQ("45", TestFileIter->second);
1410 // Check the PID section.
1412 TestFileIter = TestFile.BusinessAddressListPID.find(2);
1413 ASSERT_NE(TestFile.BusinessAddressListPID.end(), TestFileIter);
1414 ASSERT_EQ("28", TestFileIter->second);
1416 // Check the GEO section.
1418 TestFileIter = TestFile.BusinessAddressListGeo.find(2);
1419 ASSERT_NE(TestFile.BusinessAddressListGeo.end(), TestFileIter);
1420 ASSERT_EQ("geo:7.0, 7.0", TestFileIter->second);
1422 // Check the TZ section.
1424 TestFileIter = TestFile.BusinessAddressListTimezone.find(2);
1425 ASSERT_NE(TestFile.BusinessAddressListTimezone.end(), TestFileIter);
1426 ASSERT_EQ("Europe/Newquay", TestFileIter->second);
1428 // Check the MEDIATYPE section.
1430 TestFileIter = TestFile.BusinessAddressListMediatype.find(2);
1431 ASSERT_NE(TestFile.BusinessAddressListMediatype.end(), TestFileIter);
1432 ASSERT_EQ("text/plain", TestFileIter->second);
1434 // Check the PREF section.
1436 TestFileIntIter = TestFile.BusinessAddressListPref.find(2);
1437 ASSERT_NE(TestFile.BusinessAddressListPref.end(), TestFileIntIter);
1438 ASSERT_EQ(10, TestFileIntIter->second);
1440 // Check the extra tokens.
1442 TestFileIter = TestFile.BusinessAddressListTokens.find(2);
1443 ASSERT_NE(TestFile.BusinessAddressListTokens.end(), TestFileIter);
1444 ASSERT_EQ("JAM=Red", TestFileIter->second);
1449 TEST(ContactLoad, EmailTests){
1451 ContactDataObject TestFile;
1453 // Check that the vCard 4.0 file loads OK.
1455 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1457 std::map<int,wxString>::iterator TestFileIter;
1458 std::map<int,int>::iterator TestFileIntIter;
1460 // Start with the general email.
1462 TestFileIter = TestFile.GeneralEmailList.find(0);
1463 ASSERT_NE(TestFile.GeneralEmailList.end(), TestFileIter);
1464 ASSERT_EQ("moo@example.com", TestFileIter->second);
1466 // Check the ALTID section.
1468 TestFileIter = TestFile.GeneralEmailListAltID.find(0);
1469 ASSERT_NE(TestFile.GeneralEmailListAltID.end(), TestFileIter);
1470 ASSERT_EQ("10", TestFileIter->second);
1472 // Check the PID section.
1474 TestFileIter = TestFile.GeneralEmailListPID.find(0);
1475 ASSERT_NE(TestFile.GeneralEmailListPID.end(), TestFileIter);
1476 ASSERT_EQ("20", TestFileIter->second);
1478 // Check the PREF section.
1480 TestFileIntIter = TestFile.GeneralEmailListPref.find(0);
1481 ASSERT_NE(TestFile.GeneralEmailListPref.end(), TestFileIntIter);
1482 ASSERT_EQ(40, TestFileIntIter->second);
1484 // Check the extra tokens.
1486 TestFileIter = TestFile.GeneralEmailListTokens.find(0);
1487 ASSERT_NE(TestFile.GeneralEmailListTokens.end(), TestFileIter);
1488 ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
1490 // Start with the home email.
1492 TestFileIter = TestFile.HomeEmailList.find(1);
1493 ASSERT_NE(TestFile.HomeEmailList.end(), TestFileIter);
1494 ASSERT_EQ("moo.home@example.com", TestFileIter->second);
1496 // Check the ALTID section.
1498 TestFileIter = TestFile.HomeEmailListAltID.find(1);
1499 ASSERT_NE(TestFile.HomeEmailListAltID.end(), TestFileIter);
1500 ASSERT_EQ("5", TestFileIter->second);
1502 // Check the PID section.
1504 TestFileIter = TestFile.HomeEmailListPID.find(1);
1505 ASSERT_NE(TestFile.HomeEmailListPID.end(), TestFileIter);
1506 ASSERT_EQ("10", TestFileIter->second);
1508 // Check the PREF section.
1510 TestFileIntIter = TestFile.HomeEmailListPref.find(1);
1511 ASSERT_NE(TestFile.HomeEmailListPref.end(), TestFileIntIter);
1512 ASSERT_EQ(20, TestFileIntIter->second);
1514 // Check the extra tokens.
1516 TestFileIter = TestFile.HomeEmailListTokens.find(1);
1517 ASSERT_NE(TestFile.HomeEmailListTokens.end(), TestFileIter);
1518 ASSERT_EQ("PEACE=quiet", TestFileIter->second);
1520 // Start with the business email.
1522 TestFileIter = TestFile.BusinessEmailList.find(2);
1523 ASSERT_NE(TestFile.BusinessEmailList.end(), TestFileIter);
1524 ASSERT_EQ("moo.business@example.com", TestFileIter->second);
1526 // Check the ALTID section.
1528 TestFileIter = TestFile.BusinessEmailListAltID.find(2);
1529 ASSERT_NE(TestFile.BusinessEmailListAltID.end(), TestFileIter);
1530 ASSERT_EQ("1", TestFileIter->second);
1532 // Check the PID section.
1534 TestFileIter = TestFile.BusinessEmailListPID.find(2);
1535 ASSERT_NE(TestFile.BusinessEmailListPID.end(), TestFileIter);
1536 ASSERT_EQ("2", TestFileIter->second);
1538 // Check the PREF section.
1540 TestFileIntIter = TestFile.BusinessEmailListPref.find(2);
1541 ASSERT_NE(TestFile.BusinessEmailListPref.end(), TestFileIntIter);
1542 ASSERT_EQ(3, TestFileIntIter->second);
1544 // Check the extra tokens.
1546 TestFileIter = TestFile.BusinessEmailListTokens.find(2);
1547 ASSERT_NE(TestFile.BusinessEmailListTokens.end(), TestFileIter);
1548 ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
1552 TEST(ContactLoad, IMTests){
1554 ContactDataObject TestFile;
1556 // Check that the vCard 4.0 file loads OK.
1558 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1560 std::map<int,wxString>::iterator TestFileIter;
1561 std::map<int,int>::iterator TestFileIntIter;
1563 // Start with the general IM.
1565 TestFileIter = TestFile.GeneralIMList.find(0);
1566 ASSERT_NE(TestFile.GeneralIMList.end(), TestFileIter);
1567 ASSERT_EQ("moo@example.com", TestFileIter->second);
1569 // Check the ALTID section.
1571 TestFileIter = TestFile.GeneralIMListAltID.find(0);
1572 ASSERT_NE(TestFile.GeneralIMListAltID.end(), TestFileIter);
1573 ASSERT_EQ("10", TestFileIter->second);
1575 // Check the PID section.
1577 TestFileIter = TestFile.GeneralIMListPID.find(0);
1578 ASSERT_NE(TestFile.GeneralIMListPID.end(), TestFileIter);
1579 ASSERT_EQ("20", TestFileIter->second);
1581 // Check the MEDIATYPE section.
1583 TestFileIter = TestFile.GeneralIMListMediatype.find(0);
1584 ASSERT_NE(TestFile.GeneralIMListMediatype.end(), TestFileIter);
1585 ASSERT_EQ("text/plain", TestFileIter->second);
1587 // Check the PREF section.
1589 TestFileIntIter = TestFile.GeneralIMListPref.find(0);
1590 ASSERT_NE(TestFile.GeneralIMListPref.end(), TestFileIntIter);
1591 ASSERT_EQ(40, TestFileIntIter->second);
1593 // Check the extra tokens.
1595 TestFileIter = TestFile.GeneralIMListTokens.find(0);
1596 ASSERT_NE(TestFile.GeneralIMListTokens.end(), TestFileIter);
1597 ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
1599 // Start with the home IM.
1601 TestFileIter = TestFile.HomeIMList.find(1);
1602 ASSERT_NE(TestFile.HomeIMList.end(), TestFileIter);
1603 ASSERT_EQ("moo.home@example.com", TestFileIter->second);
1605 // Check the ALTID section.
1607 TestFileIter = TestFile.HomeIMListAltID.find(1);
1608 ASSERT_NE(TestFile.HomeIMListAltID.end(), TestFileIter);
1609 ASSERT_EQ("20", TestFileIter->second);
1611 // Check the PID section.
1613 TestFileIter = TestFile.HomeIMListPID.find(1);
1614 ASSERT_NE(TestFile.HomeIMListPID.end(), TestFileIter);
1615 ASSERT_EQ("40", TestFileIter->second);
1617 // Check the MEDIATYPE section.
1619 TestFileIter = TestFile.HomeIMListMediatype.find(1);
1620 ASSERT_NE(TestFile.HomeIMListMediatype.end(), TestFileIter);
1621 ASSERT_EQ("text/reallyplain", TestFileIter->second);
1623 // Check the PREF section.
1625 TestFileIntIter = TestFile.HomeIMListPref.find(1);
1626 ASSERT_NE(TestFile.HomeIMListPref.end(), TestFileIntIter);
1627 ASSERT_EQ(80, TestFileIntIter->second);
1629 // Check the extra tokens.
1631 TestFileIter = TestFile.HomeIMListTokens.find(1);
1632 ASSERT_NE(TestFile.HomeIMListTokens.end(), TestFileIter);
1633 ASSERT_EQ("PEACE=quiet", TestFileIter->second);
1635 // Start with the business IM.
1637 TestFileIter = TestFile.BusinessIMList.find(2);
1638 ASSERT_NE(TestFile.BusinessIMList.end(), TestFileIter);
1639 ASSERT_EQ("moo.business@example.com", TestFileIter->second);
1641 // Check the ALTID section.
1643 TestFileIter = TestFile.BusinessIMListAltID.find(2);
1644 ASSERT_NE(TestFile.BusinessIMListAltID.end(), TestFileIter);
1645 ASSERT_EQ("98", TestFileIter->second);
1647 // Check the PID section.
1649 TestFileIter = TestFile.BusinessIMListPID.find(2);
1650 ASSERT_NE(TestFile.BusinessIMListPID.end(), TestFileIter);
1651 ASSERT_EQ("99", TestFileIter->second);
1653 // Check the MEDIATYPE section.
1655 TestFileIter = TestFile.BusinessIMListMediatype.find(2);
1656 ASSERT_NE(TestFile.BusinessIMListMediatype.end(), TestFileIter);
1657 ASSERT_EQ("text/superplain", TestFileIter->second);
1659 // Check the PREF section.
1661 TestFileIntIter = TestFile.BusinessIMListPref.find(2);
1662 ASSERT_NE(TestFile.BusinessIMListPref.end(), TestFileIntIter);
1663 ASSERT_EQ(50, TestFileIntIter->second);
1665 // Check the extra tokens.
1667 TestFileIter = TestFile.BusinessIMListTokens.find(2);
1668 ASSERT_NE(TestFile.BusinessIMListTokens.end(), TestFileIter);
1669 ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
1673 TEST(ContactLoad, TelephoneTests){
1675 ContactDataObject TestFile;
1677 // Check that the vCard 4.0 file loads OK.
1679 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1681 std::map<int,wxString>::iterator TestFileIter;
1682 std::map<int,int>::iterator TestFileIntIter;
1684 // Start with the general Telephone.
1686 TestFileIter = TestFile.GeneralTelephoneList.find(0);
1687 ASSERT_NE(TestFile.GeneralTelephoneList.end(), TestFileIter);
1688 ASSERT_EQ("00000000", TestFileIter->second);
1690 // Check the data type section.
1692 TestFileIter = TestFile.GeneralTelephoneListDataType.find(0);
1693 ASSERT_NE(TestFile.GeneralTelephoneListDataType.end(), TestFileIter);
1694 ASSERT_EQ("tel", TestFileIter->second);
1696 // Check the type section.
1698 TestFileIter = TestFile.GeneralTelephoneListTypeInfo.find(0);
1699 ASSERT_NE(TestFile.GeneralTelephoneListTypeInfo.end(), TestFileIter);
1700 ASSERT_EQ("fax,cell", TestFileIter->second.ToStdString());
1702 // Check the ALTID section.
1704 TestFileIter = TestFile.GeneralTelephoneListAltID.find(0);
1705 ASSERT_NE(TestFile.GeneralTelephoneListAltID.end(), TestFileIter);
1706 ASSERT_EQ("10", TestFileIter->second);
1708 // Check the PID section.
1710 TestFileIter = TestFile.GeneralTelephoneListPID.find(0);
1711 ASSERT_NE(TestFile.GeneralTelephoneListPID.end(), TestFileIter);
1712 ASSERT_EQ("20", TestFileIter->second);
1714 // Check the PREF section.
1716 TestFileIntIter = TestFile.GeneralTelephoneListPref.find(0);
1717 ASSERT_NE(TestFile.GeneralTelephoneListPref.end(), TestFileIntIter);
1718 ASSERT_EQ(40, TestFileIntIter->second);
1720 // Check the extra tokens.
1722 TestFileIter = TestFile.GeneralTelephoneListTokens.find(0);
1723 ASSERT_NE(TestFile.GeneralTelephoneListTokens.end(), TestFileIter);
1724 ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
1726 // Start with the home Telephone.
1728 TestFileIter = TestFile.HomeTelephoneList.find(1);
1729 ASSERT_NE(TestFile.HomeTelephoneList.end(), TestFileIter);
1730 ASSERT_EQ("00001111", TestFileIter->second);
1732 // Check the data type section.
1734 TestFileIter = TestFile.HomeTelephoneListDataType.find(1);
1735 ASSERT_NE(TestFile.HomeTelephoneListDataType.end(), TestFileIter);
1736 ASSERT_EQ("tel", TestFileIter->second);
1738 // Check the type section.
1740 TestFileIter = TestFile.HomeTelephoneListTypeInfo.find(1);
1741 ASSERT_NE(TestFile.HomeTelephoneListTypeInfo.end(), TestFileIter);
1742 ASSERT_EQ("fax", TestFileIter->second);
1744 // Check the ALTID section.
1746 TestFileIter = TestFile.HomeTelephoneListAltID.find(1);
1747 ASSERT_NE(TestFile.HomeTelephoneListAltID.end(), TestFileIter);
1748 ASSERT_EQ("10", TestFileIter->second);
1750 // Check the PID section.
1752 TestFileIter = TestFile.HomeTelephoneListPID.find(1);
1753 ASSERT_NE(TestFile.HomeTelephoneListPID.end(), TestFileIter);
1754 ASSERT_EQ("20", TestFileIter->second);
1756 // Check the PREF section.
1758 TestFileIntIter = TestFile.HomeTelephoneListPref.find(1);
1759 ASSERT_NE(TestFile.HomeTelephoneListPref.end(), TestFileIntIter);
1760 ASSERT_EQ(40, TestFileIntIter->second);
1762 // Check the extra tokens.
1764 TestFileIter = TestFile.HomeTelephoneListTokens.find(1);
1765 ASSERT_NE(TestFile.HomeTelephoneListTokens.end(), TestFileIter);
1766 ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
1768 // Start with the business Telephone.
1770 TestFileIter = TestFile.BusinessTelephoneList.find(2);
1771 ASSERT_NE(TestFile.BusinessTelephoneList.end(), TestFileIter);
1772 ASSERT_EQ("22221111", TestFileIter->second);
1774 // Check the data type section.
1776 TestFileIter = TestFile.BusinessTelephoneListDataType.find(2);
1777 ASSERT_NE(TestFile.BusinessTelephoneListDataType.end(), TestFileIter);
1778 ASSERT_EQ("tel", TestFileIter->second);
1780 // Check the type section.
1782 TestFileIter = TestFile.BusinessTelephoneListTypeInfo.find(2);
1783 ASSERT_NE(TestFile.BusinessTelephoneListTypeInfo.end(), TestFileIter);
1784 ASSERT_EQ("voice", TestFileIter->second);
1786 // Check the ALTID section.
1788 TestFileIter = TestFile.BusinessTelephoneListAltID.find(2);
1789 ASSERT_NE(TestFile.BusinessTelephoneListAltID.end(), TestFileIter);
1790 ASSERT_EQ("25", TestFileIter->second);
1792 // Check the PID section.
1794 TestFileIter = TestFile.BusinessTelephoneListPID.find(2);
1795 ASSERT_NE(TestFile.BusinessTelephoneListPID.end(), TestFileIter);
1796 ASSERT_EQ("50", TestFileIter->second);
1798 // Check the PREF section.
1800 TestFileIntIter = TestFile.BusinessTelephoneListPref.find(2);
1801 ASSERT_NE(TestFile.BusinessTelephoneListPref.end(), TestFileIntIter);
1802 ASSERT_EQ(75, TestFileIntIter->second);
1804 // Check the extra tokens.
1806 TestFileIter = TestFile.BusinessTelephoneListTokens.find(2);
1807 ASSERT_NE(TestFile.BusinessTelephoneListTokens.end(), TestFileIter);
1808 ASSERT_EQ("BEEP=Boop", TestFileIter->second);
1812 TEST(ContactLoad, LanguageTests){
1814 ContactDataObject TestFile;
1816 // Check that the vCard 4.0 file loads OK.
1818 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1820 std::map<int,wxString>::iterator TestFileIter;
1821 std::map<int,int>::iterator TestFileIntIter;
1823 // Start with the general language.
1825 TestFileIter = TestFile.GeneralLanguageList.find(0);
1826 ASSERT_NE(TestFile.GeneralLanguageList.end(), TestFileIter);
1827 ASSERT_EQ("kw", TestFileIter->second);
1829 // Check the ALTID section.
1831 TestFileIter = TestFile.GeneralLanguageListAltID.find(0);
1832 ASSERT_NE(TestFile.GeneralLanguageListAltID.end(), TestFileIter);
1833 ASSERT_EQ("20", TestFileIter->second);
1835 // Check the PID section.
1837 TestFileIter = TestFile.GeneralLanguageListPID.find(0);
1838 ASSERT_NE(TestFile.GeneralLanguageListPID.end(), TestFileIter);
1839 ASSERT_EQ("40", TestFileIter->second);
1841 // Check the PREF section.
1843 TestFileIntIter = TestFile.GeneralLanguageListPref.find(0);
1844 ASSERT_NE(TestFile.GeneralLanguageListPref.end(), TestFileIntIter);
1845 ASSERT_EQ(80, TestFileIntIter->second);
1847 // Check the extra tokens.
1849 TestFileIter = TestFile.GeneralLanguageListTokens.find(0);
1850 ASSERT_NE(TestFile.GeneralLanguageListTokens.end(), TestFileIter);
1851 ASSERT_EQ("GELFORN=Great", TestFileIter->second);
1853 // Start with the home language.
1855 TestFileIter = TestFile.HomeLanguageList.find(1);
1856 ASSERT_NE(TestFile.HomeLanguageList.end(), TestFileIter);
1857 ASSERT_EQ("en", TestFileIter->second);
1859 // Check the ALTID section.
1861 TestFileIter = TestFile.HomeLanguageListAltID.find(1);
1862 ASSERT_NE(TestFile.HomeLanguageListAltID.end(), TestFileIter);
1863 ASSERT_EQ("22", TestFileIter->second);
1865 // Check the PID section.
1867 TestFileIter = TestFile.HomeLanguageListPID.find(1);
1868 ASSERT_NE(TestFile.HomeLanguageListPID.end(), TestFileIter);
1869 ASSERT_EQ("45", TestFileIter->second);
1871 // Check the PREF section.
1873 TestFileIntIter = TestFile.HomeLanguageListPref.find(1);
1874 ASSERT_NE(TestFile.HomeLanguageListPref.end(), TestFileIntIter);
1875 ASSERT_EQ(90, TestFileIntIter->second);
1877 // Check the extra tokens.
1879 TestFileIter = TestFile.HomeLanguageListTokens.find(1);
1880 ASSERT_NE(TestFile.HomeLanguageListTokens.end(), TestFileIter);
1881 ASSERT_EQ("LANGUAGE=yes", TestFileIter->second);
1883 // Start with the business language.
1885 TestFileIter = TestFile.BusinessLanguageList.find(2);
1886 ASSERT_NE(TestFile.BusinessLanguageList.end(), TestFileIter);
1887 ASSERT_EQ("cy", TestFileIter->second);
1889 // Check the ALTID section.
1891 TestFileIter = TestFile.BusinessLanguageListAltID.find(2);
1892 ASSERT_NE(TestFile.BusinessLanguageListAltID.end(), TestFileIter);
1893 ASSERT_EQ("10", TestFileIter->second);
1895 // Check the PID section.
1897 TestFileIter = TestFile.BusinessLanguageListPID.find(2);
1898 ASSERT_NE(TestFile.BusinessLanguageListPID.end(), TestFileIter);
1899 ASSERT_EQ("15", TestFileIter->second);
1901 // Check the PREF section.
1903 TestFileIntIter = TestFile.BusinessLanguageListPref.find(2);
1904 ASSERT_NE(TestFile.BusinessLanguageListPref.end(), TestFileIntIter);
1905 ASSERT_EQ(20, TestFileIntIter->second);
1907 // Check the extra tokens.
1909 TestFileIter = TestFile.BusinessLanguageListTokens.find(2);
1910 ASSERT_NE(TestFile.BusinessLanguageListTokens.end(), TestFileIter);
1911 ASSERT_EQ("FFENSTRI=ie", TestFileIter->second);
1915 TEST(ContactLoad, GeographicTests){
1917 ContactDataObject TestFile;
1919 // Check that the vCard 4.0 file loads OK.
1921 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
1923 std::map<int,wxString>::iterator TestFileIter;
1924 std::map<int,int>::iterator TestFileIntIter;
1926 // Start with the general Geoposition.
1928 TestFileIter = TestFile.GeneralGeographyList.find(0);
1929 ASSERT_NE(TestFile.GeneralGeographyList.end(), TestFileIter);
1930 ASSERT_EQ("3.5,3.5", TestFileIter->second);
1932 // Check the ALTID section.
1934 TestFileIter = TestFile.GeneralGeographyListAltID.find(0);
1935 ASSERT_NE(TestFile.GeneralGeographyListAltID.end(), TestFileIter);
1936 ASSERT_EQ("13", TestFileIter->second);
1938 // Check the PID section.
1940 TestFileIter = TestFile.GeneralGeographyListPID.find(0);
1941 ASSERT_NE(TestFile.GeneralGeographyListPID.end(), TestFileIter);
1942 ASSERT_EQ("26", TestFileIter->second);
1944 // Check the MEDIATYPE section.
1946 TestFileIter = TestFile.GeneralGeographyListMediatype.find(0);
1947 ASSERT_NE(TestFile.GeneralGeographyListMediatype.end(), TestFileIter);
1948 ASSERT_EQ("text/plain", TestFileIter->second);
1950 // Check the PREF section.
1952 TestFileIntIter = TestFile.GeneralGeographyListPref.find(0);
1953 ASSERT_NE(TestFile.GeneralGeographyListPref.end(), TestFileIntIter);
1954 ASSERT_EQ(39, TestFileIntIter->second);
1956 // Check the extra tokens.
1958 TestFileIter = TestFile.GeneralGeographyListTokens.find(0);
1959 ASSERT_NE(TestFile.GeneralGeographyListTokens.end(), TestFileIter);
1960 ASSERT_EQ("POS=Yep", TestFileIter->second);
1962 // Start with the home Geoposition.
1964 TestFileIter = TestFile.HomeGeographyList.find(1);
1965 ASSERT_NE(TestFile.HomeGeographyList.end(), TestFileIter);
1966 ASSERT_EQ("7.0,7.0", TestFileIter->second);
1968 // Check the ALTID section.
1970 TestFileIter = TestFile.HomeGeographyListAltID.find(1);
1971 ASSERT_NE(TestFile.HomeGeographyListAltID.end(), TestFileIter);
1972 ASSERT_EQ("140", TestFileIter->second);
1974 // Check the PID section.
1976 TestFileIter = TestFile.HomeGeographyListPID.find(1);
1977 ASSERT_NE(TestFile.HomeGeographyListPID.end(), TestFileIter);
1978 ASSERT_EQ("70", TestFileIter->second);
1980 // Check the MEDIATYPE section.
1982 TestFileIter = TestFile.HomeGeographyListMediatype.find(1);
1983 ASSERT_NE(TestFile.HomeGeographyListMediatype.end(), TestFileIter);
1984 ASSERT_EQ("text/ratherplain", TestFileIter->second);
1986 // Check the PREF section.
1988 TestFileIntIter = TestFile.HomeGeographyListPref.find(1);
1989 ASSERT_NE(TestFile.HomeGeographyListPref.end(), TestFileIntIter);
1990 ASSERT_EQ(1, TestFileIntIter->second);
1992 // Check the extra tokens.
1994 TestFileIter = TestFile.HomeGeographyListTokens.find(1);
1995 ASSERT_NE(TestFile.HomeGeographyListTokens.end(), TestFileIter);
1996 ASSERT_EQ("POS=Nope", TestFileIter->second);
1998 // Start with the business Geoposition.
2000 TestFileIter = TestFile.BusinessGeographyList.find(2);
2001 ASSERT_NE(TestFile.BusinessGeographyList.end(), TestFileIter);
2002 ASSERT_EQ("14.0,14.0", TestFileIter->second);
2004 // Check the ALTID section.
2006 TestFileIter = TestFile.BusinessGeographyListAltID.find(2);
2007 ASSERT_NE(TestFile.BusinessGeographyListAltID.end(), TestFileIter);
2008 ASSERT_EQ("75", TestFileIter->second);
2010 // Check the PID section.
2012 TestFileIter = TestFile.BusinessGeographyListPID.find(2);
2013 ASSERT_NE(TestFile.BusinessGeographyListPID.end(), TestFileIter);
2014 ASSERT_EQ("32", TestFileIter->second);
2016 // Check the MEDIATYPE section.
2018 TestFileIter = TestFile.BusinessGeographyListMediatype.find(2);
2019 ASSERT_NE(TestFile.BusinessGeographyListMediatype.end(), TestFileIter);
2020 ASSERT_EQ("text/greenplain", TestFileIter->second);
2022 // Check the PREF section.
2024 TestFileIntIter = TestFile.BusinessGeographyListPref.find(2);
2025 ASSERT_NE(TestFile.BusinessGeographyListPref.end(), TestFileIntIter);
2026 ASSERT_EQ(4, TestFileIntIter->second);
2028 // Check the extra tokens.
2030 TestFileIter = TestFile.BusinessGeographyListTokens.find(2);
2031 ASSERT_NE(TestFile.BusinessGeographyListTokens.end(), TestFileIter);
2032 ASSERT_EQ("POS=Money", TestFileIter->second);
2036 TEST(ContactLoad, RelatedTests){
2038 ContactDataObject TestFile;
2040 // Check that the vCard 4.0 file loads OK.
2042 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2044 std::map<int,wxString>::iterator TestFileIter;
2045 std::map<int,int>::iterator TestFileIntIter;
2047 // Start with the first relation.
2049 TestFileIter = TestFile.GeneralRelatedList.find(0);
2050 ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
2051 ASSERT_EQ("Friend Test", TestFileIter->second);
2053 // Check the TYPE section.
2055 TestFileIter = TestFile.GeneralRelatedListType.find(0);
2056 ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
2057 ASSERT_EQ("Kin", TestFileIter->second);
2059 // Check the ALTID section.
2061 TestFileIter = TestFile.GeneralRelatedListAltID.find(0);
2062 ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
2063 ASSERT_EQ("5", TestFileIter->second);
2065 // Check the PID section.
2067 TestFileIter = TestFile.GeneralRelatedListPID.find(0);
2068 ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
2069 ASSERT_EQ("10", TestFileIter->second);
2071 // Check the PREF section.
2073 TestFileIntIter = TestFile.GeneralRelatedListPref.find(0);
2074 ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
2075 ASSERT_EQ(20, TestFileIntIter->second);
2077 // Check the extra tokens.
2079 TestFileIter = TestFile.GeneralRelatedListTokens.find(0);
2080 ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
2081 ASSERT_EQ("OPTION=Yes", TestFileIter->second);
2083 // Start with the second relation.
2085 TestFileIter = TestFile.GeneralRelatedList.find(1);
2086 ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
2087 ASSERT_EQ("Friend Test Two", TestFileIter->second);
2089 // Check the TYPE section.
2091 TestFileIter = TestFile.GeneralRelatedListType.find(1);
2092 ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
2093 ASSERT_EQ("Spouse", TestFileIter->second);
2095 // Check the ALTID section.
2097 TestFileIter = TestFile.GeneralRelatedListAltID.find(1);
2098 ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
2099 ASSERT_EQ("1", TestFileIter->second);
2101 // Check the PID section.
2103 TestFileIter = TestFile.GeneralRelatedListPID.find(1);
2104 ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
2105 ASSERT_EQ("2", TestFileIter->second);
2107 // Check the PREF section.
2109 TestFileIntIter = TestFile.GeneralRelatedListPref.find(1);
2110 ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
2111 ASSERT_EQ(3, TestFileIntIter->second);
2113 // Check the extra tokens.
2115 TestFileIter = TestFile.GeneralRelatedListTokens.find(1);
2116 ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
2117 ASSERT_EQ("OPTION=No", TestFileIter->second);
2119 // Start with the second relation.
2121 TestFileIter = TestFile.GeneralRelatedList.find(2);
2122 ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
2123 ASSERT_EQ("Friend Test Three", TestFileIter->second);
2125 // Check the TYPE section.
2127 TestFileIter = TestFile.GeneralRelatedListType.find(2);
2128 ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
2129 ASSERT_EQ("Muse", TestFileIter->second);
2131 // Check the ALTID section.
2133 TestFileIter = TestFile.GeneralRelatedListAltID.find(2);
2134 ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
2135 ASSERT_EQ("4", TestFileIter->second);
2137 // Check the PID section.
2139 TestFileIter = TestFile.GeneralRelatedListPID.find(2);
2140 ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
2141 ASSERT_EQ("5", TestFileIter->second);
2143 // Check the PREF section.
2145 TestFileIntIter = TestFile.GeneralRelatedListPref.find(2);
2146 ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
2147 ASSERT_EQ(6, TestFileIntIter->second);
2149 // Check the extra tokens.
2151 TestFileIter = TestFile.GeneralRelatedListTokens.find(2);
2152 ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
2153 ASSERT_EQ("OPTION=Maybe", TestFileIter->second);
2157 TEST(ContactLoad, URLTests){
2159 ContactDataObject TestFile;
2161 // Check that the vCard 4.0 file loads OK.
2163 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2165 std::map<int,wxString>::iterator TestFileIter;
2166 std::map<int,int>::iterator TestFileIntIter;
2168 // Start with the general URL.
2170 TestFileIter = TestFile.GeneralWebsiteList.find(0);
2171 ASSERT_NE(TestFile.GeneralWebsiteList.end(), TestFileIter);
2172 ASSERT_EQ("http://example.com/", TestFileIter->second);
2174 // Check the ALTID section.
2176 TestFileIter = TestFile.GeneralWebsiteListAltID.find(0);
2177 ASSERT_NE(TestFile.GeneralWebsiteListAltID.end(), TestFileIter);
2178 ASSERT_EQ("0", TestFileIter->second);
2180 // Check the PID section.
2182 TestFileIter = TestFile.GeneralWebsiteListPID.find(0);
2183 ASSERT_NE(TestFile.GeneralWebsiteListPID.end(), TestFileIter);
2184 ASSERT_EQ("1", TestFileIter->second);
2186 // Check the MEDIATYPE section.
2188 TestFileIter = TestFile.GeneralWebsiteListMediatype.find(0);
2189 ASSERT_NE(TestFile.GeneralWebsiteListMediatype.end(), TestFileIter);
2190 ASSERT_EQ("text/plain", TestFileIter->second);
2192 // Check the PREF section.
2194 TestFileIntIter = TestFile.GeneralWebsiteListPref.find(0);
2195 ASSERT_NE(TestFile.GeneralWebsiteListPref.end(), TestFileIntIter);
2196 ASSERT_EQ(2, TestFileIntIter->second);
2198 // Check the extra tokens.
2200 TestFileIter = TestFile.GeneralWebsiteListTokens.find(0);
2201 ASSERT_NE(TestFile.GeneralWebsiteListTokens.end(), TestFileIter);
2202 ASSERT_EQ("MEEP=Moo", TestFileIter->second);
2204 // Start with the home URL.
2206 TestFileIter = TestFile.HomeWebsiteList.find(1);
2207 ASSERT_NE(TestFile.HomeWebsiteList.end(), TestFileIter);
2208 ASSERT_EQ("http://example.com/home/", TestFileIter->second);
2210 // Check the ALTID section.
2212 TestFileIter = TestFile.HomeWebsiteListAltID.find(1);
2213 ASSERT_NE(TestFile.HomeWebsiteListAltID.end(), TestFileIter);
2214 ASSERT_EQ("10", TestFileIter->second);
2216 // Check the PID section.
2218 TestFileIter = TestFile.HomeWebsiteListPID.find(1);
2219 ASSERT_NE(TestFile.HomeWebsiteListPID.end(), TestFileIter);
2220 ASSERT_EQ("11", TestFileIter->second);
2222 // Check the MEDIATYPE section.
2224 TestFileIter = TestFile.HomeWebsiteListMediatype.find(1);
2225 ASSERT_NE(TestFile.HomeWebsiteListMediatype.end(), TestFileIter);
2226 ASSERT_EQ("grass/soggy", TestFileIter->second);
2228 // Check the PREF section.
2230 TestFileIntIter = TestFile.HomeWebsiteListPref.find(1);
2231 ASSERT_NE(TestFile.HomeWebsiteListPref.end(), TestFileIntIter);
2232 ASSERT_EQ(12, TestFileIntIter->second);
2234 // Check the extra tokens.
2236 TestFileIter = TestFile.HomeWebsiteListTokens.find(1);
2237 ASSERT_NE(TestFile.HomeWebsiteListTokens.end(), TestFileIter);
2238 ASSERT_EQ("BON=Bon", TestFileIter->second);
2240 // Start with the business URL.
2242 TestFileIter = TestFile.BusinessWebsiteList.find(2);
2243 ASSERT_NE(TestFile.BusinessWebsiteList.end(), TestFileIter);
2244 ASSERT_EQ("http://example.com/business/", TestFileIter->second);
2246 // Check the ALTID section.
2248 TestFileIter = TestFile.BusinessWebsiteListAltID.find(2);
2249 ASSERT_NE(TestFile.BusinessWebsiteListAltID.end(), TestFileIter);
2250 ASSERT_EQ("20", TestFileIter->second);
2252 // Check the PID section.
2254 TestFileIter = TestFile.BusinessWebsiteListPID.find(2);
2255 ASSERT_NE(TestFile.BusinessWebsiteListPID.end(), TestFileIter);
2256 ASSERT_EQ("21", TestFileIter->second);
2258 // Check the MEDIATYPE section.
2260 TestFileIter = TestFile.BusinessWebsiteListMediatype.find(2);
2261 ASSERT_NE(TestFile.BusinessWebsiteListMediatype.end(), TestFileIter);
2262 ASSERT_EQ("chocolate/yummy", TestFileIter->second);
2264 // Check the PREF section.
2266 TestFileIntIter = TestFile.BusinessWebsiteListPref.find(2);
2267 ASSERT_NE(TestFile.BusinessWebsiteListPref.end(), TestFileIntIter);
2268 ASSERT_EQ(22, TestFileIntIter->second);
2270 // Check the extra tokens.
2272 TestFileIter = TestFile.BusinessWebsiteListTokens.find(2);
2273 ASSERT_NE(TestFile.BusinessWebsiteListTokens.end(), TestFileIter);
2274 ASSERT_EQ("YES=No", TestFileIter->second);
2278 TEST(ContactLoad, TitleTests){
2280 ContactDataObject TestFile;
2282 // Check that the vCard 4.0 file loads OK.
2284 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2286 std::map<int,wxString>::iterator TestFileIter;
2287 std::map<int,int>::iterator TestFileIntIter;
2289 // Start with the general title.
2291 TestFileIter = TestFile.GeneralTitleList.find(0);
2292 ASSERT_NE(TestFile.GeneralTitleList.end(), TestFileIter);
2293 ASSERT_EQ("Lord of Light", TestFileIter->second);
2295 // Check the ALTID section.
2297 TestFileIter = TestFile.GeneralTitleListAltID.find(0);
2298 ASSERT_NE(TestFile.GeneralTitleListAltID.end(), TestFileIter);
2299 ASSERT_EQ("20", TestFileIter->second);
2301 // Check the PID section.
2303 TestFileIter = TestFile.GeneralTitleListPID.find(0);
2304 ASSERT_NE(TestFile.GeneralTitleListPID.end(), TestFileIter);
2305 ASSERT_EQ("21", TestFileIter->second);
2307 // Check the LANGUAGE section.
2309 TestFileIter = TestFile.GeneralTitleListLanguage.find(0);
2310 ASSERT_NE(TestFile.GeneralTitleListLanguage.end(), TestFileIter);
2311 ASSERT_EQ("text/plain", TestFileIter->second);
2313 // Check the PREF section.
2315 TestFileIntIter = TestFile.GeneralTitleListPref.find(0);
2316 ASSERT_NE(TestFile.GeneralTitleListPref.end(), TestFileIntIter);
2317 ASSERT_EQ(22, TestFileIntIter->second);
2319 // Check the extra tokens.
2321 TestFileIter = TestFile.GeneralTitleListTokens.find(0);
2322 ASSERT_NE(TestFile.GeneralTitleListTokens.end(), TestFileIter);
2323 ASSERT_EQ("EEP=LIGHT", TestFileIter->second);
2325 // Start with the home title.
2327 TestFileIter = TestFile.HomeTitleList.find(1);
2328 ASSERT_NE(TestFile.HomeTitleList.end(), TestFileIter);
2329 ASSERT_EQ("Lord of Darkness", TestFileIter->second);
2331 // Check the ALTID section.
2333 TestFileIter = TestFile.HomeTitleListAltID.find(1);
2334 ASSERT_NE(TestFile.HomeTitleListAltID.end(), TestFileIter);
2335 ASSERT_EQ("30", TestFileIter->second);
2337 // Check the PID section.
2339 TestFileIter = TestFile.HomeTitleListPID.find(1);
2340 ASSERT_NE(TestFile.HomeTitleListPID.end(), TestFileIter);
2341 ASSERT_EQ("31", TestFileIter->second);
2343 // Check the LANGUAGE section.
2345 TestFileIter = TestFile.HomeTitleListLanguage.find(1);
2346 ASSERT_NE(TestFile.HomeTitleListLanguage.end(), TestFileIter);
2347 ASSERT_EQ("grass/dry", TestFileIter->second);
2349 // Check the PREF section.
2351 TestFileIntIter = TestFile.HomeTitleListPref.find(1);
2352 ASSERT_NE(TestFile.HomeTitleListPref.end(), TestFileIntIter);
2353 ASSERT_EQ(32, TestFileIntIter->second);
2355 // Check the extra tokens.
2357 TestFileIter = TestFile.HomeTitleListTokens.find(1);
2358 ASSERT_NE(TestFile.HomeTitleListTokens.end(), TestFileIter);
2359 ASSERT_EQ("EEP=DARK", TestFileIter->second);
2361 // Start with the business title.
2363 TestFileIter = TestFile.BusinessTitleList.find(2);
2364 ASSERT_NE(TestFile.BusinessTitleList.end(), TestFileIter);
2365 ASSERT_EQ("Master of the Light & Darkness", TestFileIter->second);
2367 // Check the ALTID section.
2369 TestFileIter = TestFile.BusinessTitleListAltID.find(2);
2370 ASSERT_NE(TestFile.BusinessTitleListAltID.end(), TestFileIter);
2371 ASSERT_EQ("40", TestFileIter->second);
2373 // Check the PID section.
2375 TestFileIter = TestFile.BusinessTitleListPID.find(2);
2376 ASSERT_NE(TestFile.BusinessTitleListPID.end(), TestFileIter);
2377 ASSERT_EQ("41", TestFileIter->second);
2379 // Check the LANGUAGE section.
2381 TestFileIter = TestFile.BusinessTitleListLanguage.find(2);
2382 ASSERT_NE(TestFile.BusinessTitleListLanguage.end(), TestFileIter);
2383 ASSERT_EQ("moths/eew", TestFileIter->second);
2385 // Check the PREF section.
2387 TestFileIntIter = TestFile.BusinessTitleListPref.find(2);
2388 ASSERT_NE(TestFile.BusinessTitleListPref.end(), TestFileIntIter);
2389 ASSERT_EQ(42, TestFileIntIter->second);
2391 // Check the extra tokens.
2393 TestFileIter = TestFile.BusinessTitleListTokens.find(2);
2394 ASSERT_NE(TestFile.BusinessTitleListTokens.end(), TestFileIter);
2395 ASSERT_EQ("EEP=BOTH", TestFileIter->second);
2399 TEST(ContactLoad, RoleTests){
2401 ContactDataObject TestFile;
2403 // Check that the vCard 4.0 file loads OK.
2405 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2407 std::map<int,wxString>::iterator TestFileIter;
2408 std::map<int,int>::iterator TestFileIntIter;
2410 // Start with the general role.
2412 TestFileIter = TestFile.GeneralRoleList.find(0);
2413 ASSERT_NE(TestFile.GeneralRoleList.end(), TestFileIter);
2414 ASSERT_EQ("Ordinary Person", TestFileIter->second);
2416 // Check the ALTID section.
2418 TestFileIter = TestFile.GeneralRoleListAltID.find(0);
2419 ASSERT_NE(TestFile.GeneralRoleListAltID.end(), TestFileIter);
2420 ASSERT_EQ("50", TestFileIter->second);
2422 // Check the PID section.
2424 TestFileIter = TestFile.GeneralRoleListPID.find(0);
2425 ASSERT_NE(TestFile.GeneralRoleListPID.end(), TestFileIter);
2426 ASSERT_EQ("51", TestFileIter->second);
2428 // Check the LANGUAGE section.
2430 TestFileIter = TestFile.GeneralRoleListLanguage.find(0);
2431 ASSERT_NE(TestFile.GeneralRoleListLanguage.end(), TestFileIter);
2432 ASSERT_EQ("en", TestFileIter->second);
2434 // Check the PREF section.
2436 TestFileIntIter = TestFile.GeneralRoleListPref.find(0);
2437 ASSERT_NE(TestFile.GeneralRoleListPref.end(), TestFileIntIter);
2438 ASSERT_EQ(52, TestFileIntIter->second);
2440 // Check the extra tokens.
2442 TestFileIter = TestFile.GeneralRoleListTokens.find(0);
2443 ASSERT_NE(TestFile.GeneralRoleListTokens.end(), TestFileIter);
2444 ASSERT_EQ("ASTERISK=None", TestFileIter->second);
2446 // Start with the home role.
2448 TestFileIter = TestFile.HomeRoleList.find(1);
2449 ASSERT_NE(TestFile.HomeRoleList.end(), TestFileIter);
2450 ASSERT_EQ("Ordinary Lazy Person", TestFileIter->second);
2452 // Check the ALTID section.
2454 TestFileIter = TestFile.HomeRoleListAltID.find(1);
2455 ASSERT_NE(TestFile.HomeRoleListAltID.end(), TestFileIter);
2456 ASSERT_EQ("60", TestFileIter->second);
2458 // Check the PID section.
2460 TestFileIter = TestFile.HomeRoleListPID.find(1);
2461 ASSERT_NE(TestFile.HomeRoleListPID.end(), TestFileIter);
2462 ASSERT_EQ("61", TestFileIter->second);
2464 // Check the LANGUAGE section.
2466 TestFileIter = TestFile.HomeRoleListLanguage.find(1);
2467 ASSERT_NE(TestFile.HomeRoleListLanguage.end(), TestFileIter);
2468 ASSERT_EQ("en-GB", TestFileIter->second);
2470 // Check the PREF section.
2472 TestFileIntIter = TestFile.HomeRoleListPref.find(1);
2473 ASSERT_NE(TestFile.HomeRoleListPref.end(), TestFileIntIter);
2474 ASSERT_EQ(62, TestFileIntIter->second);
2476 // Check the extra tokens.
2478 TestFileIter = TestFile.HomeRoleListTokens.find(1);
2479 ASSERT_NE(TestFile.HomeRoleListTokens.end(), TestFileIter);
2480 ASSERT_EQ("SOMEWHERE=There", TestFileIter->second);
2482 // Start with the business role.
2484 TestFileIter = TestFile.BusinessRoleList.find(2);
2485 ASSERT_NE(TestFile.BusinessRoleList.end(), TestFileIter);
2486 ASSERT_EQ("Company Owner", TestFileIter->second);
2488 // Check the ALTID section.
2490 TestFileIter = TestFile.BusinessRoleListAltID.find(2);
2491 ASSERT_NE(TestFile.BusinessRoleListAltID.end(), TestFileIter);
2492 ASSERT_EQ("70", TestFileIter->second);
2494 // Check the PID section.
2496 TestFileIter = TestFile.BusinessRoleListPID.find(2);
2497 ASSERT_NE(TestFile.BusinessRoleListPID.end(), TestFileIter);
2498 ASSERT_EQ("71", TestFileIter->second);
2500 // Check the LANGUAGE section.
2502 TestFileIter = TestFile.BusinessRoleListLanguage.find(2);
2503 ASSERT_NE(TestFile.BusinessRoleListLanguage.end(), TestFileIter);
2504 ASSERT_EQ("en-AU", TestFileIter->second);
2506 // Check the PREF section.
2508 TestFileIntIter = TestFile.BusinessRoleListPref.find(2);
2509 ASSERT_NE(TestFile.BusinessRoleListPref.end(), TestFileIntIter);
2510 ASSERT_EQ(72, TestFileIntIter->second);
2512 // Check the extra tokens.
2514 TestFileIter = TestFile.BusinessRoleListTokens.find(2);
2515 ASSERT_NE(TestFile.BusinessRoleListTokens.end(), TestFileIter);
2516 ASSERT_EQ("HERE=Nope", TestFileIter->second);
2520 TEST(ContactLoad, OrganisationTests){
2522 ContactDataObject TestFile;
2524 // Check that the vCard 4.0 file loads OK.
2526 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2528 std::map<int,wxString>::iterator TestFileIter;
2529 std::map<int,int>::iterator TestFileIntIter;
2531 // Start with the general organisation.
2533 TestFileIter = TestFile.GeneralOrganisationsList.find(0);
2534 ASSERT_NE(TestFile.GeneralOrganisationsList.end(), TestFileIter);
2535 ASSERT_EQ("Ordinary Organisation", TestFileIter->second);
2537 // Check the SORT-AS section.
2539 TestFileIter = TestFile.GeneralOrganisationsListSortAs.find(0);
2540 ASSERT_NE(TestFile.GeneralOrganisationsListSortAs.end(), TestFileIter);
2541 ASSERT_EQ("Organisation, Ordinary", TestFileIter->second);
2543 // Check the ALTID section.
2545 TestFileIter = TestFile.GeneralOrganisationsListAltID.find(0);
2546 ASSERT_NE(TestFile.GeneralOrganisationsListAltID.end(), TestFileIter);
2547 ASSERT_EQ("50", TestFileIter->second);
2549 // Check the PID section.
2551 TestFileIter = TestFile.GeneralOrganisationsListPID.find(0);
2552 ASSERT_NE(TestFile.GeneralOrganisationsListPID.end(), TestFileIter);
2553 ASSERT_EQ("51", TestFileIter->second);
2555 // Check the LANGUAGE section.
2557 TestFileIter = TestFile.GeneralOrganisationsListLanguage.find(0);
2558 ASSERT_NE(TestFile.GeneralOrganisationsListLanguage.end(), TestFileIter);
2559 ASSERT_EQ("en", TestFileIter->second);
2561 // Check the PREF section.
2563 TestFileIntIter = TestFile.GeneralOrganisationsListPref.find(0);
2564 ASSERT_NE(TestFile.GeneralOrganisationsListPref.end(), TestFileIntIter);
2565 ASSERT_EQ(52, TestFileIntIter->second);
2567 // Check the extra tokens.
2569 TestFileIter = TestFile.GeneralOrganisationsListTokens.find(0);
2570 ASSERT_NE(TestFile.GeneralOrganisationsListTokens.end(), TestFileIter);
2571 ASSERT_EQ("ASTERISK=None", TestFileIter->second);
2573 // Start with the home Organisation.
2575 TestFileIter = TestFile.HomeOrganisationsList.find(1);
2576 ASSERT_NE(TestFile.HomeOrganisationsList.end(), TestFileIter);
2577 ASSERT_EQ("Ordinary Lazy Person", TestFileIter->second);
2579 // Check the SORT-AS section.
2581 TestFileIter = TestFile.HomeOrganisationsListSortAs.find(1);
2582 ASSERT_NE(TestFile.HomeOrganisationsListSortAs.end(), TestFileIter);
2583 ASSERT_EQ("Person, Ordinary Lazy", TestFileIter->second);
2585 // Check the ALTID section.
2587 TestFileIter = TestFile.HomeOrganisationsListAltID.find(1);
2588 ASSERT_NE(TestFile.HomeOrganisationsListAltID.end(), TestFileIter);
2589 ASSERT_EQ("60", TestFileIter->second);
2591 // Check the PID section.
2593 TestFileIter = TestFile.HomeOrganisationsListPID.find(1);
2594 ASSERT_NE(TestFile.HomeOrganisationsListPID.end(), TestFileIter);
2595 ASSERT_EQ("61", TestFileIter->second);
2597 // Check the LANGUAGE section.
2599 TestFileIter = TestFile.HomeOrganisationsListLanguage.find(1);
2600 ASSERT_NE(TestFile.HomeOrganisationsListLanguage.end(), TestFileIter);
2601 ASSERT_EQ("en-GB", TestFileIter->second);
2603 // Check the PREF section.
2605 TestFileIntIter = TestFile.HomeOrganisationsListPref.find(1);
2606 ASSERT_NE(TestFile.HomeOrganisationsListPref.end(), TestFileIntIter);
2607 ASSERT_EQ(62, TestFileIntIter->second);
2609 // Check the extra tokens.
2611 TestFileIter = TestFile.HomeOrganisationsListTokens.find(1);
2612 ASSERT_NE(TestFile.HomeOrganisationsListTokens.end(), TestFileIter);
2613 ASSERT_EQ("SOMEWHERE=There", TestFileIter->second);
2615 // Start with the business Organisation.
2617 TestFileIter = TestFile.BusinessOrganisationsList.find(2);
2618 ASSERT_NE(TestFile.BusinessOrganisationsList.end(), TestFileIter);
2619 ASSERT_EQ("Company Owner", TestFileIter->second);
2621 // Check the SORT-AS section.
2623 TestFileIter = TestFile.BusinessOrganisationsListSortAs.find(2);
2624 ASSERT_NE(TestFile.BusinessOrganisationsListSortAs.end(), TestFileIter);
2625 ASSERT_EQ("Owner, Company", TestFileIter->second);
2627 // Check the ALTID section.
2629 TestFileIter = TestFile.BusinessOrganisationsListAltID.find(2);
2630 ASSERT_NE(TestFile.BusinessOrganisationsListAltID.end(), TestFileIter);
2631 ASSERT_EQ("70", TestFileIter->second);
2633 // Check the PID section.
2635 TestFileIter = TestFile.BusinessOrganisationsListPID.find(2);
2636 ASSERT_NE(TestFile.BusinessOrganisationsListPID.end(), TestFileIter);
2637 ASSERT_EQ("71", TestFileIter->second);
2639 // Check the LANGUAGE section.
2641 TestFileIter = TestFile.BusinessOrganisationsListLanguage.find(2);
2642 ASSERT_NE(TestFile.BusinessOrganisationsListLanguage.end(), TestFileIter);
2643 ASSERT_EQ("en-AU", TestFileIter->second);
2645 // Check the PREF section.
2647 TestFileIntIter = TestFile.BusinessOrganisationsListPref.find(2);
2648 ASSERT_NE(TestFile.BusinessOrganisationsListPref.end(), TestFileIntIter);
2649 ASSERT_EQ(72, TestFileIntIter->second);
2651 // Check the extra tokens.
2653 TestFileIter = TestFile.BusinessOrganisationsListTokens.find(2);
2654 ASSERT_NE(TestFile.BusinessOrganisationsListTokens.end(), TestFileIter);
2655 ASSERT_EQ("HERE=Nope", TestFileIter->second);
2659 TEST(ContactLoad, NoteTests){
2661 ContactDataObject TestFile;
2663 // Check that the vCard 4.0 file loads OK.
2665 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2667 std::map<int,wxString>::iterator TestFileIter;
2668 std::map<int,int>::iterator TestFileIntIter;
2670 // Start with the general note.
2672 TestFileIter = TestFile.GeneralNoteList.find(0);
2673 ASSERT_NE(TestFile.GeneralNoteList.end(), TestFileIter);
2674 ASSERT_EQ("Note\n\nLine 3\nLine 4\nLine 5", TestFileIter->second);
2676 // Check the ALTID section.
2678 TestFileIter = TestFile.GeneralNoteListAltID.find(0);
2679 ASSERT_NE(TestFile.GeneralNoteListAltID.end(), TestFileIter);
2680 ASSERT_EQ("90", TestFileIter->second);
2682 // Check the PID section.
2684 TestFileIter = TestFile.GeneralNoteListPID.find(0);
2685 ASSERT_NE(TestFile.GeneralNoteListPID.end(), TestFileIter);
2686 ASSERT_EQ("91", TestFileIter->second);
2688 // Check the LANGUAGE section.
2690 TestFileIter = TestFile.GeneralNoteListLanguage.find(0);
2691 ASSERT_NE(TestFile.GeneralNoteListLanguage.end(), TestFileIter);
2692 ASSERT_EQ("en", TestFileIter->second);
2694 // Check the PREF section.
2696 TestFileIntIter = TestFile.GeneralNoteListPref.find(0);
2697 ASSERT_NE(TestFile.GeneralNoteListPref.end(), TestFileIntIter);
2698 ASSERT_EQ(92, TestFileIntIter->second);
2700 // Check the extra tokens.
2702 TestFileIter = TestFile.GeneralNoteListTokens.find(0);
2703 ASSERT_NE(TestFile.GeneralNoteListTokens.end(), TestFileIter);
2704 ASSERT_EQ("WOO=WOOP", TestFileIter->second);
2706 // Start with the home note.
2708 TestFileIter = TestFile.HomeNoteList.find(1);
2709 ASSERT_NE(TestFile.HomeNoteList.end(), TestFileIter);
2710 ASSERT_EQ("Note\n\n\n\nLine 5\nLine 6\nLine 7", TestFileIter->second);
2712 // Check the ALTID section.
2714 TestFileIter = TestFile.HomeNoteListAltID.find(1);
2715 ASSERT_NE(TestFile.HomeNoteListAltID.end(), TestFileIter);
2716 ASSERT_EQ("80", TestFileIter->second);
2718 // Check the PID section.
2720 TestFileIter = TestFile.HomeNoteListPID.find(1);
2721 ASSERT_NE(TestFile.HomeNoteListPID.end(), TestFileIter);
2722 ASSERT_EQ("81", TestFileIter->second);
2724 // Check the LANGUAGE section.
2726 TestFileIter = TestFile.HomeNoteListLanguage.find(1);
2727 ASSERT_NE(TestFile.HomeNoteListLanguage.end(), TestFileIter);
2728 ASSERT_EQ("kw", TestFileIter->second);
2730 // Check the PREF section.
2732 TestFileIntIter = TestFile.HomeNoteListPref.find(1);
2733 ASSERT_NE(TestFile.HomeNoteListPref.end(), TestFileIntIter);
2734 ASSERT_EQ(82, TestFileIntIter->second);
2736 // Check the extra tokens.
2738 TestFileIter = TestFile.HomeNoteListTokens.find(1);
2739 ASSERT_NE(TestFile.HomeNoteListTokens.end(), TestFileIter);
2740 ASSERT_EQ("MOO=MEEP", TestFileIter->second);
2742 // Start with the business note.
2744 TestFileIter = TestFile.BusinessNoteList.find(2);
2745 ASSERT_NE(TestFile.BusinessNoteList.end(), TestFileIter);
2746 ASSERT_EQ("Note\n\n\n\nLine 8\nLine 9\nLine 10", TestFileIter->second);
2748 // Check the ALTID section.
2750 TestFileIter = TestFile.BusinessNoteListAltID.find(2);
2751 ASSERT_NE(TestFile.BusinessNoteListAltID.end(), TestFileIter);
2752 ASSERT_EQ("70", TestFileIter->second);
2754 // Check the PID section.
2756 TestFileIter = TestFile.BusinessNoteListPID.find(2);
2757 ASSERT_NE(TestFile.BusinessNoteListPID.end(), TestFileIter);
2758 ASSERT_EQ("71", TestFileIter->second);
2760 // Check the LANGUAGE section.
2762 TestFileIter = TestFile.BusinessNoteListLanguage.find(2);
2763 ASSERT_NE(TestFile.BusinessNoteListLanguage.end(), TestFileIter);
2764 ASSERT_EQ("fr", TestFileIter->second);
2766 // Check the PREF section.
2768 TestFileIntIter = TestFile.BusinessNoteListPref.find(2);
2769 ASSERT_NE(TestFile.BusinessNoteListPref.end(), TestFileIntIter);
2770 ASSERT_EQ(72, TestFileIntIter->second);
2772 // Check the extra tokens.
2774 TestFileIter = TestFile.BusinessNoteListTokens.find(2);
2775 ASSERT_NE(TestFile.BusinessNoteListTokens.end(), TestFileIter);
2776 ASSERT_EQ("BOING=BOOP", TestFileIter->second);
2780 TEST(ContactLoad, CategoryTests){
2782 ContactDataObject TestFile;
2784 // Check that the vCard 4.0 file loads OK.
2786 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
2788 std::map<int,wxString>::iterator TestFileIter;
2789 std::map<int,int>::iterator TestFileIntIter;
2791 // Start with the first category.
2793 TestFileIter = TestFile.CategoriesList.find(0);
2794 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2795 ASSERT_EQ("Category One", TestFileIter->second);
2797 // Check the TYPE section.
2799 TestFileIter = TestFile.CategoriesListType.find(0);
2800 ASSERT_EQ(TestFile.CategoriesListType.end(), TestFileIter);
2802 // Check the ALTID section.
2804 TestFileIter = TestFile.CategoriesListAltID.find(0);
2805 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2806 ASSERT_EQ("40", TestFileIter->second);
2808 // Check the PID section.
2810 TestFileIter = TestFile.CategoriesListPID.find(0);
2811 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2812 ASSERT_EQ("41", TestFileIter->second);
2814 // Check the LANGUAGE section.
2816 TestFileIter = TestFile.CategoriesListLanguage.find(0);
2817 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2818 ASSERT_EQ("en", TestFileIter->second);
2820 // Check the PREF section.
2822 TestFileIntIter = TestFile.CategoriesListPref.find(0);
2823 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2824 ASSERT_EQ(42, TestFileIntIter->second);
2826 // Check the extra tokens.
2828 TestFileIter = TestFile.CategoriesListTokens.find(0);
2829 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
2830 ASSERT_EQ("CAT=TAC", TestFileIter->second);
2832 // Start with the second & third category.
2833 // (Category Two, Category Three).
2835 TestFileIter = TestFile.CategoriesList.find(1);
2836 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2837 ASSERT_EQ("Category Two", TestFileIter->second);
2839 TestFileIter = TestFile.CategoriesList.find(2);
2840 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2841 ASSERT_EQ("Category Three", TestFileIter->second);
2843 // Check the TYPE section.
2845 TestFileIter = TestFile.CategoriesListType.find(1);
2846 ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
2847 ASSERT_EQ("home", TestFileIter->second);
2849 TestFileIter = TestFile.CategoriesListType.find(2);
2850 ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
2851 ASSERT_EQ("home", TestFileIter->second);
2853 // Check the ALTID section.
2855 TestFileIter = TestFile.CategoriesListAltID.find(1);
2856 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2857 ASSERT_EQ("44", TestFileIter->second);
2859 TestFileIter = TestFile.CategoriesListAltID.find(2);
2860 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2861 ASSERT_EQ("44", TestFileIter->second);
2863 // Check the PID section.
2865 TestFileIter = TestFile.CategoriesListPID.find(1);
2866 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2867 ASSERT_EQ("46", TestFileIter->second);
2869 TestFileIter = TestFile.CategoriesListPID.find(2);
2870 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2871 ASSERT_EQ("46", TestFileIter->second);
2873 // Check the LANGUAGE section.
2875 TestFileIter = TestFile.CategoriesListLanguage.find(1);
2876 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2877 ASSERT_EQ("kw", TestFileIter->second);
2879 TestFileIter = TestFile.CategoriesListLanguage.find(2);
2880 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2881 ASSERT_EQ("kw", TestFileIter->second);
2883 // Check the PREF section.
2885 TestFileIntIter = TestFile.CategoriesListPref.find(1);
2886 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2887 ASSERT_EQ(48, TestFileIntIter->second);
2889 TestFileIntIter = TestFile.CategoriesListPref.find(2);
2890 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2891 ASSERT_EQ(48, TestFileIntIter->second);
2893 // Check the extra tokens.
2895 TestFileIter = TestFile.CategoriesListTokens.find(1);
2896 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
2897 ASSERT_EQ("TAC=CAT", TestFileIter->second);
2899 TestFileIter = TestFile.CategoriesListTokens.find(2);
2900 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
2901 ASSERT_EQ("TAC=CAT", TestFileIter->second);
2903 // Start with the third, fourth & fifth category.
2904 // (Category Three,Category Four,Category Five).
2906 TestFileIter = TestFile.CategoriesList.find(3);
2907 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2908 ASSERT_EQ("Category Four", TestFileIter->second.ToStdString());
2910 TestFileIter = TestFile.CategoriesList.find(4);
2911 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2912 ASSERT_EQ("Category Five", TestFileIter->second.ToStdString());
2914 TestFileIter = TestFile.CategoriesList.find(5);
2915 ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
2916 ASSERT_EQ("Category Six", TestFileIter->second);
2918 // Check the TYPE section.
2920 TestFileIter = TestFile.CategoriesListType.find(3);
2921 ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
2922 ASSERT_EQ("work", TestFileIter->second);
2924 TestFileIter = TestFile.CategoriesListType.find(4);
2925 ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
2926 ASSERT_EQ("work", TestFileIter->second);
2928 TestFileIter = TestFile.CategoriesListType.find(5);
2929 ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
2930 ASSERT_EQ("work", TestFileIter->second);
2932 // Check the ALTID section.
2934 TestFileIter = TestFile.CategoriesListAltID.find(3);
2935 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2936 ASSERT_EQ("84", TestFileIter->second);
2938 TestFileIter = TestFile.CategoriesListAltID.find(4);
2939 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2940 ASSERT_EQ("84", TestFileIter->second);
2942 TestFileIter = TestFile.CategoriesListAltID.find(5);
2943 ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
2944 ASSERT_EQ("84", TestFileIter->second);
2946 // Check the PID section.
2948 TestFileIter = TestFile.CategoriesListPID.find(3);
2949 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2950 ASSERT_EQ("86", TestFileIter->second);
2952 TestFileIter = TestFile.CategoriesListPID.find(4);
2953 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2954 ASSERT_EQ("86", TestFileIter->second);
2956 TestFileIter = TestFile.CategoriesListPID.find(5);
2957 ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
2958 ASSERT_EQ("86", TestFileIter->second);
2960 // Check the LANGUAGE section.
2962 TestFileIter = TestFile.CategoriesListLanguage.find(3);
2963 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2964 ASSERT_EQ("kw", TestFileIter->second);
2966 TestFileIter = TestFile.CategoriesListLanguage.find(4);
2967 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2968 ASSERT_EQ("kw", TestFileIter->second);
2970 TestFileIter = TestFile.CategoriesListLanguage.find(5);
2971 ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
2972 ASSERT_EQ("kw", TestFileIter->second);
2974 // Check the PREF section.
2976 TestFileIntIter = TestFile.CategoriesListPref.find(3);
2977 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2978 ASSERT_EQ(88, TestFileIntIter->second);
2980 TestFileIntIter = TestFile.CategoriesListPref.find(4);
2981 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2982 ASSERT_EQ(88, TestFileIntIter->second);
2984 TestFileIntIter = TestFile.CategoriesListPref.find(5);
2985 ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
2986 ASSERT_EQ(88, TestFileIntIter->second);
2988 // Check the extra tokens.
2990 TestFileIter = TestFile.CategoriesListTokens.find(3);
2991 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
2992 ASSERT_EQ("AAA=BBB", TestFileIter->second);
2994 TestFileIter = TestFile.CategoriesListTokens.find(4);
2995 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
2996 ASSERT_EQ("AAA=BBB", TestFileIter->second);
2998 TestFileIter = TestFile.CategoriesListTokens.find(4);
2999 ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
3000 ASSERT_EQ("AAA=BBB", TestFileIter->second);
3004 TEST(ContactLoad, PhotoTests){
3006 ContactDataObject TestFile;
3008 // Check that the vCard 4.0 file loads OK.
3010 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
3012 std::map<int,std::string>::iterator TestStrIter;
3013 std::map<int,wxString>::iterator TestFileIter;
3014 std::map<int,int>::iterator TestFileIntIter;
3016 // Start with the first photo.
3018 TestStrIter = TestFile.PicturesList.find(0);
3019 ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
3020 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==",
3021 TestStrIter->second);
3023 // Check that it has the correct encoding.
3025 TestFileIter = TestFile.PicturesListPicEncType.find(0);
3026 ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
3027 ASSERT_EQ("base64", TestFileIter->second);
3029 // Check that it has the correct image type.
3031 TestFileIter = TestFile.PicturesListPictureType.find(0);
3032 ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
3033 ASSERT_EQ("image/png", TestFileIter->second);
3035 // Check the ALTID section.
3037 TestFileIter = TestFile.PicturesListAltID.find(0);
3038 ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
3039 ASSERT_EQ("70", TestFileIter->second);
3041 // Check the PID section.
3043 TestFileIter = TestFile.PicturesListPID.find(0);
3044 ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
3045 ASSERT_EQ("71", TestFileIter->second);
3047 // Check the TYPE section.
3049 TestFileIter = TestFile.PicturesListType.find(0);
3050 ASSERT_EQ(TestFile.PicturesListType.end(), TestFileIter);
3052 // Check the MEDIATYPE section.
3054 TestFileIter = TestFile.PicturesListMediatype.find(0);
3055 ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
3056 ASSERT_EQ("image/png", TestFileIter->second);
3058 // Check the PREF section.
3060 TestFileIntIter = TestFile.PicturesListPref.find(0);
3061 ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
3062 ASSERT_EQ(72, TestFileIntIter->second);
3064 // Check the extra tokens.
3066 TestFileIter = TestFile.PicturesListTokens.find(0);
3067 ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
3068 ASSERT_EQ("MEEP=MOO", TestFileIter->second);
3070 // Start with the second photo.
3072 TestStrIter = TestFile.PicturesList.find(1);
3073 ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
3074 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC",
3075 TestStrIter->second);
3077 // Check that it has the correct encoding.
3079 TestFileIter = TestFile.PicturesListPicEncType.find(1);
3080 ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
3081 ASSERT_EQ("base64", TestFileIter->second);
3083 // Check that it has the correct image type.
3085 TestFileIter = TestFile.PicturesListPictureType.find(1);
3086 ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
3087 ASSERT_EQ("image/png", TestFileIter->second);
3089 // Check the ALTID section.
3091 TestFileIter = TestFile.PicturesListAltID.find(1);
3092 ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
3093 ASSERT_EQ("20", TestFileIter->second);
3095 // Check the PID section.
3097 TestFileIter = TestFile.PicturesListPID.find(1);
3098 ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
3099 ASSERT_EQ("21", TestFileIter->second);
3101 // Check the TYPE section.
3103 TestFileIter = TestFile.PicturesListType.find(1);
3104 ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter);
3105 ASSERT_EQ("home", TestFileIter->second);
3107 // Check the MEDIATYPE section.
3109 TestFileIter = TestFile.PicturesListMediatype.find(1);
3110 ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
3111 ASSERT_EQ("image/png", TestFileIter->second);
3113 // Check the PREF section.
3115 TestFileIntIter = TestFile.PicturesListPref.find(1);
3116 ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
3117 ASSERT_EQ(22, TestFileIntIter->second);
3119 // Check the extra tokens.
3121 TestFileIter = TestFile.PicturesListTokens.find(1);
3122 ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
3123 ASSERT_EQ("BEEP=BOOP", TestFileIter->second);
3125 // Start with the second photo.
3127 TestStrIter = TestFile.PicturesList.find(2);
3128 ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
3129 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=",
3130 TestStrIter->second);
3132 // Check that it has the correct encoding.
3134 TestFileIter = TestFile.PicturesListPicEncType.find(2);
3135 ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
3136 ASSERT_EQ("base64", TestFileIter->second);
3138 // Check that it has the correct image type.
3140 TestFileIter = TestFile.PicturesListPictureType.find(2);
3141 ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
3142 ASSERT_EQ("image/png", TestFileIter->second);
3144 // Check the ALTID section.
3146 TestFileIter = TestFile.PicturesListAltID.find(2);
3147 ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
3148 ASSERT_EQ("90", TestFileIter->second);
3150 // Check the PID section.
3152 TestFileIter = TestFile.PicturesListPID.find(2);
3153 ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
3154 ASSERT_EQ("91", TestFileIter->second);
3156 // Check the TYPE section.
3158 TestFileIter = TestFile.PicturesListType.find(2);
3159 ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter);
3160 ASSERT_EQ("work", TestFileIter->second);
3162 // Check the MEDIATYPE section.
3164 TestFileIter = TestFile.PicturesListMediatype.find(2);
3165 ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
3166 ASSERT_EQ("image/png", TestFileIter->second);
3168 // Check the PREF section.
3170 TestFileIntIter = TestFile.PicturesListPref.find(2);
3171 ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
3172 ASSERT_EQ(92, TestFileIntIter->second);
3174 // Check the extra tokens.
3176 TestFileIter = TestFile.PicturesListTokens.find(2);
3177 ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
3178 ASSERT_EQ("PHOTO=YUP", TestFileIter->second);
3182 TEST(ContactLoad, LogoTests){
3184 ContactDataObject TestFile;
3186 // Check that the vCard 4.0 file loads OK.
3188 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
3190 std::map<int,std::string>::iterator TestStrIter;
3191 std::map<int,wxString>::iterator TestFileIter;
3192 std::map<int,int>::iterator TestFileIntIter;
3194 // Start with the first photo.
3196 TestStrIter = TestFile.LogosList.find(0);
3197 ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
3198 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==",
3199 TestStrIter->second);
3201 // Check that it has the correct encoding.
3203 TestFileIter = TestFile.LogosListPicEncType.find(0);
3204 ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
3205 ASSERT_EQ("base64", TestFileIter->second);
3207 // Check that it has the correct image type.
3209 TestFileIter = TestFile.LogosListPictureType.find(0);
3210 ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
3211 ASSERT_EQ("image/png", TestFileIter->second);
3213 // Check the ALTID section.
3215 TestFileIter = TestFile.LogosListAltID.find(0);
3216 ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
3217 ASSERT_EQ("70", TestFileIter->second);
3219 // Check the PID section.
3221 TestFileIter = TestFile.LogosListPID.find(0);
3222 ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
3223 ASSERT_EQ("71", TestFileIter->second);
3225 // Check the TYPE section.
3227 // Check the MEDIATYPE section.
3229 TestFileIter = TestFile.LogosListMediatype.find(0);
3230 ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
3231 ASSERT_EQ("image/png", TestFileIter->second);
3233 // Check the PREF section.
3235 TestFileIntIter = TestFile.LogosListPref.find(0);
3236 ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
3237 ASSERT_EQ(72, TestFileIntIter->second);
3239 // Check the extra tokens.
3241 TestFileIter = TestFile.LogosListTokens.find(0);
3242 ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
3243 ASSERT_EQ("MEEP=MOO", TestFileIter->second);
3245 // Start with the second photo.
3247 TestStrIter = TestFile.LogosList.find(1);
3248 ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
3249 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC",
3250 TestStrIter->second);
3252 // Check that it has the correct encoding.
3254 TestFileIter = TestFile.LogosListPicEncType.find(1);
3255 ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
3256 ASSERT_EQ("base64", TestFileIter->second);
3258 // Check that it has the correct image type.
3260 TestFileIter = TestFile.LogosListPictureType.find(1);
3261 ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
3262 ASSERT_EQ("image/png", TestFileIter->second);
3264 // Check the ALTID section.
3266 TestFileIter = TestFile.LogosListAltID.find(1);
3267 ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
3268 ASSERT_EQ("20", TestFileIter->second);
3270 // Check the PID section.
3272 TestFileIter = TestFile.LogosListPID.find(1);
3273 ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
3274 ASSERT_EQ("21", TestFileIter->second);
3276 // Check the TYPE section.
3278 TestFileIter = TestFile.LogosListType.find(1);
3279 ASSERT_NE(TestFile.LogosListType.end(), TestFileIter);
3280 ASSERT_EQ("home", TestFileIter->second);
3282 // Check the MEDIATYPE section.
3284 TestFileIter = TestFile.LogosListMediatype.find(1);
3285 ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
3286 ASSERT_EQ("image/png", TestFileIter->second);
3288 // Check the PREF section.
3290 TestFileIntIter = TestFile.LogosListPref.find(1);
3291 ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
3292 ASSERT_EQ(22, TestFileIntIter->second);
3294 // Check the extra tokens.
3296 TestFileIter = TestFile.LogosListTokens.find(1);
3297 ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
3298 ASSERT_EQ("BEEP=BOOP", TestFileIter->second);
3300 // Start with the second photo.
3302 TestStrIter = TestFile.LogosList.find(2);
3303 ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
3304 ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=",
3305 TestStrIter->second);
3307 // Check that it has the correct encoding.
3309 TestFileIter = TestFile.LogosListPicEncType.find(2);
3310 ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
3311 ASSERT_EQ("base64", TestFileIter->second);
3313 // Check that it has the correct image type.
3315 TestFileIter = TestFile.LogosListPictureType.find(2);
3316 ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
3317 ASSERT_EQ("image/png", TestFileIter->second);
3319 // Check the ALTID section.
3321 TestFileIter = TestFile.LogosListAltID.find(2);
3322 ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
3323 ASSERT_EQ("90", TestFileIter->second);
3325 // Check the PID section.
3327 TestFileIter = TestFile.LogosListPID.find(2);
3328 ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
3329 ASSERT_EQ("91", TestFileIter->second);
3331 // Check the TYPE section.
3333 TestFileIter = TestFile.LogosListType.find(2);
3334 ASSERT_NE(TestFile.LogosListType.end(), TestFileIter);
3335 ASSERT_EQ("work", TestFileIter->second);
3337 // Check the MEDIATYPE section.
3339 TestFileIter = TestFile.LogosListMediatype.find(2);
3340 ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
3341 ASSERT_EQ("image/png", TestFileIter->second);
3343 // Check the PREF section.
3345 TestFileIntIter = TestFile.LogosListPref.find(2);
3346 ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
3347 ASSERT_EQ(92, TestFileIntIter->second);
3349 // Check the extra tokens.
3351 TestFileIter = TestFile.LogosListTokens.find(2);
3352 ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
3353 ASSERT_EQ("LOGO=YUP", TestFileIter->second);
3357 TEST(ContactLoad, SoundTests){
3359 // Setup the sound files first.
3361 ContactDataObject TestFile;
3363 // Check that the vCard 4.0 file loads OK.
3365 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
3367 std::map<int,std::string>::iterator TestStrIter;
3368 std::map<int,wxString>::iterator TestFileIter;
3369 std::map<int,int>::iterator TestFileIntIter;
3371 // Sound File A: Morse code X.
3373 std::string SoundA = "T2dnUwACAAAAAAAAAAAqlr5kAAAAAPjSH5UBHgF2b3"
3374 "JiaXMAAAAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAAKpa+ZAEAAAAJVIuhDzz//"
3375 "///////////////MgN2b3JiaXMsAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxNTAxMDUgKOKb"
3376 "hOKbhOKbhOKbhCkAAAAAAQV2b3JiaXMfQkNWAQAAAQAYY1QpRplS0kqJGXOUMUaZYpJKiaWEFkJ"
3377 "InXMUU6k515xrrLm1IIQQGlNQKQWZUo5SaRljkCkFmVIQS0kldBI6J51jEFtJwdaYa4tBthyEDZ"
3378 "pSTCnElFKKQggZU4wpxZRSSkIHJXQOOuYcU45KKEG4nHOrtZaWY4updJJK5yRkTEJIKYWSSgelU"
3379 "05CSDWW1lIpHXNSUmpB6CCEEEK2IIQNgtCQVQAAAQDAQBAasgoAUAAAEIqhGIoChIasAgAyAAAE"
3380 "oCiO4iiOIzmSY0kWEBqyCgAAAgAQAADAcBRJkRTJsSRL0ixL00RRVX3VNlVV9nVd13Vd13UgNGQ"
3381 "VAAABAEBIp5mlGiDCDGQYCA1ZBQAgAAAARijCEANCQ1YBAAABAABiKDmIJrTmfHOOg2Y5aCrF5n"
3382 "RwItXmSW4q5uacc845J5tzxjjnnHOKcmYxaCa05pxzEoNmKWgmtOacc57E5kFrqrTmnHPGOaeDc"
3383 "UYY55xzmrTmQWo21uaccxa0pjlqLsXmnHMi5eZJbS7V5pxzzjnnnHPOOeecc6oXp3NwTjjnnHOi"
3384 "9uZabkIX55xzPhmne3NCOOecc84555xzzjnnnHOC0JBVAAAQAABBGDaGcacgSJ+jgRhFiGnIpAf"
3385 "do8MkaAxyCqlHo6ORUuoglFTGSSmdIDRkFQAACAAAIYQUUkghhRRSSCGFFFKIIYYYYsgpp5yCCi"
3386 "qppKKKMsoss8wyyyyzzDLrsLPOOuwwxBBDDK20EktNtdVYY62555xrDtJaaa211koppZRSSikID"
3387 "VkFAIAAABAIGWSQQUYhhRRSiCGmnHLKKaigAkJDVgEAgAAAAgAAADzJc0RHdERHdERHdERHdETH"
3388 "czxHlERJlERJtEzL1ExPFVXVlV1b1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VVXWT"
3415 "dW0bVmWbWG2ZeF2Zdm3ZVv2ddeVdV/XfePXZd3murLty7Kt+6qr+rbu+8Jw667wCgAAGHAAAAgw"
3416 "oQwUGrISAIgCAACMYYwxCI1SzjkHoVHKOecgZM5BCCGVzDkIIZSSOQehlJQy5yCUklIIoZSUWgs"
3417 "hlJRSawUAABQ4AAAE2KApsThAoSErAYBUAACD41iW55miatqyY0meJ4qqqaq27UiW54miaaqqbV"
3418 "ueJ4qmqaqu6+ua54miaaqq6+q6aJqmqaqu67q6Lpqiqaqq67qyrpumqqquK7uy7Oumqqqq68quL"
3419 "PvCqrquK8uybevCsKqu68qybNu2b9y6ruu+7/vCka3rui78wjEMRwEA4AkOAEAFNqyOcFI0Flho"
3420 "yEoAIAMAgDAGIYMQQgYhhJBSSiGllBIAADDgAAAQYEIZKDRkRQAQJwAAGEMppJRSSimllFJKKaW"
3421 "UUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllF"
3422 "JKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSS"
3423 "imllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkop"
3424 "pZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaW"
3425 "UUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllF"
3426 "JKKaWUUkoplVJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKK"
3427 "aWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSCgCQinAAkHowoQwUGrISAEgF"
3428 "AACMUUopxpyDEDHmGGPQSSgpYsw5xhyUklLlHIQQUmktt8o5CCGk1FJtmXNSWosx5hgz56SkFFv"
3429 "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7Zsns/2pgUI+LsB6mEydtEiYWQVcSz"
3522 "iOHhL/sa+//nrh7Pz5KpgmpFCzBf7yBGINzZMCz5v33LC5yULV09Hr9rpCSq8fgadW7ODN463Xb"
3523 "RYbSNagn5oxALC2vr6uE5P38IBXIdW4jdSAxJ3hAqoAjAIYBecxAA==";
3525 // Sound B: Morse Code S.
3527 std::string SoundB = "T2dnUwACAAAAAAAAAAAoPAxpAAAAAER0X7"
3528 "YBHgF2b3JiaXMAAAAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAAKDwMaQEAAAA2m"
3529 "nO/Dzz/////////////////MgN2b3JiaXMsAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxNTAx"
3530 "MDUgKOKbhOKbhOKbhOKbhCkAAAAAAQV2b3JiaXMfQkNWAQAAAQAYY1QpRplS0kqJGXOUMUaZYpJ"
3531 "KiaWEFkJInXMUU6k515xrrLm1IIQQGlNQKQWZUo5SaRljkCkFmVIQS0kldBI6J51jEFtJwdaYa4"
3532 "tBthyEDZpSTCnElFKKQggZU4wpxZRSSkIHJXQOOuYcU45KKEG4nHOrtZaWY4updJJK5yRkTEJIK"
3533 "YWSSgelU05CSDWW1lIpHXNSUmpB6CCEEEK2IIQNgtCQVQAAAQDAQBAasgoAUAAAEIqhGIoChIas"
3534 "AgAyAAAEoCiO4iiOIzmSY0kWEBqyCgAAAgAQAADAcBRJkRTJsSRL0ixL00RRVX3VNlVV9nVd13V"
3535 "d13UgNGQVAAABAEBIp5mlGiDCDGQYCA1ZBQAgAAAARijCEANCQ1YBAAABAABiKDmIJrTmfHOOg2"
3536 "Y5aCrF5nRwItXmSW4q5uacc845J5tzxjjnnHOKcmYxaCa05pxzEoNmKWgmtOacc57E5kFrqrTmn"
3537 "HPGOaeDcUYY55xzmrTmQWo21uaccxa0pjlqLsXmnHMi5eZJbS7V5pxzzjnnnHPOOeecc6oXp3Nw"
3538 "TjjnnHOi9uZabkIX55xzPhmne3NCOOec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"
3565 "2maaWqeZ5qa55mmaZqybJqqK1uep5qeKKqq5ommaqqqLJumqsqW55mqJ4qq6omea5qqKsumatqq"
3566 "aZq2bKqqLZumKsuubfu+68qybqqqbJuqauumasqybMu+78qq7oqmKcumqtqyaaqyLduy78uyrPu"
3567 "iacqyaaqybaqqLsuybRuzbPu6aJqybaqmLZuqKtuyLfu6LNu678qub6uqrOuyLfu67vqucOu6ML"
3568 "yybPuqrPq6K9u6b+sy2/Z9RNOUZVM1bdtUVVl2Zdn2Zdv2fdE0bVtVVVs2TdW2ZVn2fVm2bWE0T"
3569 "dk2VVXWTdW0bVmWbWG2ZeF2Zdm3ZVv2ddeVdV/XfePXZd3murLty7Kt+6qr+rbu+8Jw667wCgAA"
3570 "GHAAAAgwoQwUGrISAIgCAACMYYwxCI1SzjkHoVHKOecgZM5BCCGVzDkIIZSSOQehlJQy5yCUklI"
3571 "IoZSUWgshlJRSawUAABQ4AAAE2KApsThAoSErAYBUAACD41iW55miatqyY0meJ4qqqaq27UiW54"
3572 "miaaqqbVueJ4qmqaqu6+ua54miaaqq6+q6aJqmqaqu67q6Lpqiqaqq67qyrpumqqquK7uy7Oumq"
3573 "qqq68quLPvCqrquK8uybevCsKqu68qybNu2b9y6ruu+7/vCka3rui78wjEMRwEA4AkOAEAFNqyO"
3574 "cFI0FlhoyEoAIAMAgDAGIYMQQgYhhJBSSiGllBIAADDgAAAQYEIZKDRkRQAQJwAAGEMppJRSSim"
3575 "llFJKKaWUUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZ"
3576 "RSSimllFJKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUU"
3577 "koppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJK"
3578 "KaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSim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Morse Code D.
3636 std::string SoundC = "T2dnUwACAAAAAAAAAABJz/4JAAAAAOq2RJ"
3637 "UBHgF2b3JiaXMAAAAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAASc/+CQEAAACmG"
3638 "2vbDzz/////////////////MgN2b3JiaXMsAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxNTAx"
3639 "MDUgKOKbhOKbhOKbhOKbhCkAAAAAAQV2b3JiaXMfQkNWAQAAAQAYY1QpRplS0kqJGXOUMUaZYpJ"
3640 "KiaWEFkJInXMUU6k515xrrLm1IIQQGlNQKQWZUo5SaRljkCkFmVIQS0kldBI6J51jEFtJwdaYa4"
3641 "tBthyEDZpSTCnElFKKQggZU4wpxZRSSkIHJXQOOuYcU45KKEG4nHOrtZaWY4updJJK5yRkTEJIK"
3642 "YWSSgelU05CSDWW1lIpHXNSUmpB6CCEEEK2IIQNgtCQVQAAAQDAQBAasgoAUAAAEIqhGIoChIas"
3643 "AgAyAAAEoCiO4iiOIzmSY0kWEBqyCgAAAgAQAADAcBRJkRTJsSRL0ixL00RRVX3VNlVV9nVd13V"
3644 "d13UgNGQVAAABAEBIp5mlGiDCDGQYCA1ZBQAgAAAARijCEANCQ1YBAAABAABiKDmIJrTmfHOOg2"
3645 "Y5aCrF5nRwItXmSW4q5uacc845J5tzxjjnnHOKcmYxaCa05pxzEoNmKWgmtOacc57E5kFrqrTmn"
3646 "HPGOaeDcUYY55xzmrTmQWo21uaccxa0pjlqLsXmnHMi5eZJbS7V5pxzzjnnnHPOOeecc6oXp3Nw"
3647 "TjjnnHOi9uZabkIX55xzPhmne3NCOOecc84555xzzjnnnHOC0JBVAAAQAABBGDaGcacgSJ+jgRh"
3648 "FiGnIpAfdo8MkaAxyCqlHo6ORUuoglFTGSSmdIDRkFQAACAAAIYQUUkghhRRSSCGFFFKIIYYYYs"
3649 "gpp5yCCiqppKKKMsoss8wyyyyzzDLrsLPOOuwwxBBDDK20EktNtdVYY62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mLZuqKtuyLfu6LNu678qub6uqrOuyLfu67vqucOu6ML"
3677 "yybPuqrPq6K9u6b+sy2/Z9RNOUZVM1bdtUVVl2Zdn2Zdv2fdE0bVtVVVs2TdW2ZVn2fVm2bWE0T"
3678 "dk2VVXWTdW0bVmWbWG2ZeF2Zdm3ZVv2ddeVdV/XfePXZd3murLty7Kt+6qr+rbu+8Jw667wCgAA"
3679 "GHAAAAgwoQwUGrISAIgCAACMYYwxCI1SzjkHoVHKOecgZM5BCCGVzDkIIZSSOQehlJQy5yCUklI"
3680 "IoZSUWgshlJRSawUAABQ4AAAE2KApsThAoSErAYBUAACD41iW55miatqyY0meJ4qqqaq27UiW54"
3681 "miaaqqbVueJ4qmqaqu6+ua54miaaqq6+q6aJqmqaqu67q6Lpqiqaqq67qyrpumqqquK7uy7Oumq"
3682 "qqq68quLPvCqrquK8uybevCsKqu68qybNu2b9y6ruu+7/vCka3rui78wjEMRwEA4AkOAEAFNqyO"
3683 "cFI0FlhoyEoAIAMAgDAGIYMQQgYhhJBSSiGllBIAADDgAAAQYEIZKDRkRQAQJwAAGEMppJRSSim"
3684 "llFJKKaWUUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZ"
3685 "RSSimllFJKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUU"
3686 "koppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJK"
3687 "KaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSim"
3688 "llFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZ"
3689 "RSSimllFJKKaWUUkoplVJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSS"
3690 "imllFJKKaWUUkoppZRSSimllFJKKaWUU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744 "1f4Rwp+z8PrWYm68BRE/EPff27gIUYf0bKt2rNvW/42tu1iZ8NiFaaXsyhwd0Xfexu4DlWACxPT"
3745 "uToUONMqDn5j1qm6nODTalkgKaS1/tU+raTY8jJcMZEi4ARLkcTpoF6OcOqKvtmjl9+vQ/xlKpB"
3746 "GIAIK9zQ/RCPelN7nQ5NPxMPV7u4x4NkonrkqGxKq4P1BSeipGC27qrrpiU+H+O2xmyxXVjTART"
3747 "S6eyc3uoMvHpgrKTs0FFWi2ypCYnnvks9H9NhOfS2GjfltH61uk9FWI93ls/1a3UeUwHSjIcTgo"
3748 "AIkXlhFkA/QAAUIBPlxkBQAvxEPHZM/T44bVSEz77DNivKlRDL2eYmwd77x0NJm6YVP9cZEJoMq"
3749 "6qnUz2EHaJnRZpzS1radsrMiKHeodrQ30sIQKDKCNkrwtaOz35knCjAQZZJnTpAd5bP9Wt1LlMB"
3750 "SUJTpBwASCwHA5HAdwXAaAoRNN7MgAKgEJzeSImylPNih8Sm+w5Xa4eV8b3YFJBnpqsMctUfMsK"
3751 "89gkEUtLTvHhUU8NifkeMgU+bNOlqDHhHD0cz1udkYgLMpGQNde4htA9Pds1HHezoitB5xAeC9/"
3752 "tRcpa4QNHAVYD+P9+GBogQa3MHFanBEXy8f8FHJp9q/eHVTvb/Dxhd8oXbYLZ7bY9XnmdSy5MvT"
3753 "oTbkW8W39ptMq5bR0+Z2XrPWTnwamtqY4eKow4NQ35rOiaKk49EpYoqYecozQYDhT04juULDYbJ"
3754 "n7IXeksuXpi2v2irciAXICHx2PAvM4SVoUKcberP+c9c+Pj7unVvPkyBqbwKmHWBSOj4S4e7W5o"
3755 "SH9nHhrW1jnyCtQZClVD86hh6E7vpEDb8Ny+AbwuSlI+b4KyFDt6/fEADBnCOeFgDID42jkBQ+w"
3756 "FjNEAGMJtbcK5WgAODg==";
3758 // Start with Sound A.
3760 TestStrIter = TestFile.SoundsList.find(0);
3761 ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
3762 ASSERT_EQ(SoundA, TestStrIter->second);
3764 // Check that it has the correct encoding.
3766 TestFileIter = TestFile.SoundsListAudioEncType.find(0);
3767 ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
3768 ASSERT_EQ("base64", TestFileIter->second);
3770 // Check that it has the correct image type.
3772 TestFileIter = TestFile.SoundsListAudioType.find(0);
3773 ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
3774 ASSERT_EQ("application/ogg", TestFileIter->second);
3776 // Check the ALTID section.
3778 TestFileIter = TestFile.SoundsListAltID.find(0);
3779 ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
3780 ASSERT_EQ("4", TestFileIter->second);
3782 // Check the PID section.
3784 TestFileIter = TestFile.SoundsListPID.find(0);
3785 ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
3786 ASSERT_EQ("1", TestFileIter->second);
3788 // Check the MEDIATYPE section.
3790 TestFileIter = TestFile.SoundsListMediatype.find(0);
3791 ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
3792 ASSERT_EQ("application/ogg", TestFileIter->second);
3794 // Check the TYPE section.
3796 TestFileIter = TestFile.SoundsListType.find(0);
3797 ASSERT_EQ(TestFile.SoundsListType.end(), TestFileIter);
3799 // Check the LANGUAGE section.
3801 TestFileIter = TestFile.SoundsListLanguage.find(0);
3802 ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
3803 ASSERT_EQ("kw", TestFileIter->second);
3805 // Check the PREF section.
3807 TestFileIntIter = TestFile.SoundsListPref.find(0);
3808 ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
3809 ASSERT_EQ(2, TestFileIntIter->second);
3811 // Check the extra tokens.
3813 TestFileIter = TestFile.SoundsListTokens.find(0);
3814 ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
3815 ASSERT_EQ("MEEP=MOO", TestFileIter->second);
3817 // Start with Sound B.
3819 TestStrIter = TestFile.SoundsList.find(1);
3820 ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
3821 ASSERT_EQ(SoundB, TestStrIter->second);
3823 // Check that it has the correct encoding.
3825 TestFileIter = TestFile.SoundsListAudioEncType.find(1);
3826 ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
3827 ASSERT_EQ("base64", TestFileIter->second);
3829 // Check that it has the correct image type.
3831 TestFileIter = TestFile.SoundsListAudioType.find(1);
3832 ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
3833 ASSERT_EQ("application/ogg", TestFileIter->second);
3835 // Check the TYPE section.
3837 TestFileIter = TestFile.SoundsListType.find(1);
3838 ASSERT_NE(TestFile.SoundsListType.end(), TestFileIter);
3839 ASSERT_EQ("home", TestFileIter->second);
3841 // Check the ALTID section.
3843 TestFileIter = TestFile.SoundsListAltID.find(1);
3844 ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
3845 ASSERT_EQ("24", TestFileIter->second);
3847 // Check the PID section.
3849 TestFileIter = TestFile.SoundsListPID.find(1);
3850 ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
3851 ASSERT_EQ("21", TestFileIter->second);
3853 // Check the MEDIATYPE section.
3855 TestFileIter = TestFile.SoundsListMediatype.find(1);
3856 ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
3857 ASSERT_EQ("application/ogg", TestFileIter->second);
3859 // Check the LANGUAGE section.
3861 TestFileIter = TestFile.SoundsListLanguage.find(1);
3862 ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
3863 ASSERT_EQ("kw", TestFileIter->second);
3865 // Check the PREF section.
3867 TestFileIntIter = TestFile.SoundsListPref.find(1);
3868 ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
3869 ASSERT_EQ(22, TestFileIntIter->second);
3871 // Check the extra tokens.
3873 TestFileIter = TestFile.SoundsListTokens.find(1);
3874 ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
3875 ASSERT_EQ("SOUND=WAVE", TestFileIter->second);
3877 // Start with Sound C.
3879 TestStrIter = TestFile.SoundsList.find(2);
3880 ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
3881 ASSERT_EQ(SoundC, TestStrIter->second);
3883 // Check that it has the correct encoding.
3885 TestFileIter = TestFile.SoundsListAudioEncType.find(2);
3886 ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
3887 ASSERT_EQ("base64", TestFileIter->second);
3889 // Check that it has the correct image type.
3891 TestFileIter = TestFile.SoundsListAudioType.find(2);
3892 ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
3893 ASSERT_EQ("application/ogg", TestFileIter->second);
3895 // Check the TYPE section.
3897 TestFileIter = TestFile.SoundsListType.find(2);
3898 ASSERT_NE(TestFile.SoundsListType.end(), TestFileIter);
3899 ASSERT_EQ("work", TestFileIter->second);
3901 // Check the ALTID section.
3903 TestFileIter = TestFile.SoundsListAltID.find(2);
3904 ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
3905 ASSERT_EQ("44", TestFileIter->second);
3907 // Check the PID section.
3909 TestFileIter = TestFile.SoundsListPID.find(2);
3910 ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
3911 ASSERT_EQ("41", TestFileIter->second);
3913 // Check the MEDIATYPE section.
3915 TestFileIter = TestFile.SoundsListMediatype.find(2);
3916 ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
3917 ASSERT_EQ("application/ogg", TestFileIter->second);
3919 // Check the LANGUAGE section.
3921 TestFileIter = TestFile.SoundsListLanguage.find(2);
3922 ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
3923 ASSERT_EQ("kw", TestFileIter->second);
3925 // Check the PREF section.
3927 TestFileIntIter = TestFile.SoundsListPref.find(2);
3928 ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
3929 ASSERT_EQ(42, TestFileIntIter->second);
3931 // Check the extra tokens.
3933 TestFileIter = TestFile.SoundsListTokens.find(2);
3934 ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
3935 ASSERT_EQ("WAVE=SOUND", TestFileIter->second);
3939 TEST(ContactLoad, CalendarURITests){
3941 ContactDataObject TestFile;
3943 // Check that the vCard 4.0 file loads OK.
3945 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
3947 std::map<int,wxString>::iterator TestFileIter;
3948 std::map<int,int>::iterator TestFileIntIter;
3950 // Start with a general calendar address.
3952 TestFileIter = TestFile.CalendarList.find(0);
3953 ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
3954 ASSERT_EQ("http://example.com", TestFileIter->second);
3956 // Check the TYPE section.
3958 TestFileIter = TestFile.CalendarListType.find(0);
3959 ASSERT_EQ(TestFile.CalendarListType.end(), TestFileIter);
3961 // Check the ALTID section.
3963 TestFileIter = TestFile.CalendarListAltID.find(0);
3964 ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
3965 ASSERT_EQ("34", TestFileIter->second);
3967 // Check the PID section.
3969 TestFileIter = TestFile.CalendarListPID.find(0);
3970 ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
3971 ASSERT_EQ("31", TestFileIter->second);
3973 // Check the MEDIATYPE section.
3975 TestFileIter = TestFile.CalendarListMediatype.find(0);
3976 ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
3977 ASSERT_EQ("text/plain", TestFileIter->second);
3979 // Check the PREF section.
3981 TestFileIntIter = TestFile.CalendarListPref.find(0);
3982 ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
3983 ASSERT_EQ(32, TestFileIntIter->second);
3985 // Check the extra tokens.
3987 TestFileIter = TestFile.CalendarListTokens.find(0);
3988 ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
3989 ASSERT_EQ("CALENDARS=FLYING", TestFileIter->second);
3991 // Start with a home calendar address.
3993 TestFileIter = TestFile.CalendarList.find(1);
3994 ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
3995 ASSERT_EQ("http://example.com/home", TestFileIter->second);
3997 // Check the TYPE section.
3999 TestFileIter = TestFile.CalendarListType.find(1);
4000 ASSERT_NE(TestFile.CalendarListType.end(), TestFileIter);
4001 ASSERT_EQ("home", TestFileIter->second);
4003 // Check the ALTID section.
4005 TestFileIter = TestFile.CalendarListAltID.find(1);
4006 ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
4007 ASSERT_EQ("44", TestFileIter->second);
4009 // Check the PID section.
4011 TestFileIter = TestFile.CalendarListPID.find(1);
4012 ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
4013 ASSERT_EQ("41", TestFileIter->second);
4015 // Check the MEDIATYPE section.
4017 TestFileIter = TestFile.CalendarListMediatype.find(1);
4018 ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
4019 ASSERT_EQ("text/dryplain", TestFileIter->second);
4021 // Check the PREF section.
4023 TestFileIntIter = TestFile.CalendarListPref.find(1);
4024 ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
4025 ASSERT_EQ(42, TestFileIntIter->second);
4027 // Check the extra tokens.
4029 TestFileIter = TestFile.CalendarListTokens.find(1);
4030 ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
4031 ASSERT_EQ("CALENDARS=GROUNDED", TestFileIter->second);
4033 // Start with a business calendar address.
4035 TestFileIter = TestFile.CalendarList.find(2);
4036 ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
4037 ASSERT_EQ("http://example.com/business", TestFileIter->second);
4039 // Check the TYPE section.
4041 TestFileIter = TestFile.CalendarListType.find(2);
4042 ASSERT_NE(TestFile.CalendarListType.end(), TestFileIter);
4043 ASSERT_EQ("work", TestFileIter->second);
4045 // Check the ALTID section.
4047 TestFileIter = TestFile.CalendarListAltID.find(2);
4048 ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
4049 ASSERT_EQ("54", TestFileIter->second);
4051 // Check the PID section.
4053 TestFileIter = TestFile.CalendarListPID.find(2);
4054 ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
4055 ASSERT_EQ("51", TestFileIter->second);
4057 // Check the MEDIATYPE section.
4059 TestFileIter = TestFile.CalendarListMediatype.find(2);
4060 ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
4061 ASSERT_EQ("text/stillwetink", TestFileIter->second);
4063 // Check the PREF section.
4065 TestFileIntIter = TestFile.CalendarListPref.find(2);
4066 ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
4067 ASSERT_EQ(52, TestFileIntIter->second);
4069 // Check the extra tokens.
4071 TestFileIter = TestFile.CalendarListTokens.find(2);
4072 ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
4073 ASSERT_EQ("CALENDARS=CANCELLED", TestFileIter->second);
4077 TEST(ContactLoad, CalendarAddressURITests){
4079 ContactDataObject TestFile;
4081 // Check that the vCard 4.0 file loads OK.
4083 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
4085 std::map<int,wxString>::iterator TestFileIter;
4086 std::map<int,int>::iterator TestFileIntIter;
4088 // Start with a general calendar request address.
4090 TestFileIter = TestFile.CalendarRequestList.find(0);
4091 ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
4092 ASSERT_EQ("http://example.com/request", TestFileIter->second);
4094 // Check the TYPE section.
4096 TestFileIter = TestFile.CalendarRequestListType.find(0);
4097 ASSERT_EQ(TestFile.CalendarRequestListType.end(), TestFileIter);
4099 // Check the ALTID section.
4101 TestFileIter = TestFile.CalendarRequestListAltID.find(0);
4102 ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
4103 ASSERT_EQ("14", TestFileIter->second);
4105 // Check the PID section.
4107 TestFileIter = TestFile.CalendarRequestListPID.find(0);
4108 ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
4109 ASSERT_EQ("11", TestFileIter->second);
4111 // Check the MEDIATYPE section.
4113 TestFileIter = TestFile.CalendarRequestListMediatype.find(0);
4114 ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
4115 ASSERT_EQ("text/plain", TestFileIter->second);
4117 // Check the PREF section.
4119 TestFileIntIter = TestFile.CalendarRequestListPref.find(0);
4120 ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
4121 ASSERT_EQ(12, TestFileIntIter->second);
4123 // Check the extra tokens.
4125 TestFileIter = TestFile.CalendarRequestListTokens.find(0);
4126 ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
4127 ASSERT_EQ("REQUEST=YES", TestFileIter->second);
4129 // Start with a home calendar request address.
4131 TestFileIter = TestFile.CalendarRequestList.find(1);
4132 ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
4133 ASSERT_EQ("http://example.com/home/request", TestFileIter->second);
4135 // Check the TYPE section.
4137 TestFileIter = TestFile.CalendarRequestListType.find(1);
4138 ASSERT_NE(TestFile.CalendarRequestListType.end(), TestFileIter);
4139 ASSERT_EQ("home", TestFileIter->second);
4141 // Check the ALTID section.
4143 TestFileIter = TestFile.CalendarRequestListAltID.find(1);
4144 ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
4145 ASSERT_EQ("24", TestFileIter->second);
4147 // Check the PID section.
4149 TestFileIter = TestFile.CalendarRequestListPID.find(1);
4150 ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
4151 ASSERT_EQ("21", TestFileIter->second);
4153 // Check the MEDIATYPE section.
4155 TestFileIter = TestFile.CalendarRequestListMediatype.find(1);
4156 ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
4157 ASSERT_EQ("text/dryplain", TestFileIter->second);
4159 // Check the PREF section.
4161 TestFileIntIter = TestFile.CalendarRequestListPref.find(1);
4162 ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
4163 ASSERT_EQ(22, TestFileIntIter->second);
4165 // Check the extra tokens.
4167 TestFileIter = TestFile.CalendarRequestListTokens.find(1);
4168 ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
4169 ASSERT_EQ("REQUEST=MAYBE", TestFileIter->second);
4171 // Start with a business calendar request address.
4173 TestFileIter = TestFile.CalendarRequestList.find(2);
4174 ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
4175 ASSERT_EQ("http://example.com/business/request", TestFileIter->second);
4177 // Check the TYPE section.
4179 TestFileIter = TestFile.CalendarRequestListType.find(2);
4180 ASSERT_NE(TestFile.CalendarRequestListType.end(), TestFileIter);
4181 ASSERT_EQ("work", TestFileIter->second);
4183 // Check the ALTID section.
4185 TestFileIter = TestFile.CalendarRequestListAltID.find(2);
4186 ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
4187 ASSERT_EQ("34", TestFileIter->second);
4189 // Check the PID section.
4191 TestFileIter = TestFile.CalendarRequestListPID.find(2);
4192 ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
4193 ASSERT_EQ("31", TestFileIter->second);
4195 // Check the MEDIATYPE section.
4197 TestFileIter = TestFile.CalendarRequestListMediatype.find(2);
4198 ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
4199 ASSERT_EQ("text/stillwetink", TestFileIter->second);
4201 // Check the PREF section.
4203 TestFileIntIter = TestFile.CalendarRequestListPref.find(2);
4204 ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
4205 ASSERT_EQ(32, TestFileIntIter->second);
4207 // Check the extra tokens.
4209 TestFileIter = TestFile.CalendarRequestListTokens.find(2);
4210 ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
4211 ASSERT_EQ("REQUEST=NO", TestFileIter->second);
4215 TEST(ContactLoad, FreeBusyTests){
4217 ContactDataObject TestFile;
4219 // Check that the vCard 4.0 file loads OK.
4221 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
4223 std::map<int,wxString>::iterator TestFileIter;
4224 std::map<int,int>::iterator TestFileIntIter;
4226 // Start with a general calendar free busy address.
4228 TestFileIter = TestFile.FreeBusyList.find(0);
4229 ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
4230 ASSERT_EQ("http://example.com/freebusy", TestFileIter->second);
4232 // Check the TYPE section.
4234 TestFileIter = TestFile.FreeBusyListType.find(0);
4235 ASSERT_EQ(TestFile.FreeBusyListType.end(), TestFileIter);
4237 // Check the ALTID section.
4239 TestFileIter = TestFile.FreeBusyListAltID.find(0);
4240 ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
4241 ASSERT_EQ("74", TestFileIter->second);
4243 // Check the PID section.
4245 TestFileIter = TestFile.FreeBusyListPID.find(0);
4246 ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
4247 ASSERT_EQ("71", TestFileIter->second);
4249 // Check the MEDIATYPE section.
4251 TestFileIter = TestFile.FreeBusyListMediatype.find(0);
4252 ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
4253 ASSERT_EQ("text/plain", TestFileIter->second);
4255 // Check the PREF section.
4257 TestFileIntIter = TestFile.FreeBusyListPref.find(0);
4258 ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
4259 ASSERT_EQ(72, TestFileIntIter->second);
4261 // Check the extra tokens.
4263 TestFileIter = TestFile.FreeBusyListTokens.find(0);
4264 ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
4265 ASSERT_EQ("STATUS=OUT", TestFileIter->second);
4267 // Start with a home calendar free busy address.
4269 TestFileIter = TestFile.FreeBusyList.find(1);
4270 ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
4271 ASSERT_EQ("http://example.com/home/freebusy", TestFileIter->second);
4273 // Check the TYPE section.
4275 TestFileIter = TestFile.FreeBusyListType.find(1);
4276 ASSERT_NE(TestFile.FreeBusyListType.end(), TestFileIter);
4277 ASSERT_EQ("home", TestFileIter->second);
4279 // Check the ALTID section.
4281 TestFileIter = TestFile.FreeBusyListAltID.find(1);
4282 ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
4283 ASSERT_EQ("84", TestFileIter->second);
4285 // Check the PID section.
4287 TestFileIter = TestFile.FreeBusyListPID.find(1);
4288 ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
4289 ASSERT_EQ("81", TestFileIter->second);
4291 // Check the MEDIATYPE section.
4293 TestFileIter = TestFile.FreeBusyListMediatype.find(1);
4294 ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
4295 ASSERT_EQ("text/dryplain", TestFileIter->second);
4297 // Check the PREF section.
4299 TestFileIntIter = TestFile.FreeBusyListPref.find(1);
4300 ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
4301 ASSERT_EQ(82, TestFileIntIter->second);
4303 // Check the extra tokens.
4305 TestFileIter = TestFile.FreeBusyListTokens.find(1);
4306 ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
4307 ASSERT_EQ("STATUS=FREE", TestFileIter->second);
4309 // Start with a business calendar free busy address.
4311 TestFileIter = TestFile.FreeBusyList.find(2);
4312 ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
4313 ASSERT_EQ("http://example.com/business/freebusy", TestFileIter->second);
4315 // Check the TYPE section.
4317 TestFileIter = TestFile.FreeBusyListType.find(2);
4318 ASSERT_NE(TestFile.FreeBusyListType.end(), TestFileIter);
4319 ASSERT_EQ("work", TestFileIter->second);
4321 // Check the ALTID section.
4323 TestFileIter = TestFile.FreeBusyListAltID.find(2);
4324 ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
4325 ASSERT_EQ("94", TestFileIter->second);
4327 // Check the PID section.
4329 TestFileIter = TestFile.FreeBusyListPID.find(2);
4330 ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
4331 ASSERT_EQ("91", TestFileIter->second);
4333 // Check the MEDIATYPE section.
4335 TestFileIter = TestFile.FreeBusyListMediatype.find(2);
4336 ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
4337 ASSERT_EQ("text/stillwetink", TestFileIter->second);
4339 // Check the PREF section.
4341 TestFileIntIter = TestFile.FreeBusyListPref.find(2);
4342 ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
4343 ASSERT_EQ(92, TestFileIntIter->second);
4345 // Check the extra tokens.
4347 TestFileIter = TestFile.FreeBusyListTokens.find(2);
4348 ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
4349 ASSERT_EQ("STATUS=BUSY", TestFileIter->second);
4353 TEST(ContactLoad, KeyTests){
4355 ContactDataObject TestFile;
4357 wxString KeyA = "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdudVBHIHYyCgpt"
4358 "UU11QkZaL0JyWVJDQUN2cTNueUl4dXJPOFovMHcwQWdkeUdhN1d2cWRpdk5OWVdEM3dmZkgrSi83"
4359 "R2o1dkNOClJwWFQ5TVI4SEdmR0Jwai9hc0NsajltbjhnRENMcVZJaXFybXZXK3dHbnhBVWxFU05V"
4360 "T201cEx6NTRwTzBzOW0KYzJ5SDRkYWVYR3pRTXFLUit2TDZaTWpDc0pSRk1UWVAzSDlTMlBFaHFF"
4361 "MXl4TnBpRi9ZTS9jNGNOYmU5bEZsTgpKMnJ2QzA2bzZuMFlzYWtuZTk3bWlndGNyTUpZVDljVDF4"
4362 "cjB5YUhDekcrVXZqOG1RMnlGT0tpVEpxeGlCVEdhClRMWjJjTFBVZVFFbnpjSWNwNnhVTitQZlZY"
4363 "ZzNNVllHWUZQakk0aUg0anNCQUFDc1BEMmpYSExnYVVzLzJ5VHUKNVF4M1RKSHljVTArOXZidC85"
4364 "VDJKdGt3c1R5SXlqQnJ0eGd6QVFERENaaFZoNU5oOFJuSWlSRDFzMzNmN1RoZgp4eENUMU0yWHI3"
4365 "dWh1WVFTZ1FmNUFR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VqRndvRmVrbnpZa2RFMmdJb2ZuaDk0CjdKeUh"
4472 "aNDUyTERkamZXQ1BZWFU9Cj16T3NxCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS"
4475 // Check that the vCard 4.0 file loads OK.
4477 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
4479 std::map<int,wxString>::iterator TestFileIter;
4480 std::map<int,int>::iterator TestFileIntIter;
4482 // Start with a general key.
4484 TestFileIter = TestFile.KeyList.find(0);
4485 ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
4486 ASSERT_EQ(KeyA, TestFileIter->second);
4488 // Check the encoding type.
4490 TestFileIter = TestFile.KeyListDataEncType.find(0);
4491 ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
4492 ASSERT_EQ("base64", TestFileIter->second.ToStdString());
4494 // Check the file type.
4496 TestFileIter = TestFile.KeyListDataType.find(0);
4497 ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
4498 ASSERT_EQ("application/pgp-keys", TestFileIter->second);
4500 // Check the TYPE section.
4502 TestFileIter = TestFile.KeyListType.find(0);
4503 ASSERT_EQ(TestFile.KeyListType.end(), TestFileIter);
4505 // Check the ALTID section.
4507 TestFileIter = TestFile.KeyListAltID.find(0);
4508 ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
4509 ASSERT_EQ("54", TestFileIter->second);
4511 // Check the PID section.
4513 TestFileIter = TestFile.KeyListPID.find(0);
4514 ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
4515 ASSERT_EQ("51", TestFileIter->second);
4517 // Check the PREF section.
4519 TestFileIntIter = TestFile.KeyListPref.find(0);
4520 ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
4521 ASSERT_EQ(52, TestFileIntIter->second);
4523 // Check the extra tokens.
4525 TestFileIter = TestFile.KeyListTokens.find(0);
4526 ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
4527 ASSERT_EQ("KEYS=JUSTONE", TestFileIter->second);
4529 // Start with a work key.
4531 TestFileIter = TestFile.KeyList.find(1);
4532 ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
4533 ASSERT_EQ(KeyB, TestFileIter->second);
4535 // Check the encoding type.
4537 TestFileIter = TestFile.KeyListDataEncType.find(1);
4538 ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
4539 ASSERT_EQ("base64", TestFileIter->second.ToStdString());
4541 // Check the file type.
4543 TestFileIter = TestFile.KeyListDataType.find(1);
4544 ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
4545 ASSERT_EQ("application/pgp-keys", TestFileIter->second);
4547 // Check the TYPE section.
4549 TestFileIter = TestFile.KeyListType.find(1);
4550 ASSERT_NE(TestFile.KeyListType.end(), TestFileIter);
4551 ASSERT_EQ("home", TestFileIter->second);
4553 // Check the ALTID section.
4555 TestFileIter = TestFile.KeyListAltID.find(1);
4556 ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
4557 ASSERT_EQ("64", TestFileIter->second);
4559 // Check the PID section.
4561 TestFileIter = TestFile.KeyListPID.find(1);
4562 ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
4563 ASSERT_EQ("61", TestFileIter->second);
4565 // Check the PREF section.
4567 TestFileIntIter = TestFile.KeyListPref.find(1);
4568 ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
4569 ASSERT_EQ(62, TestFileIntIter->second);
4571 // Check the extra tokens.
4573 TestFileIter = TestFile.KeyListTokens.find(1);
4574 ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
4575 ASSERT_EQ("KEYS=NONE", TestFileIter->second);
4577 // Start with a business key.
4579 TestFileIter = TestFile.KeyList.find(2);
4580 ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
4581 ASSERT_EQ(KeyC, TestFileIter->second);
4583 // Check the encoding type.
4585 TestFileIter = TestFile.KeyListDataEncType.find(2);
4586 ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
4587 ASSERT_EQ("base64", TestFileIter->second.ToStdString());
4589 // Check the file type.
4591 TestFileIter = TestFile.KeyListDataType.find(2);
4592 ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
4593 ASSERT_EQ("application/pgp-keys", TestFileIter->second);
4595 // Check the TYPE section.
4597 TestFileIter = TestFile.KeyListType.find(2);
4598 ASSERT_NE(TestFile.KeyListType.end(), TestFileIter);
4599 ASSERT_EQ("work", TestFileIter->second);
4601 // Check the ALTID section.
4603 TestFileIter = TestFile.KeyListAltID.find(2);
4604 ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
4605 ASSERT_EQ("74", TestFileIter->second);
4607 // Check the PID section.
4609 TestFileIter = TestFile.KeyListPID.find(2);
4610 ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
4611 ASSERT_EQ("71", TestFileIter->second);
4613 // Check the PREF section.
4615 TestFileIntIter = TestFile.KeyListPref.find(2);
4616 ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
4617 ASSERT_EQ(72, TestFileIntIter->second);
4619 // Check the extra tokens.
4621 TestFileIter = TestFile.KeyListTokens.find(2);
4622 ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
4623 ASSERT_EQ("KEYS=MISSING", TestFileIter->second);
4627 TEST(ContactLoad, VendorTests){
4629 ContactDataObject TestFile;
4631 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
4633 std::map<int,wxString>::iterator TestFileIter;
4634 std::map<int,int>::iterator TestFileIntIter;
4636 // Start with the first vendor namespace.
4638 TestFileIter = TestFile.VendorList.find(0);
4639 ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
4640 ASSERT_EQ("Lemon", TestFileIter->second);
4642 TestFileIter = TestFile.VendorListPEN.find(0);
4643 ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
4644 ASSERT_EQ("696", TestFileIter->second);
4646 TestFileIter = TestFile.VendorListElement.find(0);
4647 ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
4648 ASSERT_EQ("CAKE", TestFileIter->second);
4650 // Start with the second vendor namespace.
4652 TestFileIter = TestFile.VendorList.find(1);
4653 ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
4654 ASSERT_EQ("Orange", TestFileIter->second);
4656 TestFileIter = TestFile.VendorListPEN.find(1);
4657 ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
4658 ASSERT_EQ("696", TestFileIter->second);
4660 TestFileIter = TestFile.VendorListElement.find(1);
4661 ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
4662 ASSERT_EQ("DRINK", TestFileIter->second);
4664 // Start with the third vendor namespace.
4666 TestFileIter = TestFile.VendorList.find(2);
4667 ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
4668 ASSERT_EQ("Shiena Nishizawa", TestFileIter->second);
4670 TestFileIter = TestFile.VendorListPEN.find(2);
4671 ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
4672 ASSERT_EQ("696", TestFileIter->second);
4674 TestFileIter = TestFile.VendorListElement.find(2);
4675 ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
4676 ASSERT_EQ("MUSIC", TestFileIter->second);
4680 TEST(ContactLoad, XTokenTest){
4682 ContactDataObject TestFile;
4684 ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
4686 std::map<int,wxString>::iterator TestFileIter;
4687 std::map<int,int>::iterator TestFileIntIter;
4689 // Three X-FARM variables.
4691 TestFileIter = TestFile.XTokenList.find(0);
4692 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4693 ASSERT_EQ("Yard", TestFileIter->second);
4695 TestFileIter = TestFile.XTokenListTokens.find(0);
4696 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4697 ASSERT_EQ("FARM", TestFileIter->second);
4699 TestFileIter = TestFile.XTokenList.find(1);
4700 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4701 ASSERT_EQ("Animals", TestFileIter->second);
4703 TestFileIter = TestFile.XTokenListTokens.find(1);
4704 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4705 ASSERT_EQ("FARM", TestFileIter->second);
4707 TestFileIter = TestFile.XTokenList.find(2);
4708 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4709 ASSERT_EQ("Shed", TestFileIter->second);
4711 TestFileIter = TestFile.XTokenListTokens.find(2);
4712 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4713 ASSERT_EQ("FARM;LOCATION=Back;TYPE=Vehicles", TestFileIter->second.ToStdString());
4715 // Three X-DISKSERIAL variables.
4717 TestFileIter = TestFile.XTokenList.find(3);
4718 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4719 ASSERT_EQ("14444", TestFileIter->second);
4721 TestFileIter = TestFile.XTokenListTokens.find(3);
4722 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4723 ASSERT_EQ("DISKSERIAL", TestFileIter->second);
4725 TestFileIter = TestFile.XTokenList.find(4);
4726 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4727 ASSERT_EQ("7555", TestFileIter->second);
4729 TestFileIter = TestFile.XTokenListTokens.find(4);
4730 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4731 ASSERT_EQ("DISKSERIAL", TestFileIter->second);
4733 TestFileIter = TestFile.XTokenList.find(5);
4734 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4735 ASSERT_EQ("3250539032590", TestFileIter->second);
4737 TestFileIter = TestFile.XTokenListTokens.find(5);
4738 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4739 ASSERT_EQ("DISKSERIAL;STATUS=DESTROYED;TYPE=FLASH", TestFileIter->second.ToStdString());
4741 // Three X-FOODS variables.
4743 TestFileIter = TestFile.XTokenList.find(6);
4744 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4745 ASSERT_EQ("Lemon Cake", TestFileIter->second);
4747 TestFileIter = TestFile.XTokenListTokens.find(6);
4748 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4749 ASSERT_EQ("FOODS;STATUS=HIGH", TestFileIter->second);
4751 TestFileIter = TestFile.XTokenList.find(7);
4752 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4753 ASSERT_EQ("Starrey Gazey Pie", TestFileIter->second);
4755 TestFileIter = TestFile.XTokenListTokens.find(7);
4756 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4757 ASSERT_EQ("FOODS;STATUS=LOW", TestFileIter->second);
4759 TestFileIter = TestFile.XTokenList.find(8);
4760 ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
4761 ASSERT_EQ("Cornish Pasties", TestFileIter->second);
4763 TestFileIter = TestFile.XTokenListTokens.find(8);
4764 ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
4765 ASSERT_EQ("FOODS;STATUS=FAVOURITE;TYPE=CHEESEANDONION", TestFileIter->second.ToStdString());