From 0a415669d5de48a0014a01488060d895da00c6c2 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 6 Jan 2016 23:08:06 +0000 Subject: [PATCH] Refined tests and data for IMPP. --- source/tests/LoadCheck-Load4.vcf | 8 ++++---- source/tests/xestiaab_contactload.h | 30 ++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/source/tests/LoadCheck-Load4.vcf b/source/tests/LoadCheck-Load4.vcf index 1b0b0d7..6d312ce 100644 --- a/source/tests/LoadCheck-Load4.vcf +++ b/source/tests/LoadCheck-Load4.vcf @@ -53,12 +53,12 @@ ADR;TYPE=work;LABEL="7 Flyby Drive\nElaine\nCornwall\nPL84 9YE\nCornwall\nUn EMAIL;ALTID=10;PID=20;PREF=40;WONDERFUL=Colour:moo@example.com EMAIL;TYPE=home;ALTID=5;PID=10;PREF=20;PEACE=quiet:moo.home@example.com EMAIL;TYPE=work;ALTID=1;PID=2;PREF=3;BUSINESS=Money:moo.business@example.com -IMPP;ALTID=10;PID=20;MEDIATYPE=text/plain;PREF=40;WONDERFUL=Colour:moo@examp - le.com +IMPP;ALTID=10;PID=20;MEDIATYPE=text/plain;PREF=40;WONDERFUL=Colour:skype:moo + @example.com IMPP;TYPE=home;ALTID=20;PID=40;PREF=80;MEDIATYPE=text/reallyplain;PEACE=quie - t:moo.home@example.com + t:msn:moo.home@example.com IMPP;TYPE=work;ALTID=98;PID=99;PREF=50;MEDIATYPE=text/superplain;BUSINESS=Mo - ney:moo.business@example.com + ney:xmpp:moo.business@example.com TEL;ALTID=10;PID=20;PREF=40;WONDERFUL=Colour;TYPE="fax,cell":tel:00000000 TEL;TYPE="home,fax";ALTID=10;PID=20;PREF=40;BUSINESS=Money:tel:00001111 TEL;TYPE="work,voice";ALTID=25;PID=50;PREF=75;BEEP=Boop:tel:22221111 diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index bc3f62f..3d12c8d 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -1237,13 +1237,19 @@ TEST(ContactLoad, TelephoneTests){ TestFileIter = TestFile.GeneralTelephoneList.find(0); ASSERT_NE(TestFile.GeneralTelephoneList.end(), TestFileIter); - ASSERT_EQ("tel:00000000", TestFileIter->second); + ASSERT_EQ("00000000", TestFileIter->second); + + // Check the data type section. + + TestFileIter = TestFile.GeneralTelephoneListDataType.find(0); + ASSERT_NE(TestFile.GeneralTelephoneListDataType.end(), TestFileIter); + ASSERT_EQ("tel", TestFileIter->second); // Check the type section. TestFileIter = TestFile.GeneralTelephoneListTypeInfo.find(0); ASSERT_NE(TestFile.GeneralTelephoneListTypeInfo.end(), TestFileIter); - ASSERT_EQ("fax,mobile", TestFileIter->second); + ASSERT_EQ("fax,cell", TestFileIter->second.ToStdString()); // Check the ALTID section. @@ -1273,7 +1279,13 @@ TEST(ContactLoad, TelephoneTests){ TestFileIter = TestFile.HomeTelephoneList.find(1); ASSERT_NE(TestFile.HomeTelephoneList.end(), TestFileIter); - ASSERT_EQ("tel:00001111", TestFileIter->second); + ASSERT_EQ("00001111", TestFileIter->second); + + // Check the data type section. + + TestFileIter = TestFile.HomeTelephoneListDataType.find(1); + ASSERT_NE(TestFile.HomeTelephoneListDataType.end(), TestFileIter); + ASSERT_EQ("tel", TestFileIter->second); // Check the type section. @@ -1309,7 +1321,13 @@ TEST(ContactLoad, TelephoneTests){ TestFileIter = TestFile.BusinessTelephoneList.find(2); ASSERT_NE(TestFile.BusinessTelephoneList.end(), TestFileIter); - ASSERT_EQ("tel:22221111", TestFileIter->second); + ASSERT_EQ("22221111", TestFileIter->second); + + // Check the data type section. + + TestFileIter = TestFile.BusinessTelephoneListDataType.find(2); + ASSERT_NE(TestFile.BusinessTelephoneListDataType.end(), TestFileIter); + ASSERT_EQ("tel", TestFileIter->second); // Check the type section. @@ -4298,6 +4316,4 @@ TEST(ContactLoad, XTokenTest){ ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter); ASSERT_EQ("FOODS;STATUS=FAVOURITE;TYPE=CHEESEANDONION", TestFileIter->second.ToStdString()); -} - -// TODO: Add tests for the Contact Loading process. \ No newline at end of file +} \ No newline at end of file -- 2.39.5