src/base/channel_addr.test.cc
/* Ensure that range bounds are inclusive */
Ensure that range bounds are inclusive
Ensure that range bounds are inclusive
TEST(ChannelAddrRange, Range)
{
    ChannelAddrRange range(ChannelAddr(1), ChannelAddr(4));
    EXPECT_FALSE(range.contains(ChannelAddr(0)));
    EXPECT_TRUE(range.contains(ChannelAddr(1)));
    EXPECT_TRUE(range.contains(ChannelAddr(2)));
    EXPECT_TRUE(range.contains(ChannelAddr(3)));
    EXPECT_FALSE(range.contains(ChannelAddr(4)));
    EXPECT_EQ(range.start(), ChannelAddr(1));
    EXPECT_EQ(range.end(), ChannelAddr(4));
    EXPECT_EQ(range.size(), ChannelAddr(3));
}
TEST ( ChannelAddrRange , Range ) { ChannelAddrRange range ( ChannelAddr ( 1 ) , ChannelAddr ( 4 ) ) ; EXPECT_FALSE ( range . contains ( ChannelAddr ( 0 ) ) ) ; EXPECT_TRUE ( range . contains ( ChannelAddr ( 1 ) ) ) ; EXPECT_TRUE ( range . contains ( ChannelAddr ( 2 ) ) ) ; EXPECT_TRUE ( range . contains ( ChannelAddr ( 3 ) ) ) ; EXPECT_FALSE ( range . contains ( ChannelAddr ( 4 ) ) ) ; EXPECT_EQ ( range . start ( ) , ChannelAddr ( 1 ) ) ; EXPECT_EQ ( range . end ( ) , ChannelAddr ( 4 ) ) ; EXPECT_EQ ( range . size ( ) , ChannelAddr ( 3 ) ) ; }
Ensure that range bounds are inclusive
Ensure that range bounds are inclusive