@@ -18,7 +18,7 @@ - (void)setUp
1818
1919 self.cache = [[TMCache alloc ] initWithName: TMCacheTestName];
2020
21- STAssertNotNil (self.cache , @" test cache does not exist" );
21+ XCTAssertNotNil (self.cache , @" test cache does not exist" );
2222}
2323
2424- (void )tearDown
@@ -27,7 +27,7 @@ - (void)tearDown
2727
2828 self.cache = nil ;
2929
30- STAssertNil (self.cache , @" test cache did not deallocate" );
30+ XCTAssertNil (self.cache , @" test cache did not deallocate" );
3131
3232 [super tearDown ];
3333}
@@ -61,18 +61,18 @@ - (dispatch_time_t)timeout
6161
6262- (void )testCoreProperties
6363{
64- STAssertTrue ([self .cache.name isEqualToString: TMCacheTestName], @" wrong name" );
65- STAssertNotNil (self.cache .memoryCache , @" memory cache does not exist" );
66- STAssertNotNil (self.cache .diskCache , @" disk cache doe not exist" );
64+ XCTAssertTrue ([self .cache.name isEqualToString: TMCacheTestName], @" wrong name" );
65+ XCTAssertNotNil (self.cache .memoryCache , @" memory cache does not exist" );
66+ XCTAssertNotNil (self.cache .diskCache , @" disk cache doe not exist" );
6767}
6868
6969- (void )testDiskCacheURL
7070{
7171 BOOL isDir = NO ;
7272 BOOL exists = [[NSFileManager defaultManager ] fileExistsAtPath: [self .cache.diskCache.cacheURL path ] isDirectory: &isDir];
7373
74- STAssertTrue (exists, @" disk cache directory does not exist" );
75- STAssertTrue (isDir, @" disk cache url is not a directory" );
74+ XCTAssertTrue (exists, @" disk cache directory does not exist" );
75+ XCTAssertTrue (isDir, @" disk cache url is not a directory" );
7676}
7777
7878- (void )testObjectSet
@@ -88,7 +88,7 @@ - (void)testObjectSet
8888
8989 dispatch_semaphore_wait (semaphore, [self timeout ]);
9090
91- STAssertNotNil (image, @" object was not set" );
91+ XCTAssertNotNil (image, @" object was not set" );
9292}
9393
9494- (void )testObjectGet
@@ -106,7 +106,7 @@ - (void)testObjectGet
106106
107107 dispatch_semaphore_wait (semaphore, [self timeout ]);
108108
109- STAssertNotNil (image, @" object was not got" );
109+ XCTAssertNotNil (image, @" object was not got" );
110110}
111111
112112- (void )testObjectRemove
@@ -124,7 +124,7 @@ - (void)testObjectRemove
124124
125125 id object = [self .cache objectForKey: key];
126126
127- STAssertNil (object, @" object was not removed" );
127+ XCTAssertNil (object, @" object was not removed" );
128128}
129129
130130- (void )testMemoryCost
@@ -135,16 +135,16 @@ - (void)testMemoryCost
135135 [self .cache.memoryCache setObject: key1 forKey: key1 withCost: 1 ];
136136 [self .cache.memoryCache setObject: key2 forKey: key2 withCost: 2 ];
137137
138- STAssertTrue (self.cache .memoryCache .totalCost == 3 , @" memory cache total cost was incorrect" );
138+ XCTAssertTrue (self.cache .memoryCache .totalCost == 3 , @" memory cache total cost was incorrect" );
139139
140140 [self .cache.memoryCache trimToCost: 1 ];
141141
142142 id object1 = [self .cache.memoryCache objectForKey: key1];
143143 id object2 = [self .cache.memoryCache objectForKey: key2];
144144
145- STAssertNotNil (object1, @" object did not survive memory cache trim to cost" );
146- STAssertNil (object2, @" object was not trimmed despite exceeding cost" );
147- STAssertTrue (self.cache .memoryCache .totalCost == 1 , @" cache had an unexpected total cost" );
145+ XCTAssertNotNil (object1, @" object did not survive memory cache trim to cost" );
146+ XCTAssertNil (object2, @" object was not trimmed despite exceeding cost" );
147+ XCTAssertTrue (self.cache .memoryCache .totalCost == 1 , @" cache had an unexpected total cost" );
148148}
149149
150150- (void )testMemoryCostByDate
@@ -160,16 +160,16 @@ - (void)testMemoryCostByDate
160160 id object1 = [self .cache.memoryCache objectForKey: key1];
161161 id object2 = [self .cache.memoryCache objectForKey: key2];
162162
163- STAssertNil (object1, @" object was not trimmed despite exceeding cost" );
164- STAssertNil (object2, @" object was not trimmed despite exceeding cost" );
165- STAssertTrue (self.cache .memoryCache .totalCost == 0 , @" cache had an unexpected total cost" );
163+ XCTAssertNil (object1, @" object was not trimmed despite exceeding cost" );
164+ XCTAssertNil (object2, @" object was not trimmed despite exceeding cost" );
165+ XCTAssertTrue (self.cache .memoryCache .totalCost == 0 , @" cache had an unexpected total cost" );
166166}
167167
168168- (void )testDiskByteCount
169169{
170170 [self .cache setObject: [self image ] forKey: @" image" ];
171171
172- STAssertTrue (self.cache .diskByteCount > 0 , @" disk cache byte count was not greater than zero" );
172+ XCTAssertTrue (self.cache .diskByteCount > 0 , @" disk cache byte count was not greater than zero" );
173173}
174174
175175- (void )testOneThousandAndOneWrites
@@ -202,7 +202,7 @@ - (void)testOneThousandAndOneWrites
202202
203203 dispatch_group_wait (group, [self timeout ]);
204204
205- STAssertTrue (count == 0 , @" one or more object blocks failed to execute, possible queue deadlock" );
205+ XCTAssertTrue (count == 0 , @" one or more object blocks failed to execute, possible queue deadlock" );
206206}
207207
208208- (void )testMemoryWarningBlock
@@ -221,7 +221,7 @@ - (void)testMemoryWarningBlock
221221
222222 dispatch_semaphore_wait (semaphore, [self timeout ]);
223223
224- STAssertTrue (blockDidExecute, @" memory warning block did not execute" );
224+ XCTAssertTrue (blockDidExecute, @" memory warning block did not execute" );
225225}
226226
227227- (void )testBackgroundBlock
@@ -240,7 +240,7 @@ - (void)testBackgroundBlock
240240
241241 dispatch_semaphore_wait (semaphore, [self timeout ]);
242242
243- STAssertTrue (blockDidExecute, @" app background block did not execute" );
243+ XCTAssertTrue (blockDidExecute, @" app background block did not execute" );
244244}
245245
246246- (void )testMemoryWarningProperty
@@ -263,7 +263,7 @@ - (void)testMemoryWarningProperty
263263
264264 dispatch_semaphore_wait (semaphore, [self timeout ]);
265265
266- STAssertNotNil (object, @" object was removed from the cache" );
266+ XCTAssertNotNil (object, @" object was removed from the cache" );
267267}
268268
269269- (void )testMemoryCacheEnumerationWithWarning
@@ -295,7 +295,7 @@ - (void)testMemoryCacheEnumerationWithWarning
295295
296296 dispatch_semaphore_wait (semaphore, [self timeout ]);
297297
298- STAssertTrue (objectCount == enumCount, @" some objects were not enumerated" );
298+ XCTAssertTrue (objectCount == enumCount, @" some objects were not enumerated" );
299299}
300300
301301- (void )testDiskCacheEnumeration
@@ -323,7 +323,7 @@ - (void)testDiskCacheEnumeration
323323
324324 dispatch_semaphore_wait (semaphore, [self timeout ]);
325325
326- STAssertTrue (objectCount == enumCount, @" some objects were not enumerated" );
326+ XCTAssertTrue (objectCount == enumCount, @" some objects were not enumerated" );
327327}
328328
329329@end
0 commit comments