소스 검색

be little lenient in date assertions due to double rounding

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@280 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/rel_1_1_13
James Ahlborn 16 년 전
부모
커밋
3d7b5f9a2a
1개의 변경된 파일17개의 추가작업 그리고 6개의 파일을 삭제
  1. 17
    6
      test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java

+ 17
- 6
test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java 파일 보기

@@ -789,12 +789,23 @@ public class DatabaseTest extends TestCase {

assertEquals(dates.size(), foundDates.size());
for(int i = 0; i < dates.size(); ++i) {
try {
assertEquals(dates.get(i), foundDates.get(i));
} catch(Error e) {
System.err.println("Expected " + dates.get(i).getTime() + ", found " +
foundDates.get(i).getTime());
throw e;
Date expected = dates.get(i);
Date found = foundDates.get(i);
if(expected == null) {
assertNull(found);
} else {
// there are some rounding issues due to dates being stored as
// doubles, but it results in a 1 millisecond difference, so i'm not
// going to worry about it
long expTime = expected.getTime();
long foundTime = found.getTime();
try {
assertTrue((expTime == foundTime) ||
(Math.abs(expTime - foundTime) <= 1));
} catch(Error e) {
System.err.println("Expected " + expTime + ", found " + foundTime);
throw e;
}
}
}
}

Loading…
취소
저장