RFR: 8377895: Create sizeof_auto, to reduce narrowing conversions
Stefan Karlsson
stefank at openjdk.org
Mon Feb 16 12:30:34 UTC 2026
On Mon, 16 Feb 2026 12:17:37 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> test/hotspot/gtest/utilities/test_globalDefinitions.cpp line 330:
>>
>>> 328: };
>>> 329:
>>> 330: TEST(globalDefinitions, sizeof_auto) {
>>
>> I know that this isn't something that we follow today, but it's good practice to avoid underscores in test names when using Gtest. If you can call it `SizeofAuto` or `sizeofAuto` then I think that's preferred.
>
> Nit: I think you can split these into multiple tests with more descriptive names overall, but that's up to you.
>
> For example, L341-L346 could be in a test called `SizeofAutoReturnsTheNumberOfBytesInAnArray` or something like that. This is very much my opinion rather than our style guide, so truly a nit.
> I know that this isn't something that we follow today, but it's good practice to avoid underscores in test names when using Gtest. If you can call it SizeofAuto or sizeofAuto then I think that's preferred.
Almost all of our gtest test uses underscores, so I think that Leo should stick with `_` for this PR.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29716#discussion_r2812190860
More information about the hotspot-dev
mailing list