Ensure calculation is performed as a long
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@755387 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dc3d41bac5
commit
86d0d0e216
|
@ -120,7 +120,7 @@ public class DurationFormatUtilsTest extends TestCase {
|
||||||
text = DurationFormatUtils.formatDurationWords(2 * 24 * 60 * 60 * 1000 + 72 * 60 * 1000, false, false);
|
text = DurationFormatUtils.formatDurationWords(2 * 24 * 60 * 60 * 1000 + 72 * 60 * 1000, false, false);
|
||||||
assertEquals("2 days 1 hour 12 minutes 0 seconds", text);
|
assertEquals("2 days 1 hour 12 minutes 0 seconds", text);
|
||||||
for (int i = 2; i < 31; i++) {
|
for (int i = 2; i < 31; i++) {
|
||||||
text = DurationFormatUtils.formatDurationWords(i * 24 * 60 * 60 * 1000, false, false);
|
text = DurationFormatUtils.formatDurationWords(i * 24 * 60 * 60 * 1000L, false, false);
|
||||||
// assertEquals(i + " days 0 hours 0 minutes 0 seconds", text);
|
// assertEquals(i + " days 0 hours 0 minutes 0 seconds", text);
|
||||||
//
|
//
|
||||||
// junit.framework.ComparisonFailure: expected:<25 days 0 hours 0 minutes 0...> but was:<-24 days -17 hours
|
// junit.framework.ComparisonFailure: expected:<25 days 0 hours 0 minutes 0...> but was:<-24 days -17 hours
|
||||||
|
|
Loading…
Reference in New Issue