From ca9b7a486a5e0efb1255be13fd8c1fd3a6e353b2 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 28 Mar 2012 17:58:13 -0700 Subject: [PATCH] Fixed some unit tests affected by the change in due time handling --- tests/src/com/todoroo/astrid/repeats/AdvancedRepeatTests.java | 2 +- tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/src/com/todoroo/astrid/repeats/AdvancedRepeatTests.java b/tests/src/com/todoroo/astrid/repeats/AdvancedRepeatTests.java index 12d982de5..0c182b99d 100644 --- a/tests/src/com/todoroo/astrid/repeats/AdvancedRepeatTests.java +++ b/tests/src/com/todoroo/astrid/repeats/AdvancedRepeatTests.java @@ -60,7 +60,7 @@ public class AdvancedRepeatTests extends TodorooTestCase { Date todayWithTime = new Date(); todayWithTime.setHours(10); todayWithTime.setMinutes(4); - todayWithTime.setSeconds(0); + todayWithTime.setSeconds(1); long nextDayWithTimeLong = todayWithTime.getTime(); nextDayWithTimeLong += DateUtilities.ONE_DAY; nextDayWithTimeLong = nextDayWithTimeLong / 1000L * 1000; diff --git a/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java b/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java index 69adc6307..cfe56d917 100644 --- a/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java +++ b/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java @@ -119,6 +119,9 @@ public class NewRepeatTests extends DatabaseTestCase { Task t = new Task(); t.setValue(Task.TITLE, title); long dueDate = DateUtilities.now() + DateUtilities.ONE_DAY * 3; + Date adjustDate = new Date(dueDate); + adjustDate.setSeconds(1); + dueDate = adjustDate.getTime(); dueDate = (dueDate / 1000L) * 1000L; // Strip milliseconds if (fromCompletion) t.setFlag(Task.FLAGS, Task.FLAG_REPEAT_AFTER_COMPLETION, true);