Skip to content

Add const qualifier to returned pointers in MockIp and MockResolvedAddress#12573

Merged
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
justin-mp:fix-mock-const-pointers
Aug 10, 2020
Merged

Add const qualifier to returned pointers in MockIp and MockResolvedAddress#12573
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
justin-mp:fix-mock-const-pointers

Conversation

@justin-mp
Copy link
Contributor

@justin-mp justin-mp commented Aug 10, 2020

Compared to their superclasses, the MockIp and MockResolvedAddress
classes drop the const qualifier from the pointers they return.
Since the non-mock class implementing these methods return const
pointers, it’s difficult to use non-mock classes with these mocks
without resorting to hacks like const_cast.

Risk Level: low
Testing: bazel test //test/extensions/filters/network/rocketmq_proxy/... //test/common/network:resolver_test //test/common/router:config_impl_test
Documentation: N/A
Release Notes: N/A

Signed-off-by: Justin Mazzola Paluska justinmp@google.com

…dress

Compared to their superclasses, the MockIp and MockResolvedAddress
classes dropp the const qualifier from the pointers they return.
Since the non-mock class implementing these methods return const
pointers, it’s difficult to use non-mock classes with these mocks
without resorting to hacks like const_cast.

Risk Level: low
Testing: bazel test //test/extensions/filters/network/rocketmq_proxy/... //test/common/network:resolver_test //test/common/router:config_impl_test
Documentation: N/A
Release Notes: N/A

Signed-off-by: Justin Mazzola Paluska <justinmp@google.com>
@justin-mp justin-mp force-pushed the fix-mock-const-pointers branch from 39d1120 to d624949 Compare August 10, 2020 17:15
@mattklein123 mattklein123 merged commit 5200978 into envoyproxy:master Aug 10, 2020
@justin-mp justin-mp deleted the fix-mock-const-pointers branch August 11, 2020 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants