Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Jun 2, 2020
2 parents 1f0543b + d347d2e commit 896874b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
14 changes: 4 additions & 10 deletions test/jdk/java/time/tck/java/time/TCKLocalDateTime.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -110,6 +110,7 @@
import java.time.Clock;
import java.time.DateTimeException;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -284,15 +285,8 @@ public void now_ZoneId() {
ZoneId zone = ZoneId.of("UTC+01:02:03");
LocalDateTime expected = LocalDateTime.now(Clock.system(zone));
LocalDateTime test = LocalDateTime.now(zone);
for (int i = 0; i < 100; i++) {
if (expected.equals(test)) {
return;
}
expected = LocalDateTime.now(Clock.system(zone));
test = LocalDateTime.now(zone);
}
assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
expected.truncatedTo(ChronoUnit.SECONDS));
assertEquals(Duration.between(expected, test).truncatedTo(ChronoUnit.SECONDS),
Duration.ZERO);
}

//-----------------------------------------------------------------------
Expand Down
13 changes: 3 additions & 10 deletions test/jdk/java/time/tck/java/time/TCKLocalTime.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -241,15 +241,8 @@ public void now_ZoneId() {
ZoneId zone = ZoneId.of("UTC+01:02:03");
LocalTime expected = LocalTime.now(Clock.system(zone));
LocalTime test = LocalTime.now(zone);
for (int i = 0; i < 100; i++) {
if (expected.equals(test)) {
return;
}
expected = LocalTime.now(Clock.system(zone));
test = LocalTime.now(zone);
}
assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
expected.truncatedTo(ChronoUnit.SECONDS));
assertEquals(Duration.between(expected, test).truncatedTo(ChronoUnit.SECONDS),
Duration.ZERO);
}

//-----------------------------------------------------------------------
Expand Down
13 changes: 3 additions & 10 deletions test/jdk/java/time/tck/java/time/TCKZonedDateTime.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -253,15 +253,8 @@ public void now_ZoneId() {
ZoneId zone = ZoneId.of("UTC+01:02:03");
ZonedDateTime expected = ZonedDateTime.now(Clock.system(zone));
ZonedDateTime test = ZonedDateTime.now(zone);
for (int i = 0; i < 100; i++) {
if (expected.equals(test)) {
return;
}
expected = ZonedDateTime.now(Clock.system(zone));
test = ZonedDateTime.now(zone);
}
assertEquals(test.truncatedTo(ChronoUnit.SECONDS),
expected.truncatedTo(ChronoUnit.SECONDS));
assertEquals(Duration.between(expected, test).truncatedTo(ChronoUnit.SECONDS),
Duration.ZERO);
}

//-----------------------------------------------------------------------
Expand Down

0 comments on commit 896874b

Please sign in to comment.