Commit eb369a38 authored by Ben Rejeb Iyed's avatar Ben Rejeb Iyed

fixes

parent 88bed954
......@@ -93,7 +93,7 @@ static void create_vcard_from_api(void) {
belCard->setFullName(fn);
BC_ASSERT_TRUE(belCard->assertRFCCompliance());
BC_ASSERT_STRING_EQUAL(belCard->getFullName()->toString().c_str(), fn->toString().c_str());
fn = BelCard::create<BelCardFullName>();
fn->setValue("Belcard Tester");
belCard->setFullName(fn);
......@@ -126,10 +126,10 @@ static void property_sort_using_pref_param(void) {
BC_ASSERT_EQUAL((unsigned int)imppList.size(), 2, unsigned int, "%u");
BC_ASSERT_TRUE(imppList.front() == impp2);
BC_ASSERT_TRUE(imppList.back() == impp1);
const list<shared_ptr<BelCardProperty>> propertiesList = belCard->getProperties();
BC_ASSERT_EQUAL((unsigned int)propertiesList.size(), 2, unsigned int, "%u");
belCard->removeImpp(impp1);
BC_ASSERT_EQUAL((unsigned int)belCard->getImpp().size(), 1, unsigned int, "%u");
BC_ASSERT_EQUAL((unsigned int)belCard->getProperties().size(), 1, unsigned int, "%u");
......@@ -139,12 +139,15 @@ static void vcard_parsing_serialized(void) {
string vcard = openFile("vcards/vcard.vcf");
remove("vcardGrammarDump.bin");
string fileName = "vcardGrammarDump.bin";
string grammarDump = bc_tester_file("grammarDump.bin");
remove(grammarDump.c_str());
belr::ABNFGrammarBuilder grammar_builder;
shared_ptr<belr::Grammar> grammar = grammar_builder.createFromAbnf((const char*)vcard_grammar, make_shared<belr::CoreRules>());
grammar->createGrammarDump(fileName);
BelCardParser *parser = new BelCardParser("vcardGrammarDump.bin");
BelCardParser *parser = new BelCardParser(grammarDump);
remove(grammarDump.c_str());
shared_ptr<BelCard> belCard = parser->parseOne(vcard);
if (!BC_ASSERT_TRUE(belCard!=NULL)) return;
......
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