本文整理汇总了C++中Address::country_code方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::country_code方法的具体用法?C++ Address::country_code怎么用?C++ Address::country_code使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::country_code方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MacAddress
TEST(Address, ctor) {
Address a;
EXPECT_FALSE(a.is_manually_configured());
EXPECT_EQ(a.mid(), MacAddress());
EXPECT_EQ(a.station_type(), StationType::UNKNOWN);
EXPECT_EQ(a.country_code(), 0);
}
示例2:
TEST_F(LocationTableTest, has_entry) {
Address a;
a.mid({1, 2, 3, 4, 5, 6});
EXPECT_FALSE(loct->has_entry(a));
LongPositionVector pv;
pv.gn_addr = a;
loct->update(pv);
EXPECT_TRUE(loct->has_entry(a));
// only MID of GN_ADDR should be used for look-up
a.country_code(42);
EXPECT_TRUE(loct->has_entry(a));
a.mid({0, 2, 3, 4, 5, 6});
EXPECT_FALSE(loct->has_entry(a));
}
示例3: b
TEST(Address, equality) {
Address a;
Address b({0x01, 0x02, 0x03, 0x04, 0x05, 0x06});
EXPECT_NE(a, b);
Address c = b;
EXPECT_EQ(b, c);
c.is_manually_configured(true);
EXPECT_NE(b, c);
Address d = c;
EXPECT_EQ(c, d);
d.station_type(StationType::PASSENGER_CAR);
EXPECT_NE(c, d);
Address e = d;
EXPECT_EQ(d, e);
e.country_code(8);
EXPECT_NE(d, e);
a.mid(b.mid());
EXPECT_EQ(a, b);
}