本文整理汇总了C++中testing::ElementsAre方法的典型用法代码示例。如果您正苦于以下问题:C++ testing::ElementsAre方法的具体用法?C++ testing::ElementsAre怎么用?C++ testing::ElementsAre使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testing
的用法示例。
在下文中一共展示了testing::ElementsAre方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg
TEST_F(IRCSockTest, OnTextMessage) {
CMessage msg(":nick PRIVMSG #chan :hello");
m_pTestModule->eAction = CModule::HALT;
m_pTestSock->ReadLine(msg.ToString());
EXPECT_THAT(m_pTestModule->vsHooks, ElementsAre("OnChanTextMessage"));
EXPECT_THAT(m_pTestModule->vsMessages, ElementsAre(msg.ToString()));
EXPECT_THAT(m_pTestModule->vNetworks, ElementsAre(m_pTestNetwork));
EXPECT_THAT(m_pTestModule->vChannels, ElementsAre(m_pTestChan));
EXPECT_THAT(m_pTestClient->vsLines, IsEmpty()); // halt
m_pTestModule->eAction = CModule::CONTINUE;
m_pTestSock->ReadLine(msg.ToString());
EXPECT_THAT(m_pTestClient->vsLines, ElementsAre(msg.ToString()));
m_pTestClient->Reset();
m_pTestModule->Reset();
msg.Parse(":nick PRIVMSG me :hello");
m_pTestModule->eAction = CModule::HALT;
m_pTestSock->ReadLine(msg.ToString());
EXPECT_THAT(m_pTestModule->vsHooks, ElementsAre("OnPrivTextMessage"));
EXPECT_THAT(m_pTestModule->vsMessages, ElementsAre(msg.ToString()));
EXPECT_THAT(m_pTestModule->vNetworks, ElementsAre(m_pTestNetwork));
EXPECT_THAT(m_pTestModule->vChannels, ElementsAre(nullptr));
EXPECT_THAT(m_pTestClient->vsLines, IsEmpty()); // halt
m_pTestModule->eAction = CModule::CONTINUE;
m_pTestSock->ReadLine(msg.ToString());
EXPECT_THAT(m_pTestClient->vsLines, ElementsAre(msg.ToString()));
}
示例2: Loc
TEST_F(CandidateCacheFixture, NeedsFillingForward) {
Loc l1 = Loc(1,1);
Loc l2 = Loc(2,2);
Loc l3 = Loc(3,3);
Loc l4 = Loc(4,4);
Loc l5 = Loc(5,5);
Loc l6 = Loc(6,6);
Loc *locs0 = cc.getBuffer(0);
BD(cout << "Before: " << locs0[0]._value << endl);
locs0[0] = l1;
locs0[1] = l2;
locs0[2] = l3;
BD(cout << "After: " << locs0[0]._value << endl);
cc.setDepthMoves(0,3);
Loc *locs1 = cc.getBuffer(1);
locs1[0] = l4;
locs1[1] = l5;
locs1[2] = l6;
cc.setDepthMoves(1,3);
vector<Loc> res_locs1 = getMoves(1);
ASSERT_THAT(res_locs1, ElementsAre(l4,l5,l6));
vector<Loc> res_locs0 = getMoves(0);
ASSERT_THAT(res_locs0, ElementsAre(l1,l2,l3));
vector<Loc> res_locs0_again = getMoves(0);
ASSERT_THAT(res_locs0_again, ElementsAre());
}
示例3: WhenSorted
TEST(ReaderTest, readAllAndLinkChildren)
{
typedef vector<Feature>::iterator Feature_iter;
std::stringstream data;
data << "Chr\t.\tgene\t20\t30\t0\t+\t0\tID=one" << std::endl;
data << "Chr\t.\tgene\t20\t30\t0\t+\t0\tID=two;Parent=one;" << std::endl;
data << "Chr\t.\tgene\t20\t30\t0\t+\t0\tID=three;Parent=one;" << std::endl;
vector<Feature> ret;
Reader::readAllAndLinkChildren(data, ret);
EXPECT_EQ(3, ret.size());
Feature d = ret.at(0);
vector<string> IDs;
for (Feature_iter it = d.children.begin(); it != d.children.end(); ++it)
{
string ID = "";
it->attributes.get("ID", ID);
IDs.push_back(ID);
}
EXPECT_THAT(IDs, WhenSorted(ElementsAre("three", "two")));
EXPECT_EQ(0, ret.at(1).children.size());
EXPECT_EQ(0, ret.at(2).children.size());
}
示例4: ElementsAre
TEST(AttributesTest, funky_attribute_def)
{
vector<string> v;
Attributes a;
a.addFromGFF("foo=1;foo=2");
EXPECT_TRUE(a.all("foo", v));
EXPECT_THAT(v, ElementsAre("1", "2"));
}
示例5: WriteRead
TEST_F(AntennaMiniportTest, TestAntennaTemperatureFailure)
{
EXPECT_CALL(i2c, WriteRead(ANTENNA_PRIMARY_CHANNEL, ElementsAre(QueryTemperature), _)).WillOnce(Return(I2CResult::Nack));
uint16_t response;
const auto status = miniport.GetTemperature(&miniport, &i2c, ANTENNA_PRIMARY_CHANNEL, &response);
ASSERT_THAT(status, Ne(OSResult::Success));
ASSERT_THAT(response, Eq(0u));
}
示例6: I
TEST(MemIndexTest, MemIndexDeduplicate) {
std::vector<Symbol> Symbols = {symbol("1"), symbol("2"), symbol("3"),
symbol("2") /* duplicate */};
FuzzyFindRequest Req;
Req.Query = "2";
MemIndex I(Symbols, RefSlab());
EXPECT_THAT(match(I, Req), ElementsAre("2"));
}
示例7: ElementsAre
TEST_F(XPathParserTest, parses_child_with_same_name_as_an_axis)
{
tokens.add(XPathToken("self"));
auto expr = parser->parse();
auto self = add_child(top_node, "self");
ASSERT_THAT(evaluate_on(expr, top_node).nodeset(), ElementsAre(self));
}
示例8: deabbrv
TEST_F(XPathTokenDeabbreviatorTest, converts_at_sign_to_attribute_axis)
{
tokenizer.add(XPathTokenType::AtSign);
XPathTokenDeabbreviator deabbrv(tokenizer);
ASSERT_THAT(all_tokens(deabbrv), ElementsAre(XPathToken("attribute"),
XPathToken(XPathTokenType::DoubleColon)));
}
示例9: compile
TEST_F(XPathAcceptanceTest, self_axis_selects_self)
{
Element *one = doc.new_element("one");
XPath xpath = compile("self::one");
Nodeset selected_nodes = one->select_nodes(xpath);
ASSERT_THAT(selected_nodes, ElementsAre(one));
}