From bde72e562e18501bfe9d0f2208d11633edc545dd Mon Sep 17 00:00:00 2001 From: Matt Greenfield Date: Tue, 17 Apr 2018 15:14:09 +0700 Subject: [PATCH] Revert "permit precision loss down to 3 sig figs" This reverts commit 3bcc5b806425b3f94bc927e3360cdc566481c425. --- Tests/GRDBTests/FoundationDateTests.swift | 2 +- Tests/GRDBTests/FoundationNSDateTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/GRDBTests/FoundationDateTests.swift b/Tests/GRDBTests/FoundationDateTests.swift index 43e7a9b66..6e0a29fef 100644 --- a/Tests/GRDBTests/FoundationDateTests.swift +++ b/Tests/GRDBTests/FoundationDateTests.swift @@ -259,7 +259,7 @@ class FoundationDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date), 1) XCTAssertEqual(calendar.component(.minute, from: date), 2) XCTAssertEqual(calendar.component(.second, from: date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_560_000) < 600_000) // permit precision loss down to 3 sig figs + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_560_000) < 10) } } } diff --git a/Tests/GRDBTests/FoundationNSDateTests.swift b/Tests/GRDBTests/FoundationNSDateTests.swift index 411c307ad..0b3330c5e 100644 --- a/Tests/GRDBTests/FoundationNSDateTests.swift +++ b/Tests/GRDBTests/FoundationNSDateTests.swift @@ -242,7 +242,7 @@ class FoundationNSDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date as Date), 1) XCTAssertEqual(calendar.component(.minute, from: date as Date), 2) XCTAssertEqual(calendar.component(.second, from: date as Date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_560_000) < 600_000) // permit precision loss down to 3 sig figs + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_560_000) < 10) } } }