From 13d973dde40b44feb2768f5c8f0bf7b387f91752 Mon Sep 17 00:00:00 2001 From: Matt Greenfield Date: Tue, 17 Apr 2018 15:14:18 +0700 Subject: [PATCH] Revert "fix the tests to expect less nanosecond precision loss" This reverts commit eba5df1fcc1ae9a3c9ac346bed8bda886a420103. --- Tests/GRDBTests/FoundationDateTests.swift | 4 ++-- Tests/GRDBTests/FoundationNSDateTests.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/GRDBTests/FoundationDateTests.swift b/Tests/GRDBTests/FoundationDateTests.swift index 6e0a29fef..920d15f01 100644 --- a/Tests/GRDBTests/FoundationDateTests.swift +++ b/Tests/GRDBTests/FoundationDateTests.swift @@ -179,7 +179,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) < 10) + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the DateComponents -> Date conversion. Not a big deal. } } @@ -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) < 10) + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the DateComponents -> Date conversion. Not a big deal. } } } diff --git a/Tests/GRDBTests/FoundationNSDateTests.swift b/Tests/GRDBTests/FoundationNSDateTests.swift index 0b3330c5e..ea43fb71f 100644 --- a/Tests/GRDBTests/FoundationNSDateTests.swift +++ b/Tests/GRDBTests/FoundationNSDateTests.swift @@ -162,7 +162,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) < 10) + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the NSDateComponents -> NSDate conversion. Not a big deal. } } @@ -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) < 10) + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the NSDateComponents -> NSDate conversion. Not a big deal. } } }