test-utillity: Remove test-utility wrapper for Buffer::toString().#3736
Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom Jun 27, 2018
Merged
Conversation
For reasons I don't understand, the removed TestUtility::bufferToString took a const Buffer::OwnedImpl& argument, but many of its call-sites only had the interface, Buffer::Instance&, and that call seemed to work. Now when I just replace those with buffer->toString(), I got the expected compile-time failure, until I added Buffer::toString() as a new interface. IMO this is defensible: it's nice to have a simple read-only observer for this abstract type. Signed-off-by: Joshua Marantz <jmarantz@google.com>
htuch
previously approved these changes
Jun 26, 2018
Member
|
@jmarantz the ASAN/TSAN failures look like legitimate build issues, can you take a look? |
Contributor
Author
|
Yeah the problem is the echo2 integration test that is not in the same
repo. I could probably fix that first since the new method already works
at head.
…On Tue, Jun 26, 2018, 5:19 PM htuch ***@***.***> wrote:
@jmarantz <https://github.com/jmarantz> the ASAN/TSAN failures look like
legitimate build issues, can you take a look?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3736 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2kPXsgaKJqK-zVBI-kCuGKUKdIOw0vks5uAqVGgaJpZM4U4mmX>
.
|
Contributor
Author
|
issue should be resolved in envoyproxy/envoy-filter-example#51 |
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
mattklein123
approved these changes
Jun 27, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Joshua Marantz jmarantz@google.com
Description: Follow-up to #3629 to eliminate intermediate test-util API bufferToString() and change all the call-sites to call buffer->toString() directly.
Due to Buffer::OwnedImpl's implicit constructor from Buffer:Instance,
it worked for TestUtility::bufferToString to take a const Buffer::OwnedImpl&
argument, even though many of its call-sites only
had the interface, Buffer::Instance&. In the context of the call to a static method
with a known argument type, the implict ctor is applied by the compiler to do the
type conversion.
However that doesn't work when simplify dereferencing a Buffer::Instance and
calling toString() on it. The simplest approach to resolution is to add
Buffer::Instance::toString(). IMO this is defensible: it's nice to have a simple
read-only observer for this abstract type.
Risk Level: Low
Testing: //test/...
Docs Changes: N/A
Release Notes: N/A