本文整理汇总了C++中testing::ContainerEq方法的典型用法代码示例。如果您正苦于以下问题:C++ testing::ContainerEq方法的具体用法?C++ testing::ContainerEq怎么用?C++ testing::ContainerEq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testing
的用法示例。
在下文中一共展示了testing::ContainerEq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ContainerEq
TEST_F(IRCSockTest, ISupport) {
MCString m1 = {
{"CHANTYPES", "#"}, {"EXCEPTS", ""},
{"INVEX", ""}, {"CHANMODES", "eIbq,k,flj,CFLMPQScgimnprstz"},
{"CHANLIMIT", "#:120"}, {"PREFIX", "(ov)@+"},
{"MAXLIST", "bqeI:100"}, {"MODES", "4"},
{"NETWORK", "znc"}, {"KNOCK", ""},
{"STATUSMSG", "@+"}, {"CALLERID", "g"},
};
m_pTestSock->ReadLine(
":irc.znc.in 005 user CHANTYPES=# EXCEPTS INVEX "
"CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ "
"MAXLIST=bqeI:100 MODES=4 NETWORK=znc KNOCK [email protected]+ CALLERID=g "
":are supported by this server");
EXPECT_THAT(m_pTestSock->GetISupport(), ContainerEq(m1));
for (const auto& it : m1) {
EXPECT_EQ(m_pTestSock->GetISupport(it.first), it.second);
}
MCString m2 = {
{"CASEMAPPING", "rfc1459"},
{"CHARSET", "ascii"},
{"NICKLEN", "16"},
{"CHANNELLEN", "50"},
{"TOPICLEN", "390"},
{"ETRACE", ""},
{"CPRIVMSG", ""},
{"CNOTICE", ""},
{"DEAF", "D"},
{"MONITOR", "100"},
{"FNC", ""},
{"TARGMAX",
"NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR:"},
};
MCString m12;
std::merge(m1.begin(), m1.end(), m2.begin(), m2.end(),
std::inserter(m12, m12.begin()));
m_pTestSock->ReadLine(
":server 005 user CASEMAPPING=rfc1459 CHARSET=ascii NICKLEN=16 "
"CHANNELLEN=50 TOPICLEN=390 ETRACE CPRIVMSG CNOTICE DEAF=D MONITOR=100 "
"FNC "
"TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,"
"MONITOR: :are supported by this server");
EXPECT_THAT(m_pTestSock->GetISupport(), ContainerEq(m12));
for (const auto& it : m2) {
EXPECT_EQ(m_pTestSock->GetISupport(it.first), it.second);
}
MCString m3 = {
{"EXTBAN", "$,ajrxz"}, {"WHOX", ""}, {"CLIENTVER", "3.0"},
{"SAFELIST", ""}, {"ELIST", "CTU"},
};
MCString m123;
std::merge(m12.begin(), m12.end(), m3.begin(), m3.end(),
std::inserter(m123, m123.begin()));
m_pTestSock->ReadLine(
":server 005 zzzzzz EXTBAN=$,ajrxz WHOX CLIENTVER=3.0 SAFELIST "
"ELIST=CTU :are supported by this server");
EXPECT_THAT(m_pTestSock->GetISupport(), ContainerEq(m123));
for (const auto& it : m3) {
EXPECT_EQ(m_pTestSock->GetISupport(it.first), it.second);
}
EXPECT_EQ(m_pTestSock->GetISupport("FOOBAR", "default"), "default");
EXPECT_EQ(m_pTestSock->GetISupport("CLIENTVER", "default"), "3.0");
EXPECT_EQ(m_pTestSock->GetISupport("SAFELIST", "default"), "");
}