-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: MockSession example and default allocator [172764384] #154
Conversation
@@ -492,7 +492,7 @@ | |||
// // Next we expect a call to 'openQueue' to open the queue. | |||
// bmqa::OpenQueueStatus result = mockSession.openQueueSync(&queueId, | |||
// uri, | |||
// 10); | |||
// flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was caused by this line. We have set expected flags == 2
(READER
) here:
blazingmq/src/groups/bmq/bmqa/bmqa_mocksession.h
Lines 431 to 434 in 5ca3a4a
// // Initialize the queue flags for a consumer | |
// bsls::Types::Uint64 flags = 0; | |
// bmqt::QueueFlagsUtil::setReader(&flags); | |
// |
And now we try to open queue with flags READER | ACK
implPtr = EventImplSp(new (*allocator) | ||
bmqimp::Event(g_bufferFactory_p, allocator), | ||
allocator); | ||
implPtr = EventImplSp(new (*alloc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed some places where new
was called with allocator pointer not wrapped with bslma::Default::allocator
. These places were causing crashes when allocator = 0
passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two independent changes, right? bslma::Default::allocator
and avoiding the hardcoded value for flags
.
LGTM
5ca3a4a
to
62de9f8
Compare
@pniedzielski re-run clang-format |
@678098 on src/groups/bmq/bmqa/bmqa_mocksession.cpp as well :) |
I formatted it with clang-format 16.0.6 and it makes a different formatting from CI |
llvm/llvm-project#54703 |
Signed-off-by: Evgeny Malygin <[email protected]>
62de9f8
to
b04e79c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a failure in the CI that doesn't appear to have to do with this PR (it's failing on main
as well, and doesn't appear on local builds). This PR is good to go, but we'll investigate that issue separately.
14NOV2023_17:13:53.982763 48988 8674795648 ERROR ~/blazingmq/src/groups/bmq/bmqa/bmqa_mocksession.cpp 113 UNINITIALIZED_LOGGER_MANAGER [ Description: 'Bad value for argument 'flags' in call to 'bmqa::OpenQueueStatus openQueueSync(QueueId *queueId,const bmqt::Uri& uri,bsls::Types::Uint64 flags,const bmqt::QueueOptions& options,const bsls::TimeInterval& timeout)': expected '2', got '10' (~/blazingmq/src/tutorials/subscriptions/consumer.cpp:857)', File: '~/blazingmq/src/tutorials/subscriptions/consumer.cpp:857' ] FATAL ~/blazingmq/src/groups/bmq/bmqa/bmqa_mocksession.cpp:123 Assertion failed: false zsh: abort ./consumer.tsk