Skip to content

Style: Rename unit test to match component name - #1185

Merged
pniedzielski merged 4 commits into
bloomberg:mainfrom
pniedzielski:style/initialconnectioncontex.t
Mar 30, 2026
Merged

Style: Rename unit test to match component name#1185
pniedzielski merged 4 commits into
bloomberg:mainfrom
pniedzielski:style/initialconnectioncontex.t

Conversation

@pniedzielski

Copy link
Copy Markdown
Collaborator

The mqbnet_initialconnectioncontext component’s unit test file was misnamed as mqbnet_initialconnectioncontex. This patch renames this file.

@pniedzielski
pniedzielski requested a review from a team as a code owner March 6, 2026 22:47
@pniedzielski
pniedzielski marked this pull request as draft March 6, 2026 22:47
@pniedzielski

Copy link
Copy Markdown
Collaborator Author

#1184 will conflict with this, since it modifies this file. Marking this as a draft since it will need a rebase.

@pniedzielski
pniedzielski force-pushed the style/initialconnectioncontex.t branch 2 times, most recently from 7bbd33c to da4b303 Compare March 6, 2026 22:53
@pniedzielski
pniedzielski force-pushed the style/initialconnectioncontex.t branch 2 times, most recently from 0dadf7b to d463aea Compare March 20, 2026 16:22
@pniedzielski
pniedzielski requested a review from chrisbeard March 20, 2026 16:22
@pniedzielski
pniedzielski marked this pull request as ready for review March 20, 2026 16:23
@pniedzielski
pniedzielski force-pushed the style/initialconnectioncontex.t branch 4 times, most recently from 889f036 to 676f4a5 Compare March 24, 2026 13:44
The `mqbnet_initialconnectioncontext` component’s unit test file was
misnamed as `mqbnet_initialconnectioncontex`.  This patch renames this
file.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Commit `f448eabdc95d96246ac2da0497ff7701c9252a28` cached the initial
connection context by channel pointer rather than by the initial
context shared pointer itself.  The same change should have been made
in the UT.  However, since the UT for `InitialConnectionContext` was
incorrectly named, our test harness did not pick it up, so we did not
detect the build failure.  This patch performs the same change as that
commit on the `InitialConnectionContext` unit test.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
The `InitialConnectionContext` test used a `nullptr`, which fails in
C++03 builds.  This patch removes the `nullptr` usage.

We have two options here: we can replace `nullptr` with a null pointer
value, or we can pass a pointer to a real object in.  Particularly
here, the `AuthenticationContext` maintains a backpointer to
`InitialConnectionContext` which the unit test is setting to
`nullptr`.  Given that we have a real `InitialConnectionContext` we
can pass, and all the other values we use to construct
`AuthenticationContext` are real, we choose here to pass real
`InitialConnectionContext`.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
`bsl::allocate_shared` automatically forwards the allocator to the
constructor of the object it is building correctly.  Passing the
allocator in addition causes a compiler error.  This patch removes the
extra allocator from a UT.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
@pniedzielski
pniedzielski force-pushed the style/initialconnectioncontex.t branch from 676f4a5 to 4641e7f Compare March 25, 2026 06:13
@pniedzielski
pniedzielski merged commit 213643e into bloomberg:main Mar 30, 2026
43 of 45 checks passed
@pniedzielski
pniedzielski deleted the style/initialconnectioncontex.t branch March 30, 2026 15:40
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.

2 participants