Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/common/common/interval_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ template <typename T, typename Interval> class ClosedIntervalValue {
// Returns a value that is as far from max as the original value is from min.
// This guarantees that max().invert() == min() and min().invert() == max().
ClosedIntervalValue invert() const {
return ClosedIntervalValue(value_ == Interval::max_value
? Interval::min_value
: value_ == Interval::min_value
? Interval::max_value
: Interval::max_value - (value_ - Interval::min_value));
return ClosedIntervalValue(value_ == Interval::max_value ? Interval::min_value
: value_ == Interval::min_value
? Interval::max_value
: Interval::max_value - (value_ - Interval::min_value));
}

// Comparisons are performed using the same operators on the underlying value
Expand Down
11 changes: 5 additions & 6 deletions source/common/local_reply/local_reply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ class BodyFormatter {
BodyFormatter(const envoy::config::core::v3::SubstitutionFormatString& config, Api::Api& api)
: formatter_(Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config, api)),
content_type_(
!config.content_type().empty()
? config.content_type()
: config.format_case() ==
envoy::config::core::v3::SubstitutionFormatString::FormatCase::kJsonFormat
? Http::Headers::get().ContentTypeValues.Json
: Http::Headers::get().ContentTypeValues.Text) {}
!config.content_type().empty() ? config.content_type()
: config.format_case() ==
envoy::config::core::v3::SubstitutionFormatString::FormatCase::kJsonFormat
? Http::Headers::get().ContentTypeValues.Json
: Http::Headers::get().ContentTypeValues.Text) {}

void format(const Http::RequestHeaderMap& request_headers,
const Http::ResponseHeaderMap& response_headers,
Expand Down
16 changes: 8 additions & 8 deletions test/common/network/apple_dns_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ TEST_F(AppleDnsImplFakeApiTest, SynchronousErrorInGetAddrInfo) {
// The Query's sd ref will be deallocated.
EXPECT_CALL(dns_service_, dnsServiceRefDeallocate(_));

EXPECT_EQ(nullptr, resolver_->resolve(
"foo.com", Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse> &&) -> void {
// This callback should never be executed.
FAIL();
}));
EXPECT_EQ(nullptr,
resolver_->resolve("foo.com", Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void {
// This callback should never be executed.
FAIL();
}));
}

TEST_F(AppleDnsImplFakeApiTest, QuerySynchronousCompletion) {
Expand Down Expand Up @@ -428,7 +428,7 @@ TEST_F(AppleDnsImplFakeApiTest, IncorrectInterfaceIndexReturned) {

resolver_->resolve(
hostname, Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse> &&) -> void { FAIL(); });
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void { FAIL(); });
}

TEST_F(AppleDnsImplFakeApiTest, QueryCompletedWithError) {
Expand Down Expand Up @@ -785,7 +785,7 @@ TEST_F(AppleDnsImplFakeApiTest, ResultWithNullAddress) {

auto query = resolver_->resolve(
hostname, Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse> &&) -> void { FAIL(); });
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void { FAIL(); });
ASSERT_NE(nullptr, query);

EXPECT_DEATH(reply_callback(nullptr, kDNSServiceFlagsAdd, 0, kDNSServiceErr_NoError,
Expand Down
6 changes: 3 additions & 3 deletions test/test_common/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ std::string TestEnvironment::temporaryFileSubstitute(const std::string& path,
out_json_string = substitute(out_json_string, version);

auto name = Filesystem::fileSystemForTest().splitPathFromFilename(path).file_;
const std::string extension = absl::EndsWith(name, ".yaml")
? ".yaml"
: absl::EndsWith(name, ".pb_text") ? ".pb_text" : ".json";
const std::string extension = absl::EndsWith(name, ".yaml") ? ".yaml"
: absl::EndsWith(name, ".pb_text") ? ".pb_text"
: ".json";
const std::string out_json_path =
TestEnvironment::temporaryPath(name) + ".with.ports" + extension;
{
Expand Down