Commit 1a6e8f8a54eea1159a950cd8a49cedae3699ff9a

Russell Belfer 2012-04-13T10:42:00

Update clar and remove old helpers This updates to the latest clar which includes the helpers `cl_assert_equal_s` and `cl_assert_equal_i`. Convert the code over to use those and remove the old libgit2-only helpers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
diff --git a/tests-clar/attr/attr_expect.h b/tests-clar/attr/attr_expect.h
index b064eac..df1e104 100644
--- a/tests-clar/attr/attr_expect.h
+++ b/tests-clar/attr/attr_expect.h
@@ -34,7 +34,7 @@ GIT_INLINE(void) attr_check_expected(
 		break;
 
 	case EXPECT_STRING:
-		cl_assert_strequal(expected_str, value);
+		cl_assert_equal_s(expected_str, value);
 		break;
 	}
 }
diff --git a/tests-clar/attr/file.c b/tests-clar/attr/file.c
index 6aeaa51..7fede50 100644
--- a/tests-clar/attr/file.c
+++ b/tests-clar/attr/file.c
@@ -13,19 +13,19 @@ void test_attr_file__simple_read(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file));
-	cl_assert_strequal(cl_fixture("attr/attr0"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr0"), file->path);
 	cl_assert(file->rules.length == 1);
 
 	rule = get_rule(0);
 	cl_assert(rule != NULL);
-	cl_assert_strequal("*", rule->match.pattern);
+	cl_assert_equal_s("*", rule->match.pattern);
 	cl_assert(rule->match.length == 1);
 	cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
 
 	cl_assert(rule->assigns.length == 1);
 	assign = get_assign(rule, 0);
 	cl_assert(assign != NULL);
-	cl_assert_strequal("binary", assign->name);
+	cl_assert_equal_s("binary", assign->name);
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 	cl_assert(!assign->is_allocated);
 
@@ -40,7 +40,7 @@ void test_attr_file__match_variants(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file));
-	cl_assert_strequal(cl_fixture("attr/attr1"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr1"), file->path);
 	cl_assert(file->rules.length == 10);
 
 	/* let's do a thorough check of this rule, then just verify
@@ -48,53 +48,53 @@ void test_attr_file__match_variants(void)
 	 */
 	rule = get_rule(0);
 	cl_assert(rule);
-	cl_assert_strequal("pat0", rule->match.pattern);
+	cl_assert_equal_s("pat0", rule->match.pattern);
 	cl_assert(rule->match.length == strlen("pat0"));
 	cl_assert(rule->match.flags == 0);
 	cl_assert(rule->assigns.length == 1);
 	assign = get_assign(rule,0);
-	cl_assert_strequal("attr0", assign->name);
+	cl_assert_equal_s("attr0", assign->name);
 	cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name));
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 	cl_assert(!assign->is_allocated);
 
 	rule = get_rule(1);
-	cl_assert_strequal("pat1", rule->match.pattern);
+	cl_assert_equal_s("pat1", rule->match.pattern);
 	cl_assert(rule->match.length == strlen("pat1"));
 	cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_NEGATIVE);
 
 	rule = get_rule(2);
-	cl_assert_strequal("pat2", rule->match.pattern);
+	cl_assert_equal_s("pat2", rule->match.pattern);
 	cl_assert(rule->match.length == strlen("pat2"));
 	cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_DIRECTORY);
 
 	rule = get_rule(3);
-	cl_assert_strequal("pat3dir/pat3file", rule->match.pattern);
+	cl_assert_equal_s("pat3dir/pat3file", rule->match.pattern);
 	cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_FULLPATH);
 
 	rule = get_rule(4);
-	cl_assert_strequal("pat4.*", rule->match.pattern);
+	cl_assert_equal_s("pat4.*", rule->match.pattern);
 	cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
 
 	rule = get_rule(5);
-	cl_assert_strequal("*.pat5", rule->match.pattern);
+	cl_assert_equal_s("*.pat5", rule->match.pattern);
 	cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
 
 	rule = get_rule(7);
-	cl_assert_strequal("pat7[a-e]??[xyz]", rule->match.pattern);
+	cl_assert_equal_s("pat7[a-e]??[xyz]", rule->match.pattern);
 	cl_assert(rule->assigns.length == 1);
 	cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
 	assign = get_assign(rule,0);
-	cl_assert_strequal("attr7", assign->name);
+	cl_assert_equal_s("attr7", assign->name);
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 
 	rule = get_rule(8);
-	cl_assert_strequal("pat8 with spaces", rule->match.pattern);
+	cl_assert_equal_s("pat8 with spaces", rule->match.pattern);
 	cl_assert(rule->match.length == strlen("pat8 with spaces"));
 	cl_assert(rule->match.flags == 0);
 
 	rule = get_rule(9);
-	cl_assert_strequal("pat9", rule->match.pattern);
+	cl_assert_equal_s("pat9", rule->match.pattern);
 
 	git_attr_file__free(file);
 }
@@ -111,9 +111,9 @@ static void check_one_assign(
 	git_attr_rule *rule = get_rule(rule_idx);
 	git_attr_assignment *assign = get_assign(rule, assign_idx);
 
-	cl_assert_strequal(pattern, rule->match.pattern);
+	cl_assert_equal_s(pattern, rule->match.pattern);
 	cl_assert(rule->assigns.length == 1);
-	cl_assert_strequal(name, assign->name);
+	cl_assert_equal_s(name, assign->name);
 	cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name));
 
 	attr_check_expected(expected, expected_str, assign->value);
@@ -127,7 +127,7 @@ void test_attr_file__assign_variants(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr2"), file));
-	cl_assert_strequal(cl_fixture("attr/attr2"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr2"), file->path);
 	cl_assert(file->rules.length == 11);
 
 	check_one_assign(file, 0, 0, "pat0", "simple", EXPECT_TRUE, NULL);
@@ -140,45 +140,45 @@ void test_attr_file__assign_variants(void)
 	check_one_assign(file, 7, 0, "pat6", "negempty", EXPECT_FALSE, NULL);
 
 	rule = get_rule(8);
-	cl_assert_strequal("pat7", rule->match.pattern);
+	cl_assert_equal_s("pat7", rule->match.pattern);
 	cl_assert(rule->assigns.length == 5);
 	/* assignments will be sorted by hash value, so we have to do
 	 * lookups by search instead of by position
 	 */
 	assign = git_attr_rule__lookup_assignment(rule, "multiple");
 	cl_assert(assign);
-	cl_assert_strequal("multiple", assign->name);
+	cl_assert_equal_s("multiple", assign->name);
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 	assign = git_attr_rule__lookup_assignment(rule, "single");
 	cl_assert(assign);
-	cl_assert_strequal("single", assign->name);
+	cl_assert_equal_s("single", assign->name);
 	cl_assert(GIT_ATTR_FALSE(assign->value));
 	assign = git_attr_rule__lookup_assignment(rule, "values");
 	cl_assert(assign);
-	cl_assert_strequal("values", assign->name);
-	cl_assert_strequal("1", assign->value);
+	cl_assert_equal_s("values", assign->name);
+	cl_assert_equal_s("1", assign->value);
 	assign = git_attr_rule__lookup_assignment(rule, "also");
 	cl_assert(assign);
-	cl_assert_strequal("also", assign->name);
-	cl_assert_strequal("a-really-long-value/*", assign->value);
+	cl_assert_equal_s("also", assign->name);
+	cl_assert_equal_s("a-really-long-value/*", assign->value);
 	assign = git_attr_rule__lookup_assignment(rule, "happy");
 	cl_assert(assign);
-	cl_assert_strequal("happy", assign->name);
-	cl_assert_strequal("yes!", assign->value);
+	cl_assert_equal_s("happy", assign->name);
+	cl_assert_equal_s("yes!", assign->value);
 	assign = git_attr_rule__lookup_assignment(rule, "other");
 	cl_assert(!assign);
 
 	rule = get_rule(9);
-	cl_assert_strequal("pat8", rule->match.pattern);
+	cl_assert_equal_s("pat8", rule->match.pattern);
 	cl_assert(rule->assigns.length == 2);
 	assign = git_attr_rule__lookup_assignment(rule, "again");
 	cl_assert(assign);
-	cl_assert_strequal("again", assign->name);
+	cl_assert_equal_s("again", assign->name);
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 	assign = git_attr_rule__lookup_assignment(rule, "another");
 	cl_assert(assign);
-	cl_assert_strequal("another", assign->name);
-	cl_assert_strequal("12321", assign->value);
+	cl_assert_equal_s("another", assign->name);
+	cl_assert_equal_s("12321", assign->value);
 
 	check_one_assign(file, 10, 0, "pat9", "at-eof", EXPECT_FALSE, NULL);
 
@@ -193,37 +193,37 @@ void test_attr_file__check_attr_examples(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr3"), file));
-	cl_assert_strequal(cl_fixture("attr/attr3"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr3"), file->path);
 	cl_assert(file->rules.length == 3);
 
 	rule = get_rule(0);
-	cl_assert_strequal("*.java", rule->match.pattern);
+	cl_assert_equal_s("*.java", rule->match.pattern);
 	cl_assert(rule->assigns.length == 3);
 	assign = git_attr_rule__lookup_assignment(rule, "diff");
-	cl_assert_strequal("diff", assign->name);
-	cl_assert_strequal("java", assign->value);
+	cl_assert_equal_s("diff", assign->name);
+	cl_assert_equal_s("java", assign->value);
 	assign = git_attr_rule__lookup_assignment(rule, "crlf");
-	cl_assert_strequal("crlf", assign->name);
+	cl_assert_equal_s("crlf", assign->name);
 	cl_assert(GIT_ATTR_FALSE(assign->value));
 	assign = git_attr_rule__lookup_assignment(rule, "myAttr");
-	cl_assert_strequal("myAttr", assign->name);
+	cl_assert_equal_s("myAttr", assign->name);
 	cl_assert(GIT_ATTR_TRUE(assign->value));
 	assign = git_attr_rule__lookup_assignment(rule, "missing");
 	cl_assert(assign == NULL);
 
 	rule = get_rule(1);
-	cl_assert_strequal("NoMyAttr.java", rule->match.pattern);
+	cl_assert_equal_s("NoMyAttr.java", rule->match.pattern);
 	cl_assert(rule->assigns.length == 1);
 	assign = get_assign(rule, 0);
-	cl_assert_strequal("myAttr", assign->name);
+	cl_assert_equal_s("myAttr", assign->name);
 	cl_assert(assign->value == NULL);
 
 	rule = get_rule(2);
-	cl_assert_strequal("README", rule->match.pattern);
+	cl_assert_equal_s("README", rule->match.pattern);
 	cl_assert(rule->assigns.length == 1);
 	assign = get_assign(rule, 0);
-	cl_assert_strequal("caveat", assign->name);
-	cl_assert_strequal("unspecified", assign->value);
+	cl_assert_equal_s("caveat", assign->name);
+	cl_assert_equal_s("unspecified", assign->value);
 
 	git_attr_file__free(file);
 }
diff --git a/tests-clar/attr/lookup.c b/tests-clar/attr/lookup.c
index 1939618..4ce80e9 100644
--- a/tests-clar/attr/lookup.c
+++ b/tests-clar/attr/lookup.c
@@ -11,12 +11,12 @@ void test_attr_lookup__simple(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file));
-	cl_assert_strequal(cl_fixture("attr/attr0"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr0"), file->path);
 	cl_assert(file->rules.length == 1);
 
 	cl_git_pass(git_attr_path__init(&path, "test", NULL));
-	cl_assert_strequal("test", path.path);
-	cl_assert_strequal("test", path.basename);
+	cl_assert_equal_s("test", path.path);
+	cl_assert_equal_s("test", path.basename);
 	cl_assert(!path.is_dir);
 
 	cl_git_pass(git_attr_file__lookup_one(file,&path,"binary",&value));
@@ -129,11 +129,11 @@ void test_attr_lookup__match_variants(void)
 
 	cl_git_pass(git_attr_file__new(&file));
 	cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file));
-	cl_assert_strequal(cl_fixture("attr/attr1"), file->path);
+	cl_assert_equal_s(cl_fixture("attr/attr1"), file->path);
 	cl_assert(file->rules.length == 10);
 
 	cl_git_pass(git_attr_path__init(&path, "/testing/for/pat0", NULL));
-	cl_assert_strequal("pat0", path.basename);
+	cl_assert_equal_s("pat0", path.basename);
 
 	run_test_cases(file, cases, 0);
 	run_test_cases(file, dir_cases, 1);
diff --git a/tests-clar/attr/repo.c b/tests-clar/attr/repo.c
index 5ff33d1..6dc13aa 100644
--- a/tests-clar/attr/repo.c
+++ b/tests-clar/attr/repo.c
@@ -101,7 +101,7 @@ void test_attr_repo__get_many(void)
 	cl_assert(GIT_ATTR_TRUE(values[0]));
 	cl_assert(GIT_ATTR_TRUE(values[1]));
 	cl_assert(GIT_ATTR_UNSPECIFIED(values[2]));
-	cl_assert_strequal("yes", values[3]);
+	cl_assert_equal_s("yes", values[3]);
 }
 
 static int count_attrs(
@@ -150,7 +150,7 @@ void test_attr_repo__manpage_example(void)
 	cl_assert(GIT_ATTR_FALSE(value));
 
 	cl_git_pass(git_attr_get(g_repo, "sub/abc", "merge", &value));
-	cl_assert_strequal("filfre", value);
+	cl_assert_equal_s("filfre", value);
 
 	cl_git_pass(git_attr_get(g_repo, "sub/abc", "frotz", &value));
 	cl_assert(GIT_ATTR_UNSPECIFIED(value));
@@ -177,13 +177,13 @@ void test_attr_repo__macros(void)
 	cl_assert(GIT_ATTR_TRUE(values[1]));
 	cl_assert(GIT_ATTR_FALSE(values[2]));
 	cl_assert(GIT_ATTR_UNSPECIFIED(values[3]));
-	cl_assert_strequal("77", values[4]);
+	cl_assert_equal_s("77", values[4]);
 
 	cl_git_pass(git_attr_get_many(g_repo, "macro_test", 3, names3, values));
 
 	cl_assert(GIT_ATTR_TRUE(values[0]));
 	cl_assert(GIT_ATTR_FALSE(values[1]));
-	cl_assert_strequal("answer", values[2]);
+	cl_assert_equal_s("answer", values[2]);
 }
 
 void test_attr_repo__bad_macros(void)
@@ -222,7 +222,7 @@ void test_attr_repo__bad_macros(void)
 	 *     -firstmacro secondmacro="hahaha" thirdmacro
 	 */
 	cl_assert(GIT_ATTR_FALSE(values[3]));
-	cl_assert_strequal("hahaha", values[4]);
+	cl_assert_equal_s("hahaha", values[4]);
 	cl_assert(GIT_ATTR_TRUE(values[5]));
 }
 
diff --git a/tests-clar/clar b/tests-clar/clar
index 506bde3..8be4ff5 100755
--- a/tests-clar/clar
+++ b/tests-clar/clar
@@ -297,7 +297,7 @@ static const struct clar_func _clar_cb_${suite_name}[] = {
 
 
 CLAR_FILES = {
-"clar.c" : r"""eJytGWlv20b2s/grJsompmxal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nujpxdX5+atDhYFlquoXOEf4/wjB3t62O7/9/hGKyVWV6FYvavT+AhbcW38=""",
diff --git a/tests-clar/clar_libgit2.h b/tests-clar/clar_libgit2.h
index bb2feee..4d338ef 100644
--- a/tests-clar/clar_libgit2.h
+++ b/tests-clar/clar_libgit2.h
@@ -25,26 +25,6 @@
  */
 #define cl_git_fail(expr) cl_must_fail(expr)
 
-/**
- * Wrapper for string comparison that knows about nulls.
- */
-#define cl_assert_strequal(a,b) \
-	cl_assert_strequal_internal(a,b,__FILE__,__LINE__,"string mismatch: " #a " != " #b)
-
-GIT_INLINE(void) cl_assert_strequal_internal(
-	const char *a, const char *b, const char *file, int line, const char *err)
-{
-	int match = (a == NULL || b == NULL) ? (a == b) : (strcmp(a, b) == 0);
-	if (!match) {
-		char buf[4096];
-		snprintf(buf, 4096, "'%s' != '%s'", a, b);
-		clar__assert(0, file, line, err, buf, 1);
-	}
-}
-
-#define cl_assert_intequal(a,b) \
-	do { if ((a) != (b)) { char buf[128]; snprintf(buf,128,"%d != %d",(a),(b)); clar__assert(0,__FILE__,__LINE__,#a " != " #b,buf,1); } } while (0)
-
 /*
  * Some utility macros for building long strings
  */
diff --git a/tests-clar/core/buffer.c b/tests-clar/core/buffer.c
index 4ba7b66..9294ccd 100644
--- a/tests-clar/core/buffer.c
+++ b/tests-clar/core/buffer.c
@@ -19,11 +19,11 @@ void test_core_buffer__0(void)
 
 	git_buf_puts(&buf, test_string);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_string, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_string, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, test_string);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_string_x2, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_string_x2, git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -35,11 +35,11 @@ void test_core_buffer__1(void)
 
 	git_buf_printf(&buf, "%s %s %d ", "shoop", "da", 23);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("shoop da 23 ", git_buf_cstr(&buf));
+	cl_assert_equal_s("shoop da 23 ", git_buf_cstr(&buf));
 
 	git_buf_printf(&buf, "%s %d", "woop", 42);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("shoop da 23 woop 42", git_buf_cstr(&buf));
+	cl_assert_equal_s("shoop da 23 woop 42", git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -59,7 +59,7 @@ void test_core_buffer__2(void)
 	cl_assert(buf.asize == 0);
 
 	/* empty buffer should be empty string */
-	cl_assert_strequal("", git_buf_cstr(&buf));
+	cl_assert_equal_s("", git_buf_cstr(&buf));
 	cl_assert(buf.size == 0);
 	/* cl_assert(buf.asize == 0); -- should not assume what git_buf does */
 
@@ -71,38 +71,38 @@ void test_core_buffer__2(void)
 	/* add letter */
 	git_buf_putc(&buf, '+');
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("+", git_buf_cstr(&buf));
+	cl_assert_equal_s("+", git_buf_cstr(&buf));
 
 	/* add letter again */
 	git_buf_putc(&buf, '+');
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("++", git_buf_cstr(&buf));
+	cl_assert_equal_s("++", git_buf_cstr(&buf));
 
 	/* let's try that a few times */
 	for (i = 0; i < 16; ++i) {
 		git_buf_putc(&buf, '+');
 		cl_assert(git_buf_oom(&buf) == 0);
 	}
-	cl_assert_strequal("++++++++++++++++++", git_buf_cstr(&buf));
+	cl_assert_equal_s("++++++++++++++++++", git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 
 	/* add data */
 	git_buf_put(&buf, "xo", 2);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("xo", git_buf_cstr(&buf));
+	cl_assert_equal_s("xo", git_buf_cstr(&buf));
 
 	/* add letter again */
 	git_buf_put(&buf, "xo", 2);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal("xoxo", git_buf_cstr(&buf));
+	cl_assert_equal_s("xoxo", git_buf_cstr(&buf));
 
 	/* let's try that a few times */
 	for (i = 0; i < 16; ++i) {
 		git_buf_put(&buf, "xo", 2);
 		cl_assert(git_buf_oom(&buf) == 0);
 	}
-	cl_assert_strequal("xoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxo",
+	cl_assert_equal_s("xoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxo",
 					   git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
@@ -110,21 +110,21 @@ void test_core_buffer__2(void)
 	/* set to string */
 	git_buf_sets(&buf, test_string);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_string, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_string, git_buf_cstr(&buf));
 
 	/* append string */
 	git_buf_puts(&buf, test_string);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_string_x2, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_string_x2, git_buf_cstr(&buf));
 
 	/* set to string again (should overwrite - not append) */
 	git_buf_sets(&buf, test_string);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_string, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_string, git_buf_cstr(&buf));
 
 	/* test clear */
 	git_buf_clear(&buf);
-	cl_assert_strequal("", git_buf_cstr(&buf));
+	cl_assert_equal_s("", git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 
@@ -133,27 +133,27 @@ void test_core_buffer__2(void)
 	cl_assert(git_buf_oom(&buf) == 0);
 
 	git_buf_copy_cstr(data, sizeof(data), &buf);
-	cl_assert_strequal(REP4("0123456789"), data);
+	cl_assert_equal_s(REP4("0123456789"), data);
 	git_buf_copy_cstr(data, 11, &buf);
-	cl_assert_strequal("0123456789", data);
+	cl_assert_equal_s("0123456789", data);
 	git_buf_copy_cstr(data, 3, &buf);
-	cl_assert_strequal("01", data);
+	cl_assert_equal_s("01", data);
 	git_buf_copy_cstr(data, 1, &buf);
-	cl_assert_strequal("", data);
+	cl_assert_equal_s("", data);
 
 	git_buf_copy_cstr(data, sizeof(data), &buf);
-	cl_assert_strequal(REP4("0123456789"), data);
+	cl_assert_equal_s(REP4("0123456789"), data);
 
 	git_buf_sets(&buf, REP256("x"));
 	git_buf_copy_cstr(data, sizeof(data), &buf);
 	/* since sizeof(data) == 128, only 127 bytes should be copied */
-	cl_assert_strequal(REP4(REP16("x")) REP16("x") REP16("x")
+	cl_assert_equal_s(REP4(REP16("x")) REP16("x") REP16("x")
 					   REP16("x") "xxxxxxxxxxxxxxx", data);
 
 	git_buf_free(&buf);
 
 	git_buf_copy_cstr(data, sizeof(data), &buf);
-	cl_assert_strequal("", data);
+	cl_assert_equal_s("", data);
 }
 
 /* let's do some tests with larger buffers to push our limits */
@@ -164,17 +164,17 @@ void test_core_buffer__3(void)
 	/* set to string */
 	git_buf_set(&buf, test_4096, 4096);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_4096, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_4096, git_buf_cstr(&buf));
 
 	/* append string */
 	git_buf_puts(&buf, test_4096);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_8192, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_8192, git_buf_cstr(&buf));
 
 	/* set to string again (should overwrite - not append) */
 	git_buf_set(&buf, test_4096, 4096);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(test_4096, git_buf_cstr(&buf));
+	cl_assert_equal_s(test_4096, git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -192,22 +192,22 @@ void test_core_buffer__4(void)
 		cl_assert(strlen(git_buf_cstr(&buf)) == (size_t)((i + 1) * 2));
 	}
 	/* we have appended 1234 10x and removed the first 20 letters */
-	cl_assert_strequal("12341234123412341234", git_buf_cstr(&buf));
+	cl_assert_equal_s("12341234123412341234", git_buf_cstr(&buf));
 
 	git_buf_consume(&buf, NULL);
-	cl_assert_strequal("12341234123412341234", git_buf_cstr(&buf));
+	cl_assert_equal_s("12341234123412341234", git_buf_cstr(&buf));
 
 	git_buf_consume(&buf, "invalid pointer");
-	cl_assert_strequal("12341234123412341234", git_buf_cstr(&buf));
+	cl_assert_equal_s("12341234123412341234", git_buf_cstr(&buf));
 
 	git_buf_consume(&buf, buf.ptr);
-	cl_assert_strequal("12341234123412341234", git_buf_cstr(&buf));
+	cl_assert_equal_s("12341234123412341234", git_buf_cstr(&buf));
 
 	git_buf_consume(&buf, buf.ptr + 1);
-	cl_assert_strequal("2341234123412341234", git_buf_cstr(&buf));
+	cl_assert_equal_s("2341234123412341234", git_buf_cstr(&buf));
 
 	git_buf_consume(&buf, buf.ptr + buf.size);
-	cl_assert_strequal("", git_buf_cstr(&buf));
+	cl_assert_equal_s("", git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -227,7 +227,7 @@ check_buf_append(
 	cl_assert(git_buf_oom(&tgt) == 0);
 	git_buf_puts(&tgt, data_b);
 	cl_assert(git_buf_oom(&tgt) == 0);
-	cl_assert_strequal(expected_data, git_buf_cstr(&tgt));
+	cl_assert_equal_s(expected_data, git_buf_cstr(&tgt));
 	cl_assert(tgt.size == expected_size);
 	if (expected_asize > 0)
 		cl_assert(tgt.asize == expected_asize);
@@ -250,27 +250,27 @@ check_buf_append_abc(
 
 	git_buf_sets(&buf, buf_a);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(buf_a, git_buf_cstr(&buf));
+	cl_assert_equal_s(buf_a, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, buf_b);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected_ab, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_ab, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, buf_c);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected_abc, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_abc, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, buf_a);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected_abca, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_abca, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, buf_b);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected_abcab, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_abcab, git_buf_cstr(&buf));
 
 	git_buf_puts(&buf, buf_c);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected_abcabc, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_abcabc, git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -330,13 +330,13 @@ void test_core_buffer__6(void)
 	git_buf_sets(&b, "bar");
 	cl_assert(git_buf_oom(&b) == 0);
 
-	cl_assert_strequal("foo", git_buf_cstr(&a));
-	cl_assert_strequal("bar", git_buf_cstr(&b));
+	cl_assert_equal_s("foo", git_buf_cstr(&a));
+	cl_assert_equal_s("bar", git_buf_cstr(&b));
 
 	git_buf_swap(&a, &b);
 
-	cl_assert_strequal("bar", git_buf_cstr(&a));
-	cl_assert_strequal("foo", git_buf_cstr(&b));
+	cl_assert_equal_s("bar", git_buf_cstr(&a));
+	cl_assert_equal_s("foo", git_buf_cstr(&b));
 
 	git_buf_free(&a);
 	git_buf_free(&b);
@@ -352,25 +352,25 @@ void test_core_buffer__7(void)
 
 	git_buf_sets(&a, "foo");
 	cl_assert(git_buf_oom(&a) == 0);
-	cl_assert_strequal("foo", git_buf_cstr(&a));
+	cl_assert_equal_s("foo", git_buf_cstr(&a));
 
 	b = git_buf_detach(&a);
 
-	cl_assert_strequal("foo", b);
-	cl_assert_strequal("", a.ptr);
+	cl_assert_equal_s("foo", b);
+	cl_assert_equal_s("", a.ptr);
 	git__free(b);
 
 	b = git_buf_detach(&a);
 
-	cl_assert_strequal(NULL, b);
-	cl_assert_strequal("", a.ptr);
+	cl_assert_equal_s(NULL, b);
+	cl_assert_equal_s("", a.ptr);
 
 	git_buf_free(&a);
 
 	b = git__strdup(fun);
 	git_buf_attach(&a, b, 0);
 
-	cl_assert_strequal(fun, a.ptr);
+	cl_assert_equal_s(fun, a.ptr);
 	cl_assert(a.size == strlen(fun));
 	cl_assert(a.asize == strlen(fun) + 1);
 
@@ -379,7 +379,7 @@ void test_core_buffer__7(void)
 	b = git__strdup(fun);
 	git_buf_attach(&a, b, strlen(fun) + 1);
 
-	cl_assert_strequal(fun, a.ptr);
+	cl_assert_equal_s(fun, a.ptr);
 	cl_assert(a.size == strlen(fun));
 	cl_assert(a.asize == strlen(fun) + 1);
 
@@ -398,7 +398,7 @@ check_joinbuf_2(
 
 	git_buf_join(&buf, sep, a, b);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected, git_buf_cstr(&buf));
 	git_buf_free(&buf);
 }
 
@@ -416,7 +416,7 @@ check_joinbuf_n_2(
 
 	git_buf_join_n(&buf, sep, 1, b);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected, git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -433,7 +433,7 @@ check_joinbuf_n_4(
 	git_buf buf = GIT_BUF_INIT;
 	git_buf_join_n(&buf, sep, 4, a, b, c, d);
 	cl_assert(git_buf_oom(&buf) == 0);
-	cl_assert_strequal(expected, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected, git_buf_cstr(&buf));
 	git_buf_free(&buf);
 }
 
@@ -444,15 +444,15 @@ void test_core_buffer__8(void)
 
 	git_buf_join_n(&a, '/', 1, "foo");
 	cl_assert(git_buf_oom(&a) == 0);
-	cl_assert_strequal("foo", git_buf_cstr(&a));
+	cl_assert_equal_s("foo", git_buf_cstr(&a));
 
 	git_buf_join_n(&a, '/', 1, "bar");
 	cl_assert(git_buf_oom(&a) == 0);
-	cl_assert_strequal("foo/bar", git_buf_cstr(&a));
+	cl_assert_equal_s("foo/bar", git_buf_cstr(&a));
 
 	git_buf_join_n(&a, '/', 1, "baz");
 	cl_assert(git_buf_oom(&a) == 0);
-	cl_assert_strequal("foo/bar/baz", git_buf_cstr(&a));
+	cl_assert_equal_s("foo/bar/baz", git_buf_cstr(&a));
 
 	git_buf_free(&a);
 
@@ -536,7 +536,7 @@ void test_core_buffer__9(void)
 		for (j = 0; j < sizeof(b) / sizeof(char*); ++j) {
 			for (i = 0; i < sizeof(a) / sizeof(char*); ++i) {
 				git_buf_join(&buf, separator, a[i], b[j]);
-				cl_assert_strequal(*expect, buf.ptr);
+				cl_assert_equal_s(*expect, buf.ptr);
 				expect++;
 			}
 		}
@@ -550,14 +550,14 @@ void test_core_buffer__10(void)
 	git_buf a = GIT_BUF_INIT;
 
 	cl_git_pass(git_buf_join_n(&a, '/', 1, "test"));
-	cl_assert_strequal(a.ptr, "test");
+	cl_assert_equal_s(a.ptr, "test");
 	cl_git_pass(git_buf_join_n(&a, '/', 1, "string"));
-	cl_assert_strequal(a.ptr, "test/string");
+	cl_assert_equal_s(a.ptr, "test/string");
 	git_buf_clear(&a);
 	cl_git_pass(git_buf_join_n(&a, '/', 3, "test", "string", "join"));
-	cl_assert_strequal(a.ptr, "test/string/join");
+	cl_assert_equal_s(a.ptr, "test/string/join");
 	cl_git_pass(git_buf_join_n(&a, '/', 2, a.ptr, "more"));
-	cl_assert_strequal(a.ptr, "test/string/join/test/string/join/more");
+	cl_assert_equal_s(a.ptr, "test/string/join/test/string/join/more");
 
 	git_buf_free(&a);
 }
diff --git a/tests-clar/core/errors.c b/tests-clar/core/errors.c
index c781000..78f811c 100644
--- a/tests-clar/core/errors.c
+++ b/tests-clar/core/errors.c
@@ -42,12 +42,14 @@ void test_core_errors__new_school(void)
 	cl_assert(str_in_error != NULL);
 
 	git_error_clear();
+	cl_assert(git_error_last() == NULL);
 
-	{
+	do {
 		struct stat st;
+		memset(&st, 0, sizeof(st));
 		assert(p_lstat("this_file_does_not_exist", &st) < 0);
 		GIT_UNUSED(st);
-	}
+	} while (false);
 	giterr_set(GITERR_OS, "stat failed"); /* internal fn */
 
 	cl_assert(git_error_last() != NULL);
diff --git a/tests-clar/core/path.c b/tests-clar/core/path.c
index 2654ef7..f02e0f7 100644
--- a/tests-clar/core/path.c
+++ b/tests-clar/core/path.c
@@ -8,11 +8,11 @@ check_dirname(const char *A, const char *B)
 	char *dir2;
 
 	cl_assert(git_path_dirname_r(&dir, A) >= 0);
-	cl_assert_strequal(B, dir.ptr);
+	cl_assert_equal_s(B, dir.ptr);
 	git_buf_free(&dir);
 
 	cl_assert((dir2 = git_path_dirname(A)) != NULL);
-	cl_assert_strequal(B, dir2);
+	cl_assert_equal_s(B, dir2);
 	git__free(dir2);
 }
 
@@ -23,11 +23,11 @@ check_basename(const char *A, const char *B)
 	char *base2;
 
 	cl_assert(git_path_basename_r(&base, A) >= 0);
-	cl_assert_strequal(B, base.ptr);
+	cl_assert_equal_s(B, base.ptr);
 	git_buf_free(&base);
 
 	cl_assert((base2 = git_path_basename(A)) != NULL);
-	cl_assert_strequal(B, base2);
+	cl_assert_equal_s(B, base2);
 	git__free(base2);
 }
 
@@ -37,7 +37,7 @@ check_topdir(const char *A, const char *B)
 	const char *dir;
 
 	cl_assert((dir = git_path_topdir(A)) != NULL);
-	cl_assert_strequal(B, dir);
+	cl_assert_equal_s(B, dir);
 }
 
 static void
@@ -46,7 +46,7 @@ check_joinpath(const char *path_a, const char *path_b, const char *expected_path
 	git_buf joined_path = GIT_BUF_INIT;
 
 	cl_git_pass(git_buf_joinpath(&joined_path, path_a, path_b));
-	cl_assert_strequal(expected_path, joined_path.ptr);
+	cl_assert_equal_s(expected_path, joined_path.ptr);
 
 	git_buf_free(&joined_path);
 }
@@ -63,7 +63,7 @@ check_joinpath_n(
 
 	cl_git_pass(git_buf_join_n(&joined_path, '/', 4,
 							   path_a, path_b, path_c, path_d));
-	cl_assert_strequal(expected_path, joined_path.ptr);
+	cl_assert_equal_s(expected_path, joined_path.ptr);
 
 	git_buf_free(&joined_path);
 }
@@ -189,7 +189,7 @@ check_path_to_dir(
 
 	git_buf_sets(&tgt, path);
 	cl_git_pass(git_path_to_dir(&tgt));
-	cl_assert_strequal(expected, tgt.ptr);
+	cl_assert_equal_s(expected, tgt.ptr);
 
 	git_buf_free(&tgt);
 }
@@ -197,16 +197,18 @@ check_path_to_dir(
 static void
 check_string_to_dir(
 	const char* path,
-	int         maxlen,
+	size_t      maxlen,
     const char* expected)
 {
-	int  len = strlen(path);
+	size_t len = strlen(path);
 	char *buf = git__malloc(len + 2);
+	cl_assert(buf);
+
 	strncpy(buf, path, len + 2);
 
 	git_path_string_to_dir(buf, maxlen);
 
-	cl_assert_strequal(expected, buf);
+	cl_assert_equal_s(expected, buf);
 
 	git__free(buf);
 }
@@ -247,28 +249,28 @@ void test_core_path__08_self_join(void)
 
 	asize = path.asize;
 	cl_git_pass(git_buf_sets(&path, "/foo"));
-	cl_assert_strequal(path.ptr, "/foo");
+	cl_assert_equal_s(path.ptr, "/foo");
 	cl_assert(asize < path.asize);
 
 	asize = path.asize;
 	cl_git_pass(git_buf_joinpath(&path, path.ptr, "this is a new string"));
-	cl_assert_strequal(path.ptr, "/foo/this is a new string");
+	cl_assert_equal_s(path.ptr, "/foo/this is a new string");
 	cl_assert(asize < path.asize);
 
 	asize = path.asize;
 	cl_git_pass(git_buf_joinpath(&path, path.ptr, "/grow the buffer, grow the buffer, grow the buffer"));
-	cl_assert_strequal(path.ptr, "/foo/this is a new string/grow the buffer, grow the buffer, grow the buffer");
+	cl_assert_equal_s(path.ptr, "/foo/this is a new string/grow the buffer, grow the buffer, grow the buffer");
 	cl_assert(asize < path.asize);
 
 	git_buf_free(&path);
 	cl_git_pass(git_buf_sets(&path, "/foo/bar"));
 
 	cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "baz"));
-	cl_assert_strequal(path.ptr, "/bar/baz");
+	cl_assert_equal_s(path.ptr, "/bar/baz");
 
 	asize = path.asize;
 	cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "somethinglongenoughtorealloc"));
-	cl_assert_strequal(path.ptr, "/baz/somethinglongenoughtorealloc");
+	cl_assert_equal_s(path.ptr, "/baz/somethinglongenoughtorealloc");
 	cl_assert(asize < path.asize);
 	
 	git_buf_free(&path);
@@ -279,7 +281,7 @@ static void check_percent_decoding(const char *expected_result, const char *inpu
 	git_buf buf = GIT_BUF_INIT;
 
 	cl_git_pass(git__percent_decode(&buf, input));
-	cl_assert_strequal(expected_result, git_buf_cstr(&buf));
+	cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
 
 	git_buf_free(&buf);
 }
@@ -306,7 +308,7 @@ static void check_fromurl(const char *expected_result, const char *input, int sh
 
 	if (!should_fail) {
 		cl_git_pass(git_path_fromurl(&buf, input));
-		cl_assert_strequal(expected_result, git_buf_cstr(&buf));
+		cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
 	} else
 		cl_git_fail(git_path_fromurl(&buf, input));
 
@@ -346,7 +348,7 @@ static int check_one_walkup_step(void *ref, git_buf *path)
 {
 	check_walkup_info *info = (check_walkup_info *)ref;
 	cl_assert(info->expect[info->expect_idx] != NULL);
-	cl_assert_strequal(info->expect[info->expect_idx], path->ptr);
+	cl_assert_equal_s(info->expect[info->expect_idx], path->ptr);
 	info->expect_idx++;
 	return 0;
 }
@@ -380,7 +382,7 @@ void test_core_path__11_walkup(void)
 			git_path_walk_up(&p, root[j], check_one_walkup_step, &info)
 		);
 
-		cl_assert_strequal(p.ptr, expect[i]);
+		cl_assert_equal_s(p.ptr, expect[i]);
 
 		/* skip to next run of expectations */
 		while (expect[i] != NULL) i++;
diff --git a/tests-clar/diff/iterator.c b/tests-clar/diff/iterator.c
index 60f416f..0ec2326 100644
--- a/tests-clar/diff/iterator.c
+++ b/tests-clar/diff/iterator.c
@@ -37,7 +37,7 @@ static void tree_iterator_test(
 
 	while (entry != NULL) {
 		if (expected_values != NULL)
-			cl_assert_strequal(expected_values[count], entry->path);
+			cl_assert_equal_s(expected_values[count], entry->path);
 
 		count++;
 
@@ -192,7 +192,7 @@ static void index_iterator_test(
 
 	while (entry != NULL) {
 		if (expected_names != NULL)
-			cl_assert_strequal(expected_names[count], entry->path);
+			cl_assert_equal_s(expected_names[count], entry->path);
 
 		if (expected_oids != NULL) {
 			git_oid oid;
@@ -330,7 +330,7 @@ static void workdir_iterator_test(
 		}
 
 		if (expected_names != NULL)
-			cl_assert_strequal(expected_names[count_all], entry->path);
+			cl_assert_equal_s(expected_names[count_all], entry->path);
 
 		if (an_ignored_name && strcmp(an_ignored_name,entry->path)==0)
 			cl_assert(ignored);
diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c
index 91e1343..1e269ae 100644
--- a/tests-clar/diff/tree.c
+++ b/tests-clar/diff/tree.c
@@ -149,15 +149,15 @@ void test_diff_tree__options(void)
 			diff, &actual, diff_file_fn, diff_hunk_fn, diff_line_fn));
 
 		expected = &test_expects[i];
-		cl_assert_intequal(actual.files,     expected->files);
-		cl_assert_intequal(actual.file_adds, expected->file_adds);
- 		cl_assert_intequal(actual.file_dels, expected->file_dels);
-		cl_assert_intequal(actual.file_mods, expected->file_mods);
-		cl_assert_intequal(actual.hunks,     expected->hunks);
-		cl_assert_intequal(actual.lines,     expected->lines);
-		cl_assert_intequal(actual.line_ctxt, expected->line_ctxt);
-		cl_assert_intequal(actual.line_adds, expected->line_adds);
-		cl_assert_intequal(actual.line_dels, expected->line_dels);
+		cl_assert_equal_i(actual.files,     expected->files);
+		cl_assert_equal_i(actual.file_adds, expected->file_adds);
+ 		cl_assert_equal_i(actual.file_dels, expected->file_dels);
+		cl_assert_equal_i(actual.file_mods, expected->file_mods);
+		cl_assert_equal_i(actual.hunks,     expected->hunks);
+		cl_assert_equal_i(actual.lines,     expected->lines);
+		cl_assert_equal_i(actual.line_ctxt, expected->line_ctxt);
+		cl_assert_equal_i(actual.line_adds, expected->line_adds);
+		cl_assert_equal_i(actual.line_dels, expected->line_dels);
 
 		git_diff_list_free(diff);
 		diff = NULL;
diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c
index 2a93039..1ea1af8 100644
--- a/tests-clar/diff/workdir.c
+++ b/tests-clar/diff/workdir.c
@@ -37,19 +37,19 @@ void test_diff_workdir__to_index(void)
 	 * - git diff
 	 * - mv .git .gitted
 	 */
-	cl_assert_intequal(12, exp.files);
-	cl_assert_intequal(0, exp.file_adds);
-	cl_assert_intequal(4, exp.file_dels);
-	cl_assert_intequal(4, exp.file_mods);
-	cl_assert_intequal(1, exp.file_ignored);
-	cl_assert_intequal(3, exp.file_untracked);
-
-	cl_assert_intequal(8, exp.hunks);
-
-	cl_assert_intequal(14, exp.lines);
-	cl_assert_intequal(5, exp.line_ctxt);
-	cl_assert_intequal(4, exp.line_adds);
-	cl_assert_intequal(5, exp.line_dels);
+	cl_assert_equal_i(12, exp.files);
+	cl_assert_equal_i(0, exp.file_adds);
+	cl_assert_equal_i(4, exp.file_dels);
+	cl_assert_equal_i(4, exp.file_mods);
+	cl_assert_equal_i(1, exp.file_ignored);
+	cl_assert_equal_i(3, exp.file_untracked);
+
+	cl_assert_equal_i(8, exp.hunks);
+
+	cl_assert_equal_i(14, exp.lines);
+	cl_assert_equal_i(5, exp.line_ctxt);
+	cl_assert_equal_i(4, exp.line_adds);
+	cl_assert_equal_i(5, exp.line_dels);
 
 	git_diff_list_free(diff);
 }