             Thread.sleep(forTimeInterval: 0.001)
         }
     }
-    
+
+#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
     func test_fileDescriptor() throws {
         let handle = createFileHandle()
-        #if !os(Windows)
-        XCTAssertTrue(handle.fileDescriptor > 0, "File descriptor after opening should be valid (is \(handle.fileDescriptor))")
-        #endif
-        
+        XCTAssertTrue(handle._isPlatformHandleValid, "File descriptor after opening should be valid")
+
         try handle.close()
-        XCTAssertEqual(handle.fileDescriptor, -1, "File descriptor after closing should not be valid")
-    }
-    
+        XCTAssertFalse(handle._isPlatformHandleValid, "File descriptor after closing should not be valid")
+    }
+#endif
+
     func test_availableData() {
         let handle = createFileHandle()
         


#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
        tests.append(contentsOf: [
            ("testHandleCreationAndCleanup", testHandleCreationAndCleanup),
            ("testOffset", testOffset),
        ])

            ("test_truncateFile", test_truncateFile),
            ("test_readabilityHandlerCloseFileRace", test_readabilityHandlerCloseFileRace),
            ("test_readabilityHandlerCloseFileRaceWithError", test_readabilityHandlerCloseFileRaceWithError),
            ("test_availableData", test_availableData),
            ("test_readToEndOfFileInBackgroundAndNotify", test_readToEndOfFileInBackgroundAndNotify),
            ("test_readToEndOfFileAndNotify", test_readToEndOfFileAndNotify),
