@@ -97,17 +97,34 @@ - (void)testExtractBufferedData_VeryLarge
97
97
{
98
98
os_log_t log = os_log_create (" UnrarKit-testExtractBufferedData_VeryLarge" , OS_LOG_CATEGORY_POINTS_OF_INTEREST);
99
99
100
- os_signpost_id_t createTextFileID = os_signpost_id_generate (log );
101
- os_signpost_interval_begin (log , createTextFileID, " Create Text File" );
100
+ os_signpost_id_t createTextFileID;
101
+
102
+ if (@available (macOS 10.14 , *)) {
103
+ createTextFileID = os_signpost_id_generate (log );
104
+ os_signpost_interval_begin (log , createTextFileID, " Create Text File" );
105
+ }
106
+
102
107
NSURL *largeTextFile = [self randomTextFileOfLength: 1000000 ]; // Increase for a more dramatic test
103
- XCTAssertNotNil (largeTextFile, @" No large text file URL returned" );
104
- os_signpost_interval_end (log , createTextFileID, " Create Text File" );
105
108
106
- os_signpost_id_t archiveDataID = os_signpost_id_generate (log );
107
- os_signpost_interval_begin (log , archiveDataID, " Archive Data" );
109
+ if (@available (macOS 10.14 , *)) {
110
+ XCTAssertNotNil (largeTextFile, @" No large text file URL returned" );
111
+ os_signpost_interval_end (log , createTextFileID, " Create Text File" );
112
+ }
113
+
114
+ os_signpost_id_t archiveDataID;
115
+
116
+ if (@available (macOS 10.14 , *)) {
117
+ archiveDataID = os_signpost_id_generate (log );
118
+ os_signpost_interval_begin (log , archiveDataID, " Archive Data" );
119
+ }
120
+
108
121
NSURL *archiveURL = [self archiveWithFiles: @[largeTextFile]];
122
+
109
123
XCTAssertNotNil (archiveURL, @" No archived large text file URL returned" );
110
- os_signpost_interval_end (log , archiveDataID, " Archive Data" );
124
+
125
+ if (@available (macOS 10.14 , *)) {
126
+ os_signpost_interval_end (log , archiveDataID, " Archive Data" );
127
+ }
111
128
112
129
NSURL *deflatedFileURL = [self .tempDirectory URLByAppendingPathComponent: @" DeflatedTextFile.txt" ];
113
130
BOOL createSuccess = [[NSFileManager defaultManager ] createFileAtPath: deflatedFileURL.path
@@ -122,8 +139,12 @@ - (void)testExtractBufferedData_VeryLarge
122
139
123
140
URKArchive *archive = [[URKArchive alloc ] initWithURL: archiveURL error: nil ];
124
141
125
- os_signpost_id_t extractDataID = os_signpost_id_generate (log );
126
- os_signpost_interval_begin (log , extractDataID, " Extract Data" );
142
+ os_signpost_id_t extractDataID;
143
+
144
+ if (@available (macOS 10.14 , *)) {
145
+ extractDataID = os_signpost_id_generate (log );
146
+ os_signpost_interval_begin (log , extractDataID, " Extract Data" );
147
+ }
127
148
128
149
NSError *error = nil ;
129
150
BOOL success = [archive extractBufferedDataFromFile: largeTextFile.lastPathComponent
@@ -134,8 +155,10 @@ - (void)testExtractBufferedData_VeryLarge
134
155
[deflated writeData: dataChunk];
135
156
}];
136
157
137
- os_signpost_interval_end (log , extractDataID, " Extract Data" );
138
-
158
+ if (@available (macOS 10.14 , *)) {
159
+ os_signpost_interval_end (log , extractDataID, " Extract Data" );
160
+ }
161
+
139
162
XCTAssertTrue (success, @" Failed to read buffered data" );
140
163
XCTAssertNil (error, @" Error reading buffered data" );
141
164
0 commit comments