Skip to content

Commit f3fb5a4

Browse files
committedMay 15, 2021
8266942: gtest/GTestWrapper.java os.iso8601_time_vm failed
Reviewed-by: dcubed
1 parent 7ab6dc8 commit f3fb5a4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎test/hotspot/gtest/runtime/test_os.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -782,28 +782,29 @@ TEST_VM(os, iso8601_time) {
782782
buffer[os::iso8601_timestamp_size] = 'X'; // canary
783783
const char* result = NULL;
784784
// YYYY-MM-DDThh:mm:ss.mmm+zzzz
785-
const char* const pattern = "dddd-dd-dd.dd:dd:dd.ddd+dddd";
785+
const char* const pattern_utc = "dddd-dd-dd.dd:dd:dd.ddd.0000";
786+
const char* const pattern_local = "dddd-dd-dd.dd:dd:dd.ddd.dddd";
786787

787788
result = os::iso8601_time(buffer, sizeof(buffer), true);
788789
tty->print_cr("%s", result);
789790
EXPECT_EQ(result, buffer);
790-
EXPECT_TRUE(very_simple_string_matcher(pattern, result));
791+
EXPECT_TRUE(very_simple_string_matcher(pattern_utc, result));
791792

792793
result = os::iso8601_time(buffer, sizeof(buffer), false);
793794
tty->print_cr("%s", result);
794795
EXPECT_EQ(result, buffer);
795-
EXPECT_TRUE(very_simple_string_matcher(pattern, result));
796+
EXPECT_TRUE(very_simple_string_matcher(pattern_local, result));
796797

797798
// Test with explicit timestamps
798799
result = os::iso8601_time(0, buffer, sizeof(buffer), true);
799800
tty->print_cr("%s", result);
800801
EXPECT_EQ(result, buffer);
801-
EXPECT_TRUE(very_simple_string_matcher("1970-01-01.00:00:00.000+dddd", result));
802+
EXPECT_TRUE(very_simple_string_matcher("1970-01-01.00:00:00.000+0000", result));
802803

803804
result = os::iso8601_time(17, buffer, sizeof(buffer), true);
804805
tty->print_cr("%s", result);
805806
EXPECT_EQ(result, buffer);
806-
EXPECT_TRUE(very_simple_string_matcher("1970-01-01.00:00:00.017+dddd", result));
807+
EXPECT_TRUE(very_simple_string_matcher("1970-01-01.00:00:00.017+0000", result));
807808

808809
// Canary should still be intact
809810
EXPECT_EQ(buffer[os::iso8601_timestamp_size], 'X');

0 commit comments

Comments
 (0)
Please sign in to comment.