RFR: 8334502: gtest/GTestWrapper.java fails on armhf due to LogDecorations.iso8601_utctime_test [v2]

David Holmes dholmes at openjdk.org
Mon Jul 15 02:34:53 UTC 2024


On Fri, 12 Jul 2024 07:41:28 GMT, Vladimir Petko <vpetko at openjdk.org> wrote:

>> Due to time_t transition time_t is now 64bit on Ubuntu. zone_hours and zone_min are printed using %02d specifier. This causes random value to be printed as the timezone offset.
>> 
>> Testing - armhf gtest passes on Ubuntu Oracular:
>> 
>> ==============================
>> Test summary
>> ==============================
>>    TEST                                              TOTAL  PASS  FAIL ERROR   
>>    gtest:all/server                                   1033  1033     0     0   
>> ==============================
>> TEST SUCCESS
>
> Vladimir Petko has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into fix_time_t
>  - use int instead of time_t to print timezone info

Changes requested by dholmes (Reviewer).

src/hotspot/share/runtime/os.cpp line 218:

> 216:   const int zone_hours = (abs_local_to_UTC / seconds_per_hour);
> 217:   const int zone_min =
> 218:     ((abs_local_to_UTC % seconds_per_hour) / seconds_per_minute);

I think you need to cast the expression to `int` to ensure the compiler won't complain, regardless of how `time_t` may actually be declared.

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

PR Review: https://git.openjdk.org/jdk/pull/19782#pullrequestreview-2176788953
PR Review Comment: https://git.openjdk.org/jdk/pull/19782#discussion_r1677267166


More information about the hotspot-runtime-dev mailing list