RFR: 8298730: Refactor subsystem_file_line_contents and add docs and tests

Severin Gehwolf sgehwolf at openjdk.org
Wed Dec 14 13:59:02 UTC 2022


On Wed, 14 Dec 2022 12:53:29 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Even here it is specified as "whenever possible", so I guess tabs might be on the table. We could always do isspace(line[key_len]) != 0 && line[key_len] != '\n'?

That seems most appropriate here.

>> test/hotspot/gtest/os/linux/test_cgroupSubsystem_linux.cpp line 81:
>> 
>>> 79: }
>>> 80: 
>>> 81: TEST(CgroupTest, SubSystemFileLineContentsTests) {
>> 
>> `test/hotspot/gtest/runtime/test_os_linux_cgroups.cpp` uses tag `os_linux_cgroup` and underscore-separated (over camelCase) name. Could we make this consistent? Ideally, all cgroup related gtests should get selected with something like `gtest:os_linux_cgroup` or `gtest:cgroup` or a better name you come up with.
>
> Yeah, snake_case for Gtests is a Hotspot-ism, Gtest's documentation recommends PascalCase. I can always convert all to `cgroupTest`?
> 
> Gtest seems to say this:
> 
>>. Both names must be valid C++ identifiers, and they should not contain any underscores (_).  
> 
> (The  reason for this is that Gtest uses _ for name mangling, and so if we avoid _ then we also avoid accidental collisions)

OK with `cgroupTest` for all.

-------------

PR: https://git.openjdk.org/jdk/pull/11667


More information about the hotspot-runtime-dev mailing list