mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Use the using declarations from ::testing
PiperOrigin-RevId: 423042437 Change-Id: I9ddfacd597c65d3dc6e490201cce4b00678f18cf
This commit is contained in:
parent
4a945a1748
commit
4041fe824b
|
@ -75,55 +75,48 @@ TEST(FilteringTest, Basic) {
|
||||||
EXPECT_THAT(allowed_hosts.AllowIPv6("0:5678:0:0:0:0:0:0/46", 70), IsOk());
|
EXPECT_THAT(allowed_hosts.AllowIPv6("0:5678:0:0:0:0:0:0/46", 70), IsOk());
|
||||||
|
|
||||||
// IPv4 tests
|
// IPv4 tests
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.0.0.3")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.0.0.3")), IsFalse());
|
||||||
testing::IsFalse());
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.1")), IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.1")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.2")), IsFalse());
|
||||||
testing::IsTrue());
|
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.2")),
|
|
||||||
testing::IsFalse());
|
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.2", 33)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("127.0.0.2", 33)),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("120.120.120.255")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("120.120.120.255")),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("120.120.121.120")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("120.120.121.120")),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.128.130", 1000)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.128.130", 1000)),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.132.134", 1000)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.132.134", 1000)),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.128.130", 1001)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("130.130.128.130", 1001)),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("140.0.140.140")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("140.0.140.140")),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("141.140.140.140")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("141.140.140.140")),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("150.182.150.150", 123)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("150.182.150.150", 123)),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("150.214.150.150", 123)),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv4("150.214.150.150", 123)),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
|
|
||||||
// IPv6 tests
|
// IPv6 tests
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::3")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::3")), IsFalse());
|
||||||
testing::IsFalse());
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::2")), IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::2")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::1")), IsTrue());
|
||||||
testing::IsTrue());
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::1", 81)), IsFalse());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::1")),
|
|
||||||
testing::IsTrue());
|
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("::1", 81)),
|
|
||||||
testing::IsFalse());
|
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("0:1234:ffff:0:0:0:0:0")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("0:1234:ffff:0:0:0:0:0")),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("0:1233:0000:0:0:0:0:0")),
|
EXPECT_THAT(allowed_hosts.IsHostAllowed(PrepareIpv6("0:1233:0000:0:0:0:0:0")),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0002:0:0:0:0:0", 70)),
|
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0002:0:0:0:0:0", 70)),
|
||||||
testing::IsTrue());
|
IsTrue());
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0004:0:0:0:0:0", 70)),
|
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0004:0:0:0:0:0", 70)),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0000:0:0:0:0:0", 2222)),
|
allowed_hosts.IsHostAllowed(PrepareIpv6("0:5678:0000:0:0:0:0:0", 2222)),
|
||||||
testing::IsFalse());
|
IsFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue
Block a user