Skip to content

Commit 74a6fb5

Browse files
committed
fix -Wsign-compare in tests
in test_strcspn_s and test_strspn_s
1 parent 8b1b54d commit 74a6fb5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/test_strcspn_s.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int test_strcspn_s (void)
124124
errs++;
125125
}
126126
std_count = strcspn(str1, str2);
127-
if (count != std_count) {
127+
if ((int)count != std_count) {
128128
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
129129
__FUNCTION__, __LINE__, (int)count, std_count, rc);
130130
errs++;
@@ -222,7 +222,7 @@ int test_strcspn_s (void)
222222
errs++;
223223
}
224224
std_count = strcspn(str1, str2);
225-
if (count != std_count) {
225+
if ((int)count != std_count) {
226226
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
227227
__FUNCTION__, __LINE__, (int)count, std_count, rc);
228228
errs++;
@@ -239,7 +239,7 @@ int test_strcspn_s (void)
239239
errs++;
240240
}
241241
std_count = strcspn(str1, str2);
242-
if (count != std_count) {
242+
if ((int)count != std_count) {
243243
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
244244
__FUNCTION__, __LINE__, (int)count, std_count, rc);
245245
errs++;
@@ -256,7 +256,7 @@ int test_strcspn_s (void)
256256
errs++;
257257
}
258258
std_count = strcspn(str1, str2);
259-
if (count != std_count) {
259+
if ((int)count != std_count) {
260260
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
261261
__FUNCTION__, __LINE__, (int)count, std_count, rc);
262262
errs++;

tests/test_strspn_s.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int test_strspn_s (void)
183183
errs++;
184184
}
185185
std_count = strspn(str1, str2);
186-
if (count != std_count) {
186+
if ((int)count != std_count) {
187187
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
188188
__FUNCTION__, __LINE__, (int)count, std_count, rc);
189189
errs++;
@@ -200,7 +200,7 @@ int test_strspn_s (void)
200200
errs++;
201201
}
202202
std_count = strspn(str1, str2);
203-
if (count != std_count) {
203+
if ((int)count != std_count) {
204204
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
205205
__FUNCTION__, __LINE__, (int)count, std_count, rc);
206206
errs++;
@@ -218,7 +218,7 @@ int test_strspn_s (void)
218218
errs++;
219219
}
220220
std_count = strspn(str1, str2);
221-
if (count != std_count) {
221+
if ((int)count != std_count) {
222222
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
223223
__FUNCTION__, __LINE__, (int)count, std_count, rc);
224224
errs++;
@@ -235,7 +235,7 @@ int test_strspn_s (void)
235235
errs++;
236236
}
237237
std_count = strspn(str1, str2);
238-
if (count != std_count) {
238+
if ((int)count != std_count) {
239239
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
240240
__FUNCTION__, __LINE__, (int)count, std_count, rc);
241241
errs++;
@@ -252,7 +252,7 @@ int test_strspn_s (void)
252252
errs++;
253253
}
254254
std_count = strspn(str1, str2);
255-
if (count != std_count) {
255+
if ((int)count != std_count) {
256256
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
257257
__FUNCTION__, __LINE__, (int)count, std_count, rc);
258258
errs++;
@@ -269,7 +269,7 @@ int test_strspn_s (void)
269269
errs++;
270270
}
271271
std_count = strspn(str1, str2);
272-
if (count != std_count) {
272+
if ((int)count != std_count) {
273273
debug_printf("%s %u count=%d std_count=%d rc=%d \n",
274274
__FUNCTION__, __LINE__, (int)count, std_count, rc);
275275
errs++;

0 commit comments

Comments
 (0)