X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Ftests%2Fxestiaab_contactload.h;h=66e548ed6c32f70eed69ae29b7a65257ca7f267e;hp=dea51d36d9838121c0c66dfa561fd97da358fca8;hb=072925fb1ad8123b6739fdfdaaf490bc8611f381;hpb=78a23a10b1ff0a041ab18891290a160b41d94530 diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index dea51d3..66e548e 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -2465,4 +2465,165 @@ TEST(ContactLoad, PhotoTests){ } +TEST(ContactLoad, LogoTests){ + + ContactDataObject TestFile; + + // Check that the vCard 4.0 file loads OK. + + ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf")); + + std::map::iterator TestStrIter; + std::map::iterator TestFileIter; + std::map::iterator TestFileIntIter; + + // Start with the first photo. + + TestStrIter = TestFile.LogosList.find(0); + ASSERT_NE(TestFile.LogosList.end(), TestStrIter); + ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==", + TestStrIter->second); + + // Check that it has the correct encoding. + + TestFileIter = TestFile.LogosListPicEncType.find(0); + ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second); + + // Check that it has the correct image type. + + TestFileIter = TestFile.LogosListPictureType.find(0); + ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.LogosListAltID.find(0); + ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter); + ASSERT_EQ("70", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.LogosListPID.find(0); + ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); + ASSERT_EQ("71", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.LogosListMediatype.find(0); + ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.LogosListPref.find(0); + ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter); + ASSERT_EQ(72, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.LogosListTokens.find(0); + ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter); + ASSERT_EQ("MEEP=MOO", TestFileIter->second); + + // Start with the second photo. + + TestStrIter = TestFile.LogosList.find(1); + ASSERT_NE(TestFile.LogosList.end(), TestStrIter); + ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC", + TestStrIter->second); + + // Check that it has the correct encoding. + + TestFileIter = TestFile.LogosListPicEncType.find(1); + ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second); + + // Check that it has the correct image type. + + TestFileIter = TestFile.LogosListPictureType.find(1); + ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.LogosListAltID.find(1); + ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter); + ASSERT_EQ("20", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.LogosListPID.find(1); + ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); + ASSERT_EQ("21", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.LogosListMediatype.find(1); + ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.LogosListPref.find(1); + ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter); + ASSERT_EQ(22, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.LogosListTokens.find(1); + ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter); + ASSERT_EQ("BEEP=BOOP", TestFileIter->second); + + // Start with the second photo. + + TestStrIter = TestFile.LogosList.find(2); + ASSERT_NE(TestFile.LogosList.end(), TestStrIter); + ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=", + TestStrIter->second); + + // Check that it has the correct encoding. + + TestFileIter = TestFile.LogosListPicEncType.find(2); + ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second); + + // Check that it has the correct image type. + + TestFileIter = TestFile.LogosListPictureType.find(2); + ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.LogosListAltID.find(2); + ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter); + ASSERT_EQ("90", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.LogosListPID.find(2); + ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); + ASSERT_EQ("91", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.LogosListMediatype.find(2); + ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter); + ASSERT_EQ("image/png", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.LogosListPref.find(2); + ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter); + ASSERT_EQ(92, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.LogosListTokens.find(2); + ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter); + ASSERT_EQ("LOGO=YUP", TestFileIter->second); + +} + // TODO: Add tests for the Contact Loading process. \ No newline at end of file