use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_toNanoOfDay_fromNanoOfDay_symmetry.
@Test
public void test_toNanoOfDay_fromNanoOfDay_symmetry() {
LocalTime t = LocalTime.of(0, 0);
for (int i = 0; i < 1000000; i++) {
assertEquals(LocalTime.ofNanoOfDay(t.toNanoOfDay()), t);
t = t.plusNanos(1);
}
t = LocalTime.of(0, 0);
for (int i = 1; i <= 1000000; i++) {
t = t.minusNanos(1);
assertEquals(LocalTime.ofNanoOfDay(t.toNanoOfDay()), t);
}
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_minusMinutes_big.
@Test
public void test_minusMinutes_big() {
LocalTime t = LocalTime.of(2, 30).minusMinutes(Long.MAX_VALUE);
int mins = (int) (Long.MAX_VALUE % (24L * 60L));
assertEquals(t, LocalTime.of(2, 30).minusMinutes(mins));
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_minusSeconds_noChange_equal.
@Test
public void test_minusSeconds_noChange_equal() {
LocalTime t = TEST_12_30_40_987654321.minusSeconds(0);
assertEquals(t, TEST_12_30_40_987654321);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_withSecond_normal.
//-----------------------------------------------------------------------
// withSecond()
//-----------------------------------------------------------------------
@Test
public void test_withSecond_normal() {
LocalTime t = TEST_12_30_40_987654321;
for (int i = 0; i < 60; i++) {
t = t.withSecond(i);
assertEquals(t.getSecond(), i);
}
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_withHour_noChange_equal.
@Test
public void test_withHour_noChange_equal() {
LocalTime t = TEST_12_30_40_987654321.withHour(12);
assertEquals(t, TEST_12_30_40_987654321);
}
Aggregations