From 9cf32412ae642ab38522c29ce3fc37c32442e456 Mon Sep 17 00:00:00 2001 From: Anirudh Agnihotry Date: Fri, 25 Jan 2019 18:52:12 -0800 Subject: [PATCH] setnanoseconds disabled for mac (dotnet/corefx#34870) Commit migrated from https://github.com/dotnet/corefx/commit/d68361f04cd8851b0e6fa58b5a7bd429cd26db58 --- src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs index e281049..51578ac 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs @@ -43,6 +43,9 @@ namespace System.IO.Tests if (!HasNonZeroNanoseconds(fileinfo.LastWriteTime)) { + if (PlatformDetection.IsOSX) + return null; + DateTime dt = fileinfo.LastWriteTime; dt = dt.AddTicks(1); fileinfo.LastWriteTime = dt; @@ -119,6 +122,9 @@ namespace System.IO.Tests public void CopyToNanosecondsPresent() { FileInfo input = GetNonZeroNanoseconds(); + if (input == null) + return; + FileInfo output = new FileInfo(Path.Combine(GetTestFilePath(), input.Name)); output.Directory.Create(); -- 2.7.4