From 819087692c30d3f3fff5074bf43c822f0f446037 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 31 Dec 2015 22:08:11 +0000 Subject: [PATCH] Added tests for checking the PHOTO and LOGO TYPEs. --- source/tests/LoadCheck-Load4.vcf | 24 ++++++++++----------- source/tests/xestiaab_contactload.h | 33 ++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/source/tests/LoadCheck-Load4.vcf b/source/tests/LoadCheck-Load4.vcf index 31462b0..1b0b0d7 100644 --- a/source/tests/LoadCheck-Load4.vcf +++ b/source/tests/LoadCheck-Load4.vcf @@ -108,21 +108,21 @@ CATEGORIES;TYPE=work;ALTID=84;PID=86;LANGUAGE=kw;PREF=88;AAA=BBB:Category Fo PHOTO;ALTID=70;PID=71;MEDIATYPE=image/png;PREF=72;MEEP=MOO:data:image/png;ba se64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYT AyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg== -PHOTO;ALTID=20;PID=21;MEDIATYPE=image/png;PREF=22;BEEP=BOOP:data:image/png;b - ase64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+o - wkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC -PHOTO;ALTID=90;PID=91;MEDIATYPE=image/png;PREF=92;PHOTO=YUP:data:image/png;b - ase64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApep - sxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII= +PHOTO;TYPE=home;ALTID=20;PID=21;MEDIATYPE=image/png;PREF=22;BEEP=BOOP:data:i + mage/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2N + kYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC +PHOTO;TYPE=work;ALTID=90;PID=91;MEDIATYPE=image/png;PREF=92;PHOTO=YUP:data:i + mage/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2M + Um53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII= LOGO;ALTID=70;PID=71;MEDIATYPE=image/png;PREF=72;MEEP=MOO:data:image/png;bas e64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTA yMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg== -LOGO;ALTID=20;PID=21;MEDIATYPE=image/png;PREF=22;BEEP=BOOP:data:image/png;ba - se64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+ow - kwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC -LOGO;ALTID=90;PID=91;MEDIATYPE=image/png;PREF=92;LOGO=YUP:data:image/png;bas - e64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsx - F4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII= +LOGO;TYPE=home;ALTID=20;PID=21;MEDIATYPE=image/png;PREF=22;BEEP=BOOP:data:im + age/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2Nk + YPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC +LOGO;TYPE=work;ALTID=90;PID=91;MEDIATYPE=image/png;PREF=92;LOGO=YUP:data:ima + ge/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm + 53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII= SOUND;ALTID=4;PID=1;MEDIATYPE=application/ogg;LANGUAGE=kw;PREF=2;MEEP=MOO:da ta:application/ogg;base64,T2dnUwACAAAAAAAAAAAqlr5kAAAAAPjSH5UBHgF2b3JiaXMAA AAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAAKpa+ZAEAAAAJVIuhDzz///////// diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index 3c72c72..bc3f62f 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -17,7 +17,7 @@ // with Xestia Address Book. If not, see #include -#include "../contacteditor/ContactDataObject.h" +#include "../contacteditor/cdo/ContactDataObject.h" TEST(ContactLoad, ContactLoadTests){ @@ -2578,6 +2578,11 @@ TEST(ContactLoad, PhotoTests){ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter); ASSERT_EQ("71", TestFileIter->second); + // Check the TYPE section. + + TestFileIter = TestFile.PicturesListType.find(0); + ASSERT_EQ(TestFile.PicturesListType.end(), TestFileIter); + // Check the MEDIATYPE section. TestFileIter = TestFile.PicturesListMediatype.find(0); @@ -2627,6 +2632,12 @@ TEST(ContactLoad, PhotoTests){ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter); ASSERT_EQ("21", TestFileIter->second); + // Check the TYPE section. + + TestFileIter = TestFile.PicturesListType.find(1); + ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter); + ASSERT_EQ("home", TestFileIter->second); + // Check the MEDIATYPE section. TestFileIter = TestFile.PicturesListMediatype.find(1); @@ -2676,6 +2687,12 @@ TEST(ContactLoad, PhotoTests){ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter); ASSERT_EQ("91", TestFileIter->second); + // Check the TYPE section. + + TestFileIter = TestFile.PicturesListType.find(2); + ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter); + ASSERT_EQ("work", TestFileIter->second); + // Check the MEDIATYPE section. TestFileIter = TestFile.PicturesListMediatype.find(2); @@ -2739,6 +2756,8 @@ TEST(ContactLoad, LogoTests){ ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); ASSERT_EQ("71", TestFileIter->second); + // Check the TYPE section. + // Check the MEDIATYPE section. TestFileIter = TestFile.LogosListMediatype.find(0); @@ -2787,6 +2806,12 @@ TEST(ContactLoad, LogoTests){ TestFileIter = TestFile.LogosListPID.find(1); ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); ASSERT_EQ("21", TestFileIter->second); + + // Check the TYPE section. + + TestFileIter = TestFile.LogosListType.find(1); + ASSERT_NE(TestFile.LogosListType.end(), TestFileIter); + ASSERT_EQ("home", TestFileIter->second); // Check the MEDIATYPE section. @@ -2837,6 +2862,12 @@ TEST(ContactLoad, LogoTests){ ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter); ASSERT_EQ("91", TestFileIter->second); + // Check the TYPE section. + + TestFileIter = TestFile.LogosListType.find(2); + ASSERT_NE(TestFile.LogosListType.end(), TestFileIter); + ASSERT_EQ("work", TestFileIter->second); + // Check the MEDIATYPE section. TestFileIter = TestFile.LogosListMediatype.find(2); -- 2.39.5