Skip to content

Commit 065e14c

Browse files
committed
Mark unused variables as unused
1 parent 1d0bb45 commit 065e14c

5 files changed

Lines changed: 65 additions & 65 deletions

File tree

Tests/WordPressKitTests/WordPressKitTests/Tests/BlogServiceRemoteRESTTests.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ - (void)testThatGetAuthorsWorks
4343
success:[OCMArg isNotNil]
4444
failure:[OCMArg isNotNil]]);
4545

46-
[service getAllAuthorsWithSuccess:^(NSArray<RemoteUser *> *users) {}
47-
failure:^(NSError *error) {}];
46+
[service getAllAuthorsWithSuccess:^(NSArray<RemoteUser *> * __unused users) {}
47+
failure:^(NSError * __unused error) {}];
4848
}
4949

5050
#pragma mark - Synchronizing site details for a blog
@@ -68,8 +68,8 @@ - (void)testThatSyncSiteDetailsForBlogWorks
6868
success:[OCMArg isNotNil]
6969
failure:[OCMArg isNotNil]]);
7070

71-
[service syncBlogWithSuccess:^(RemoteBlog *remoteBlog) {}
72-
failure:^(NSError *error) {}];
71+
[service syncBlogWithSuccess:^(RemoteBlog * __unused remoteBlog) {}
72+
failure:^(NSError * __unused error) {}];
7373
}
7474

7575
#pragma mark - Synchronizing post types for a blog
@@ -94,8 +94,8 @@ - (void)testThatSyncPostTypesForBlogWorks
9494
success:[OCMArg isNotNil]
9595
failure:[OCMArg isNotNil]]);
9696

97-
[service syncPostTypesWithSuccess:^(NSArray<RemotePostType *> *postTypes) {}
98-
failure:^(NSError *error) {}];
97+
[service syncPostTypesWithSuccess:^(NSArray<RemotePostType *> * __unused postTypes) {}
98+
failure:^(NSError * __unused error) {}];
9999
}
100100

101101
#pragma mark - Synchronizing post formats for a blog
@@ -119,8 +119,8 @@ - (void)testThatSyncPostFormatsForBlogWorks
119119
success:[OCMArg isNotNil]
120120
failure:[OCMArg isNotNil]]);
121121

122-
[service syncPostFormatsWithSuccess:^(NSDictionary *options) {}
123-
failure:^(NSError *error) {}];
122+
[service syncPostFormatsWithSuccess:^(NSDictionary * __unused options) {}
123+
failure:^(NSError * __unused error) {}];
124124
}
125125

126126

@@ -138,7 +138,7 @@ - (void)testSyncBlogSettingsParsesCorrectlyEveryField
138138

139139
[HTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
140140
return [[request.URL absoluteString] containsString:endpoint];
141-
} withStubResponse:^HTTPStubsResponse *(NSURLRequest *request) {
141+
} withStubResponse:^HTTPStubsResponse *(NSURLRequest * __unused request) {
142142
return [HTTPStubsResponse responseWithFileAtPath:responsePath
143143
statusCode:200
144144
headers:@{@"Content-Type":@"application/json"}];

Tests/WordPressKitTests/WordPressKitTests/Tests/MenusServiceRemoteTests.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ - (void)testThatCreateMenuWithNameWorks
4141

4242
[service createMenuWithName:name
4343
siteID:dotComID
44-
success:^(RemoteMenu *menu) {}
45-
failure:^(NSError *error) {}];
44+
success:^(RemoteMenu * __unused menu) {}
45+
failure:^(NSError * __unused error) {}];
4646
}
4747

4848
- (void)testThatUpdateMenuWorks
@@ -71,8 +71,8 @@ - (void)testThatUpdateMenuWorks
7171
withName:menu.name
7272
withLocations:nil
7373
withItems:nil
74-
success:^(RemoteMenu *menu) {}
75-
failure:^(NSError *error) {}];
74+
success:^(RemoteMenu * __unused menu) {}
75+
failure:^(NSError * __unused error) {}];
7676
}
7777

7878
- (void)testThatDeleteMenuWorks
@@ -99,7 +99,7 @@ - (void)testThatDeleteMenuWorks
9999
[service deleteMenuForID:menu.menuID
100100
siteID:dotComID
101101
success:^{}
102-
failure:^(NSError *error) {}];
102+
failure:^(NSError * __unused error) {}];
103103
}
104104

105105
- (void)testThatGetMenusWorks
@@ -121,8 +121,8 @@ - (void)testThatGetMenusWorks
121121

122122

123123
[service getMenusForSiteID:dotComID
124-
success:^(NSArray<RemoteMenu *> *menus, NSArray<RemoteMenuLocation *> *locations) {}
125-
failure:^(NSError *error) {}];
124+
success:^(NSArray<RemoteMenu *> * __unused menus, NSArray<RemoteMenuLocation *> * __unused locations) {}
125+
failure:^(NSError * __unused error) {}];
126126
}
127127

128128
@end

Tests/WordPressKitTests/WordPressKitTests/Tests/PostServiceRemoteRESTTests.m

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ - (void)testThatGetPostWithIDWorks
4747
failure:[OCMArg isNotNil]]);
4848

4949
[service getPostWithID:postID
50-
success:^(RemotePost *post) {}
51-
failure:^(NSError *error) {}];
50+
success:^(RemotePost * __unused post) {}
51+
failure:^(NSError * __unused error) {}];
5252
}
5353

5454
- (void)testThatGetPostWithIDThrowsExceptionWithoutPostID
@@ -57,8 +57,8 @@ - (void)testThatGetPostWithIDThrowsExceptionWithoutPostID
5757

5858
XCTAssertNoThrow(service = [self service]);
5959
XCTAssertThrows([service getPostWithID:nil
60-
success:^(RemotePost *post) {}
61-
failure:^(NSError *error) {}]);
60+
success:^(RemotePost * __unused post) {}
61+
failure:^(NSError * __unused error) {}]);
6262
}
6363

6464
#pragma mark - Getting posts by type
@@ -90,8 +90,8 @@ - (void)testThatGetPostsOfTypeWorks
9090

9191

9292
[service getPostsOfType:postType
93-
success:^(NSArray<RemotePost *> *remotePosts) {}
94-
failure:^(NSError *error) {}];
93+
success:^(NSArray<RemotePost *> * __unused remotePosts) {}
94+
failure:^(NSError * __unused error) {}];
9595
}
9696

9797
- (void)testThatGetPostsOfTypeWithOptionsWorks
@@ -126,8 +126,8 @@ - (void)testThatGetPostsOfTypeWithOptionsWorks
126126

127127
[service getPostsOfType:postType
128128
options:options
129-
success:^(NSArray<RemotePost *> *remotePosts) {}
130-
failure:^(NSError *error) {}];
129+
success:^(NSArray<RemotePost *> * __unused remotePosts) {}
130+
failure:^(NSError * __unused error) {}];
131131
}
132132

133133
#pragma mark - Creating posts
@@ -160,8 +160,8 @@ - (void)testThatCreatePostWorks
160160
failure:[OCMArg isNotNil]]);
161161

162162
[service createPost:post
163-
success:^(RemotePost *posts) {}
164-
failure:^(NSError *error) {}];
163+
success:^(RemotePost * __unused posts) {}
164+
failure:^(NSError * __unused error) {}];
165165
}
166166

167167
- (void)testThatCreatePostThrowsExceptionWithoutPost
@@ -170,8 +170,8 @@ - (void)testThatCreatePostThrowsExceptionWithoutPost
170170

171171
XCTAssertNoThrow(service = [self service]);
172172
XCTAssertThrows([service createPost:nil
173-
success:^(RemotePost *posts) {}
174-
failure:^(NSError *error) {}]);
173+
success:^(RemotePost * __unused posts) {}
174+
failure:^(NSError * __unused error) {}]);
175175
}
176176

177177
#pragma mark - Updating posts
@@ -205,8 +205,8 @@ - (void)testThatUpdatePostWorks
205205
failure:[OCMArg isNotNil]]);
206206

207207
[service updatePost:post
208-
success:^(RemotePost *posts) {}
209-
failure:^(NSError *error) {}];
208+
success:^(RemotePost * __unused posts) {}
209+
failure:^(NSError * __unused error) {}];
210210
}
211211

212212
- (void)testThatUpdatePostThrowsExceptionWithoutPost
@@ -215,8 +215,8 @@ - (void)testThatUpdatePostThrowsExceptionWithoutPost
215215

216216
XCTAssertNoThrow(service = [self service]);
217217
XCTAssertThrows([service updatePost:nil
218-
success:^(RemotePost *posts) {}
219-
failure:^(NSError *error) {}]);
218+
success:^(RemotePost * __unused posts) {}
219+
failure:^(NSError * __unused error) {}]);
220220
}
221221

222222
#pragma mark - Autosaving posts
@@ -250,8 +250,8 @@ - (void)testThatAutoSavePostWorks
250250
failure:[OCMArg isNotNil]]);
251251

252252
[service autoSave:post
253-
success:^(RemotePost *post, NSString *previewURL) {}
254-
failure:^(NSError *error) {}];
253+
success:^(RemotePost * __unused post, NSString * __unused previewURL) {}
254+
failure:^(NSError * __unused error) {}];
255255
}
256256

257257
- (void)testThatGetAutoSaveForPostWorks
@@ -283,8 +283,8 @@ - (void)testThatGetAutoSaveForPostWorks
283283
failure:[OCMArg isNotNil]]);
284284

285285
[service getAutoSaveForPost:post
286-
success:^(RemotePost *post) {}
287-
failure:^(NSError *error) {}];
286+
success:^(RemotePost * __unused post) {}
287+
failure:^(NSError * __unused error) {}];
288288
}
289289

290290

@@ -312,7 +312,7 @@ - (void)testThatDeletePostWorks
312312

313313
[service deletePost:post
314314
success:^() {}
315-
failure:^(NSError *error) {}];
315+
failure:^(NSError * __unused error) {}];
316316
}
317317

318318
- (void)testThatDeletePostThrowsExceptionWithoutPost
@@ -322,7 +322,7 @@ - (void)testThatDeletePostThrowsExceptionWithoutPost
322322
XCTAssertNoThrow(service = [self service]);
323323
XCTAssertThrows([service deletePost:nil
324324
success:^() {}
325-
failure:^(NSError *error) {}]);
325+
failure:^(NSError * __unused error) {}]);
326326
}
327327

328328
#pragma mark - Trashing posts
@@ -348,8 +348,8 @@ - (void)testThatTrashPostWorks
348348
failure:[OCMArg isNotNil]]);
349349

350350
[service trashPost:post
351-
success:^(RemotePost *posts) {}
352-
failure:^(NSError *error) {}];
351+
success:^(RemotePost * __unused posts) {}
352+
failure:^(NSError * __unused error) {}];
353353
}
354354

355355
- (void)testThatTashPostThrowsExceptionWithoutPost
@@ -358,8 +358,8 @@ - (void)testThatTashPostThrowsExceptionWithoutPost
358358

359359
XCTAssertNoThrow(service = [self service]);
360360
XCTAssertThrows([service trashPost:nil
361-
success:^(RemotePost *posts) {}
362-
failure:^(NSError *error) {}]);
361+
success:^(RemotePost * __unused posts) {}
362+
failure:^(NSError * __unused error) {}]);
363363
}
364364

365365
#pragma mark - Trashing posts
@@ -385,8 +385,8 @@ - (void)testThatRestorePostWorks
385385
failure:[OCMArg isNotNil]]);
386386

387387
[service restorePost:post
388-
success:^(RemotePost *posts) {}
389-
failure:^(NSError *error) {}];
388+
success:^(RemotePost * __unused posts) {}
389+
failure:^(NSError * __unused error) {}];
390390
}
391391

392392
- (void)testThatRestorePostThrowsExceptionWithoutPost
@@ -395,8 +395,8 @@ - (void)testThatRestorePostThrowsExceptionWithoutPost
395395

396396
XCTAssertNoThrow(service = [self service]);
397397
XCTAssertThrows([service restorePost:nil
398-
success:^(RemotePost *posts) {}
399-
failure:^(NSError *error) {}]);
398+
success:^(RemotePost * __unused posts) {}
399+
failure:^(NSError * __unused error) {}]);
400400
}
401401

402402
@end

Tests/WordPressKitTests/WordPressKitTests/Tests/TaxonomyServiceRemoteRESTTests.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ - (void)testThatCreateCategoryWorks
6363
failure:[OCMArg isNotNil]]);
6464

6565
[self.service createCategory:category
66-
success:^(RemotePostCategory * _Nonnull category) {}
67-
failure:^(NSError * _Nonnull error) {}];
66+
success:^(RemotePostCategory * __unused category) {}
67+
failure:^(NSError * __unused error) {}];
6868
}
6969

7070
- (void)testThatGetCategoriesWorks
@@ -81,8 +81,8 @@ - (void)testThatGetCategoriesWorks
8181
success:[OCMArg isNotNil]
8282
failure:[OCMArg isNotNil]]);
8383

84-
[self.service getCategoriesWithSuccess:^(NSArray<RemotePostCategory *> * _Nonnull categories) {}
85-
failure:^(NSError * _Nonnull error) {}];
84+
[self.service getCategoriesWithSuccess:^(NSArray<RemotePostCategory *> * __unused categories) {}
85+
failure:^(NSError * __unused error) {}];
8686
}
8787

8888
/// Verify `RemotePostCategory.parent` is `@0` instead of `nil` when the corresponding JSON response is `"parent": null`.
@@ -125,7 +125,7 @@ - (void)testThatGetCategoriesWithNilParent
125125
}
126126
};
127127
[self.service getCategoriesWithSuccess:success
128-
failure:^(NSError * _Nonnull error) {}];
128+
failure:^(NSError * __unused error) {}];
129129

130130
[self waitForExpectations:@[parentIsZero] timeout:0.1];
131131
}
@@ -170,8 +170,8 @@ - (void)testThatGetCategoriesWithPagingWorks
170170
failure:[OCMArg isNotNil]]);
171171

172172
[self.service getCategoriesWithPaging:paging
173-
success:^(NSArray<RemotePostCategory *> * _Nonnull categories) {}
174-
failure:^(NSError * _Nonnull error) {}];
173+
success:^(NSArray<RemotePostCategory *> * __unused categories) {}
174+
failure:^(NSError * __unused error) {}];
175175
}
176176

177177
- (void)testThatSearchCategoriesWithNameWorks
@@ -196,8 +196,8 @@ - (void)testThatSearchCategoriesWithNameWorks
196196
failure:[OCMArg isNotNil]]);
197197

198198
[self.service searchCategoriesWithName:searchName
199-
success:^(NSArray<RemotePostCategory *> * _Nonnull categories) {}
200-
failure:^(NSError * _Nonnull error) {}];
199+
success:^(NSArray<RemotePostCategory *> * __unused categories) {}
200+
failure:^(NSError * __unused error) {}];
201201
}
202202

203203
#pragma mark - Tags
@@ -223,8 +223,8 @@ - (void)testThatCreateTagWorks
223223
failure:[OCMArg isNotNil]]);
224224

225225
[self.service createTag:tag
226-
success:^(RemotePostTag * _Nonnull tag) {}
227-
failure:^(NSError * _Nonnull error) {}];
226+
success:^(RemotePostTag * __unused tag) {}
227+
failure:^(NSError * __unused error) {}];
228228
}
229229

230230
- (void)testThatGetTagsWorks
@@ -241,8 +241,8 @@ - (void)testThatGetTagsWorks
241241
success:[OCMArg isNotNil]
242242
failure:[OCMArg isNotNil]]);
243243

244-
[self.service getTagsWithSuccess:^(NSArray<RemotePostTag *> * _Nonnull tags) {}
245-
failure:^(NSError * _Nonnull error) {}];
244+
[self.service getTagsWithSuccess:^(NSArray<RemotePostTag *> * __unused tags) {}
245+
failure:^(NSError * __unused error) {}];
246246
}
247247

248248
- (void)testThatGetTagsWithPagingWorks
@@ -285,8 +285,8 @@ - (void)testThatGetTagsWithPagingWorks
285285
failure:[OCMArg isNotNil]]);
286286

287287
[self.service getTagsWithPaging:paging
288-
success:^(NSArray<RemotePostTag *> * _Nonnull tags) {}
289-
failure:^(NSError * _Nonnull error) {}];
288+
success:^(NSArray<RemotePostTag *> * __unused tags) {}
289+
failure:^(NSError * __unused error) {}];
290290
}
291291

292292
- (void)testThatSearchTagsWithNameWorks
@@ -311,8 +311,8 @@ - (void)testThatSearchTagsWithNameWorks
311311
failure:[OCMArg isNotNil]]);
312312

313313
[self.service searchTagsWithName:searchName
314-
success:^(NSArray<RemotePostTag *> * _Nonnull tags) {}
315-
failure:^(NSError * _Nonnull error) {}];
314+
success:^(NSArray<RemotePostTag *> * __unused tags) {}
315+
failure:^(NSError * __unused error) {}];
316316
}
317317

318318
@end

Tests/WordPressKitTests/WordPressKitTests/Tests/ThemeServiceRemoteTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ - (void)testThatGetThemesWorks
198198
NSString *url = [service pathForEndpoint:@"themes"
199199
withVersion:WordPressComRESTAPIVersion_2_0];
200200

201-
ThemeServiceRemoteThemesRequestSuccessBlock successBlock = ^void (NSArray<RemoteTheme *> *themes, BOOL hasMore, NSInteger totalThemeCount) {
201+
ThemeServiceRemoteThemesRequestSuccessBlock successBlock = ^void (NSArray<RemoteTheme *> *themes, BOOL __unused hasMore, NSInteger totalThemeCount) {
202202
NSCAssert([themes count] == expectedThemes, @"Expected %ld themes to be returned", expectedThemes);
203203
NSCAssert(totalThemeCount == expectedThemes, @"Expected %ld themes to be found", expectedThemes);
204204
};
@@ -234,7 +234,7 @@ - (void)testThatGetThemesForBlogIdWorks
234234
{
235235
NSNumber *blogId = @124;
236236

237-
ThemeServiceRemoteThemesRequestSuccessBlock successBlock = ^void (NSArray<RemoteTheme *> *themes, BOOL hasMore, NSInteger totalThemeCount) {
237+
ThemeServiceRemoteThemesRequestSuccessBlock successBlock = ^void (NSArray<RemoteTheme *> *themes, BOOL __unused hasMore, NSInteger totalThemeCount) {
238238
NSCAssert([themes count] > 0, @"Expected themes to be returned");
239239
NSCAssert(totalThemeCount > 0, @"Expected total themes count to be > 0");
240240
};

0 commit comments

Comments
 (0)