Commit 8f0a5c78 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added more test cases

parent f6aea78f
......@@ -48,10 +48,18 @@ static void bday_property(void) {
stringstream sstream;
sstream << *bday;
BC_ASSERT_EQUAL(input.compare(sstream.str()), 0, int, "%d");
input = "BDAY;VALUE=text:1er Octobre 1989\r\n";
bday = BelCardBirthday::parse(input);
BC_ASSERT_TRUE_FATAL(bday != NULL);
sstream.clear();
sstream.str(std::string());
sstream << *bday;
BC_ASSERT_EQUAL(input.compare(sstream.str()), 0, int, "%d");
}
static void anniversary_property(void) {
string input = "ANNIVERSARY:20140621\r\n";
string input = "ANNIVERSARY;VALUE=date-and-or-time:20140621\r\n";
shared_ptr<BelCardAnniversary> anniversary = BelCardAnniversary::parse(input);
BC_ASSERT_TRUE_FATAL(anniversary != NULL);
stringstream sstream;
......@@ -66,10 +74,18 @@ static void gender_property(void) {
stringstream sstream;
sstream << *gender;
BC_ASSERT_EQUAL(input.compare(sstream.str()), 0, int, "%d");
input = "GENDER:F;just kidding\r\n";
gender = BelCardGender::parse(input);
BC_ASSERT_TRUE_FATAL(gender != NULL);
sstream.clear();
sstream.str(std::string());
sstream << *gender;
BC_ASSERT_EQUAL(input.compare(sstream.str()), 0, int, "%d");
}
static void photo_property(void) {
string input = "PHOTO;VALUE=URL;MEDIATYPE=image/png:http://www.belledonne-communications.com/uploads/images/belledonne-communications.png\r\n";
string input = "PHOTO;TYPE=work;VALUE=URL;MEDIATYPE=image/png:http://www.belledonne-communications.com/uploads/images/belledonne-communications.png\r\n";
shared_ptr<BelCardPhoto> photo = BelCardPhoto::parse(input);
BC_ASSERT_TRUE_FATAL(photo != NULL);
stringstream sstream;
......@@ -79,8 +95,8 @@ static void photo_property(void) {
input = "PHOTO:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH3wkYDSo4+LD+v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MewUHJtY25w/DuVlO2TChT9eOWfnomQZN7TtpcwTtl29eEy3TGiLe7d/Ux4eLYISflGj9p5Brnq2g0Mi2MhB5Gow0jeyCx+3wmua4caVHdecPOOO/UMFUlaJFM7/w5slvyvVFDFvDOzdbXt56NXu0XBkZAQWoNwIWc9grYLqdXxz+TFhP/SO4+i2/Isv7t762z29Sys9Q71nGAwtP1/ZxLK6KuJGiFTZn85yy+ZOako1x6AR7mtpYmZFHBEhF1o2bE9x55sHwTNg3TOsaV710WxCH3zZY0p8M55ZFjdCvSdUilBxtAITQVC8ktKqEKkSKhRQhq3Sbx0HrBbfjnXPIHyW1c360W7z17ffhpG7xBPKjaHWCBUCcRE8kRE/U4rAxTgLh50j4xQ96garm9d9jF9+2hoR8zsMZ1NSNyFCIKPpMwJyChktKaqqONpw7grWLu8dz23NuIGRfaw+ZxlWawjdY2Hk3GBktTe0HIwcByNHb2gZiqy60IVY9xMincLqc1oQ6R33XY/bZ8XvPi/UV87EUA1SKsM0h6PvWOl20iZt0ibt/9j+CXhStzl5GgtiAAAAAElFTkSuQmCC\r\n";
photo = BelCardPhoto::parse(input);
BC_ASSERT_TRUE_FATAL(photo != NULL);
sstream.str(std::string());
sstream.clear();
sstream.str(std::string());
sstream << *photo;
BC_ASSERT_EQUAL(input.compare(sstream.str()), 0, int, "%d");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment