本文整理汇总了C++中VASSERT_EQ函数的典型用法代码示例。如果您正苦于以下问题:C++ VASSERT_EQ函数的具体用法?C++ VASSERT_EQ怎么用?C++ VASSERT_EQ使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VASSERT_EQ函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testIsBodyPartAnAttachment3
// No Content-Disposition field
void testIsBodyPartAnAttachment3()
{
vmime::string data = "Content-Type: application/octet-stream\r\n\r\nFoo\r\n";
vmime::shared_ptr <vmime::bodyPart> p = vmime::make_shared <vmime::bodyPart>();
p->parse(data);
VASSERT_EQ("1", true, vmime::attachmentHelper::isBodyPartAnAttachment(p));
}
示例2: testIsBodyPartAnAttachment1
// Content-Disposition: attachment
// No other field
void testIsBodyPartAnAttachment1()
{
vmime::string data = "Content-Disposition: attachment\r\n\r\nFoo\r\n";
vmime::shared_ptr <vmime::bodyPart> p = vmime::make_shared <vmime::bodyPart>();
p->parse(data);
VASSERT_EQ("1", true, vmime::attachmentHelper::isBodyPartAnAttachment(p));
}
示例3: testRFC1321_5
void testRFC1321_5()
{
INIT_DIGEST(algo, "md5");
algo->update("abcdefghijklmnopqrstuvwxyz");
algo->finalize();
VASSERT_EQ("*", "c3fcd3d76192e4007dfb496cca67e13b", algo->getHexDigest());
}
示例4: testSeparatorInComment
void testSeparatorInComment() {
vmime::addressList addrList;
addrList.parse("aaa(comment,comment)@vmime.org, [email protected]");
VASSERT_EQ("count", 2, addrList.getAddressCount());
vmime::shared_ptr <vmime::mailbox> mbox1 =
vmime::dynamicCast <vmime::mailbox>(addrList.getAddressAt(0));
vmime::shared_ptr <vmime::mailbox> mbox2 =
vmime::dynamicCast <vmime::mailbox>(addrList.getAddressAt(1));
VASSERT_EQ("name1", vmime::text(), mbox1->getName());
VASSERT_EQ("email1", "[email protected]", mbox1->getEmail());
VASSERT_EQ("name2", vmime::text(), mbox2->getName());
VASSERT_EQ("email2", "[email protected]", mbox2->getEmail());
}
示例5: testRFC1321_3
void testRFC1321_3()
{
INIT_DIGEST(algo, "md5");
algo->update("abc");
algo->finalize();
VASSERT_EQ("*", "900150983cd24fb0d6963f7d28e17f72", algo->getHexDigest());
}
示例6: testRFC1321_7
void testRFC1321_7()
{
INIT_DIGEST(algo, "md5");
algo->update("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
algo->finalize();
VASSERT_EQ("*", "57edf4a22be3c955ac49da2e2107b67a", algo->getHexDigest());
}
示例7: testRFC1321_4
void testRFC1321_4()
{
INIT_DIGEST(algo, "md5");
algo->update("message digest");
algo->finalize();
VASSERT_EQ("*", "f96b697d7cb7938d525a2f31aaf161d0", algo->getHexDigest());
}
示例8: testForcedNonEncoding
void testForcedNonEncoding()
{
// Testing long unbreakable and unencodable header
vmime::relay r;
r.parse(" from User (Ee9GMqZQ8t7[email protected][127.0.0.1]) by servername.hostname.com\n\t"
"with esmtp id 1NGTS9-2C0sqG0; Fri, 4 Dec 2009 09:23:49 +0100");
VASSERT_EQ("received.long", "from User\r\n (Ee9GMqZQ8t7[email protected][127.0.0.1])\r\n by servername.hostname.com with esmtp id 1NGTS9-2C0sqG0; Fri, 4 Dec 2009\r\n 09:23:49 +0100", r.generate(78));
}
示例9: testRFC1321_2
void testRFC1321_2()
{
INIT_DIGEST(algo, "md5");
algo->update("a");
algo->finalize();
VASSERT_EQ("*", "0cc175b9c0f1b6a831c399e269772661", algo->getHexDigest());
}
示例10: testCopy
void testCopy()
{
vmime::mediaType t1("type/sub");
VASSERT_EQ("eq1", "type", t1.getType());
VASSERT_EQ("eq2", "sub", t1.getSubType());
VASSERT("operator==", t1 == t1);
VASSERT("clone", t1 == *vmime::clone(t1));
VASSERT_EQ("eq3", "type", vmime::clone(t1)->getType());
VASSERT_EQ("eq4", "sub", vmime::clone(t1)->getSubType());
vmime::mediaType t2;
t2.copyFrom(t1);
VASSERT("copyFrom", t1 == t2);
}
示例11: testFIPS180_2
void testFIPS180_2()
{
INIT_DIGEST(algo, "sha1");
algo->update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
algo->finalize();
VASSERT_EQ("*", "84983e441c3bd26ebaae4aa1f95129e5e54670f1", algo->getHexDigest());
}
示例12: testCountASCIIChars
void testCountASCIIChars()
{
vmime::string str1("foo");
VASSERT_EQ("1", static_cast <vmime::string::size_type>(3),
stringUtils::countASCIIchars(str1.begin(), str1.end()));
vmime::string str2("f=?oo");
VASSERT_EQ("2", static_cast <vmime::string::size_type>(3 + 1),
stringUtils::countASCIIchars(str2.begin(), str2.end()));
vmime::string str3("foo\x7f");
VASSERT_EQ("3", static_cast <vmime::string::size_type>(4),
stringUtils::countASCIIchars(str3.begin(), str3.end()));
vmime::string str4("foo\x80");
VASSERT_EQ("4", static_cast <vmime::string::size_type>(3),
stringUtils::countASCIIchars(str4.begin(), str4.end()));
}
示例13: testUpdate1
void testUpdate1()
{
INIT_DIGEST(algo, "md5");
algo->update("");
algo->finalize();
VASSERT_EQ("*", "d41d8cd98f00b204e9800998ecf8427e", algo->getHexDigest());
}
示例14: testRFC1321_6
void testRFC1321_6()
{
INIT_DIGEST(algo, "md5");
algo->update("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
algo->finalize();
VASSERT_EQ("*", "d174ab98d277d9f5a5611c2c9f419d9f", algo->getHexDigest());
}
示例15: testGetBodyPartAttachmentMessage
void testGetBodyPartAttachmentMessage()
{
const vmime::string data =
"Subject: Test message\r\n"
"Content-Type: multipart/mixed; boundary=\"foo\"\r\n"
"\r\n"
"--foo\r\n"
"Content-Type: message/rfc822\r\n"
"\r\n"
"Subject: Attached message\r\n"
"\r\n"
"Attached message body\r\n"
"--foo\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"FooBar\r\n"
"--foo--\r\n";
std::shared_ptr<vmime::message> msg =
vmime::factory<vmime::message>::create();
msg->parse(data);
VASSERT_EQ("0", 2, msg->getBody()->getPartCount());
std::shared_ptr<const vmime::attachment> att = vmime::attachmentHelper::
getBodyPartAttachment(msg->getBody()->getPartAt(0));
VASSERT("1", att != NULL);
std::shared_ptr<const vmime::messageAttachment> msgAtt =
// att.dynamicCast <const vmime::messageAttachment>(); TODO shared
std::dynamic_pointer_cast<const vmime::messageAttachment>(att);
VASSERT("2", msgAtt != NULL);
std::shared_ptr<vmime::message> amsg = msgAtt->getMessage();
std::shared_ptr<vmime::header> hdr = amsg->getHeader();
// VASSERT_EQ("3", "Attached message",
// hdr->Subject()->getValue().dynamicCast
// <vmime::text>()->generate()); TODO shared
VASSERT_EQ("3", "Attached message", std::dynamic_pointer_cast<vmime::text>(hdr->Subject()->getValue())->generate());
VASSERT_EQ("4", "Attached message body", extractBodyContents(amsg));
}