From 721300275904a57beb2f0fb91280fb42044d0fe4 Mon Sep 17 00:00:00 2001 From: Sergey Bolshedvorsky Date: Mon, 7 Dec 2015 10:31:38 +0000 Subject: [PATCH] Fixes test case TestNSFileManger.test_fileAttributes Check only for the existence of file owner's account (user) identifier instead of comparing its numeric value because - user identifier of `0` are assigned to the superuser in linux - negative value are valid account identifier. e.g. `nobody` is `-2` (See https://en.wikipedia.org/wiki/User_identifier) - There's an assumption made here that account identifier are numeric which is reasonable for most system but there's a slim chance that this might not be the case. Thanks to @lxcid --- TestFoundation/TestNSFileManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestFoundation/TestNSFileManager.swift b/TestFoundation/TestNSFileManager.swift index ce4f798d34..adf82f7c49 100644 --- a/TestFoundation/TestNSFileManager.swift +++ b/TestFoundation/TestNSFileManager.swift @@ -121,7 +121,7 @@ class TestNSFileManger : XCTestCase { XCTAssertEqual(fileType!, NSFileTypeRegular) let fileOwnerAccountID = attrs[NSFileOwnerAccountID] as? NSNumber - XCTAssertNotEqual(fileOwnerAccountID!.longLongValue, 0) + XCTAssertNotNil(fileOwnerAccountID) } catch let err { XCTFail("\(err)")