Commit 0cee70ebb7297f155129e0d05f5a23be82231256

Edward Thomson 2014-07-01T14:09:01

Introduce cl_assert_equal_oid

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
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
diff --git a/tests/blame/blame_helpers.c b/tests/blame/blame_helpers.c
index 56240db..9bb77a5 100644
--- a/tests/blame/blame_helpers.c
+++ b/tests/blame/blame_helpers.c
@@ -48,7 +48,7 @@ void check_blame_hunk_index(git_repository *repo, git_blame *blame, int idx,
 				actual, expected);
 	}
 	cl_assert_equal_s(actual, expected);
-	cl_assert_equal_i(git_oid_cmp(&hunk->final_commit_id, &hunk->orig_commit_id), 0);
+	cl_assert_equal_oid(&hunk->final_commit_id, &hunk->orig_commit_id);
 
 
 	if (strcmp(hunk->orig_path, orig_path)) {
diff --git a/tests/checkout/binaryunicode.c b/tests/checkout/binaryunicode.c
index 1172816..27e70d3 100644
--- a/tests/checkout/binaryunicode.c
+++ b/tests/checkout/binaryunicode.c
@@ -37,12 +37,12 @@ static void execute_test(void)
 	/* Verify that the lenna.jpg file was checked out correctly */
 	cl_git_pass(git_oid_fromstr(&check, "8ab005d890fe53f65eda14b23672f60d9f4ec5a1"));
 	cl_git_pass(git_odb_hashfile(&oid, "binaryunicode/lenna.jpg", GIT_OBJ_BLOB));
-	cl_assert(git_oid_equal(&oid, &check));
+	cl_assert_equal_oid(&oid, &check);
 
 	/* Verify that the text file was checked out correctly */
 	cl_git_pass(git_oid_fromstr(&check, "965b223880dd4249e2c66a0cc0b4cffe1dc40f5a"));
 	cl_git_pass(git_odb_hashfile(&oid, "binaryunicode/utf16_withbom_noeol_crlf.txt", GIT_OBJ_BLOB));
-	cl_assert(git_oid_equal(&oid, &check));
+	cl_assert_equal_oid(&oid, &check);
 }
 
 void test_checkout_binaryunicode__noautocrlf(void)
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index 2cb7c22..cc41fdb 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -156,7 +156,7 @@ static void ensure_workdir_oid(const char *path, const char *oid_str)
 
 	cl_git_pass(git_oid_fromstr(&expected, oid_str));
 	cl_git_pass(git_repository_hashfile(&actual, g_repo, path, GIT_OBJ_BLOB, NULL));
-	cl_assert(git_oid_cmp(&expected, &actual) == 0);
+	cl_assert_equal_oid(&expected, &actual);
 }
 
 static void ensure_workdir_mode(const char *path, int mode)
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index da37bd6..0744877 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -78,6 +78,24 @@ void clar__assert_equal_file(
 	const char *file,
 	int line);
 
+GIT_INLINE(void) clar__assert_equal_oid(
+	const char *file, int line, const char *desc,
+	const git_oid *one, const git_oid *two)
+{
+	if (git_oid_cmp(one, two)) {
+		char err[] = "\"........................................\" != \"........................................\"";
+
+		git_oid_fmt(&err[1], one);
+		git_oid_fmt(&err[47], two);
+
+		clar__fail(file, line, desc, err, 1);
+	}
+}
+
+#define cl_assert_equal_oid(one, two) \
+	clar__assert_equal_oid(__FILE__, __LINE__, \
+		"OID mismatch: " #one " != " #two, (one), (two))
+
 /*
  * Some utility macros for building long strings
  */
diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c
index 4bdc6e1..131d7e4 100644
--- a/tests/clone/nonetwork.c
+++ b/tests/clone/nonetwork.c
@@ -228,7 +228,7 @@ void test_clone_nonetwork__can_detached_head(void)
 	cl_assert(git_repository_head_detached(cloned));
 
 	cl_git_pass(git_repository_head(&cloned_head, cloned));
-	cl_assert(!git_oid_cmp(git_object_id(obj), git_reference_target(cloned_head)));
+	cl_assert_equal_oid(git_object_id(obj), git_reference_target(cloned_head));
 
 	cl_git_pass(git_reflog_read(&log, cloned, "HEAD"));
 	entry = git_reflog_entry_byindex(log, 0);
diff --git a/tests/commit/commit.c b/tests/commit/commit.c
index fa181b7..f5461cf 100644
--- a/tests/commit/commit.c
+++ b/tests/commit/commit.c
@@ -43,7 +43,7 @@ void test_commit_commit__create_unexisting_update_ref(void)
 				      NULL, "some msg", tree, 1, (const git_commit **) &commit));
 
 	cl_git_pass(git_reference_lookup(&ref, _repo, "refs/heads/foo/bar"));
-	cl_assert(!git_oid_cmp(&oid, git_reference_target(ref)));
+	cl_assert_equal_oid(&oid, git_reference_target(ref));
 
 	git_tree_free(tree);
 	git_commit_free(commit);
diff --git a/tests/commit/write.c b/tests/commit/write.c
index b1cdf44..6212ef6 100644
--- a/tests/commit/write.c
+++ b/tests/commit/write.c
@@ -145,7 +145,7 @@ void test_commit_write__root(void)
 	cl_assert(git_commit_parentcount(commit) == 0);
 	cl_git_pass(git_reference_lookup(&branch, g_repo, branch_name));
 	branch_oid = git_reference_target(branch);
-	cl_git_pass(git_oid_cmp(branch_oid, &commit_id));
+	cl_assert_equal_oid(branch_oid, &commit_id);
 	cl_assert_equal_s(root_commit_message, git_commit_message(commit));
 
 	cl_git_pass(git_reflog_read(&log, g_repo, branch_name));
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index 5270079..51bdbab 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -137,9 +137,9 @@ static void assert_patch_matches_blobs(
 	cl_assert(delta != NULL);
 
 	cl_assert_equal_i(GIT_DELTA_MODIFIED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(a), &delta->old_file.id));
+	cl_assert_equal_oid(git_blob_id(a), &delta->old_file.id);
 	cl_assert_equal_sz(git_blob_rawsize(a), delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(b), &delta->new_file.id));
+	cl_assert_equal_oid(git_blob_id(b), &delta->new_file.id);
 	cl_assert_equal_sz(git_blob_rawsize(b), delta->new_file.size);
 
 	cl_assert_equal_i(hunks, (int)git_patch_num_hunks(p));
@@ -274,7 +274,7 @@ void test_diff_blob__can_compare_against_null_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_DELETED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.id));
+	cl_assert_equal_oid(git_blob_id(d), &delta->old_file.id);
 	cl_assert_equal_sz(git_blob_rawsize(d), delta->old_file.size);
 	cl_assert(git_oid_iszero(&delta->new_file.id));
 	cl_assert_equal_sz(0, delta->new_file.size);
@@ -301,7 +301,7 @@ void test_diff_blob__can_compare_against_null_blobs_with_patch(void)
 	cl_assert_equal_i(GIT_DELTA_ADDED, delta->status);
 	cl_assert(git_oid_iszero(&delta->old_file.id));
 	cl_assert_equal_sz(0, delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.id));
+	cl_assert_equal_oid(git_blob_id(d), &delta->new_file.id);
 	cl_assert_equal_sz(git_blob_rawsize(d), delta->new_file.size);
 
 	cl_assert_equal_i(1, (int)git_patch_num_hunks(p));
@@ -392,9 +392,9 @@ void test_diff_blob__can_compare_identical_blobs_with_patch(void)
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_UNMODIFIED, delta->status);
 	cl_assert_equal_sz(delta->old_file.size, git_blob_rawsize(d));
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.id));
+	cl_assert_equal_oid(git_blob_id(d), &delta->old_file.id);
 	cl_assert_equal_sz(delta->new_file.size, git_blob_rawsize(d));
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.id));
+	cl_assert_equal_oid(git_blob_id(d), &delta->new_file.id);
 
 	cl_assert_equal_i(0, (int)git_patch_num_hunks(p));
 	git_patch_free(p);
diff --git a/tests/diff/iterator.c b/tests/diff/iterator.c
index a2df1c7..26f670c 100644
--- a/tests/diff/iterator.c
+++ b/tests/diff/iterator.c
@@ -380,7 +380,7 @@ static void index_iterator_test(
 		if (expected_oids != NULL) {
 			git_oid oid;
 			cl_git_pass(git_oid_fromstr(&oid, expected_oids[count]));
-			cl_assert_equal_i(git_oid_cmp(&oid, &entry->id), 0);
+			cl_assert_equal_oid(&oid, &entry->id);
 		}
 
 		count++;
diff --git a/tests/fetchhead/nonetwork.c b/tests/fetchhead/nonetwork.c
index e7ff2ca..7b64a63 100644
--- a/tests/fetchhead/nonetwork.c
+++ b/tests/fetchhead/nonetwork.c
@@ -120,7 +120,7 @@ static int fetchhead_ref_cb(const char *name, const char *url,
 
 	expected = git_vector_get(cb_data->fetchhead_vector, cb_data->idx);
 
-	cl_assert(git_oid_cmp(&expected->oid, oid) == 0);
+	cl_assert_equal_oid(&expected->oid, oid);
 	cl_assert(expected->is_merge == is_merge);
 
 	if (expected->ref_name)
@@ -174,7 +174,7 @@ static int read_old_style_cb(const char *name, const char *url,
 
 	cl_assert(name == NULL);
 	cl_assert(url == NULL);
-	cl_assert(git_oid_cmp(&expected, oid) == 0);
+	cl_assert_equal_oid(&expected, oid);
 	cl_assert(is_merge == 1);
 
 	return 0;
@@ -201,7 +201,7 @@ static int read_type_missing(const char *ref_name, const char *remote_url,
 
 	cl_assert_equal_s("name", ref_name);
 	cl_assert_equal_s("remote_url", remote_url);
-	cl_assert(git_oid_cmp(&expected, oid) == 0);
+	cl_assert_equal_oid(&expected, oid);
 	cl_assert(is_merge == 0);
 
 	return 0;
@@ -228,7 +228,7 @@ static int read_name_missing(const char *ref_name, const char *remote_url,
 
 	cl_assert(ref_name == NULL);
 	cl_assert_equal_s("remote_url", remote_url);
-	cl_assert(git_oid_cmp(&expected, oid) == 0);
+	cl_assert_equal_oid(&expected, oid);
 	cl_assert(is_merge == 0);
 
 	return 0;
diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c
index 90aaa44..4273516 100644
--- a/tests/index/conflicts.c
+++ b/tests/index/conflicts.c
@@ -107,13 +107,13 @@ void test_index_conflicts__get(void)
 	cl_assert_equal_s("conflicts-one.txt", conflict_entry[0]->path);
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
 
 	cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1],
 		&conflict_entry[2], repo_index, "conflicts-two.txt"));
@@ -121,13 +121,13 @@ void test_index_conflicts__get(void)
 	cl_assert_equal_s("conflicts-two.txt", conflict_entry[0]->path);
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
 }
 
 void test_index_conflicts__iterate(void)
@@ -141,29 +141,29 @@ void test_index_conflicts__iterate(void)
 	cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator));
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
 
 	git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
 
 	cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator));
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[0]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[1]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
 
 	git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&conflict_entry[2]->id, &oid) == 0);
+	cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
 	cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
 
 	cl_assert(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator) == GIT_ITEROVER);
@@ -281,7 +281,7 @@ void test_index_conflicts__partial(void)
 	cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1],
 		&conflict_entry[2], repo_index, "test-one.txt"));
 
-	cl_assert(git_oid_cmp(&ancestor_entry.id, &conflict_entry[0]->id) == 0);
+	cl_assert_equal_oid(&ancestor_entry.id, &conflict_entry[0]->id);
 	cl_assert(conflict_entry[1] == NULL);
 	cl_assert(conflict_entry[2] == NULL);
 }
diff --git a/tests/index/crlf.c b/tests/index/crlf.c
index 7babd59..23f4793 100644
--- a/tests/index/crlf.c
+++ b/tests/index/crlf.c
@@ -41,7 +41,7 @@ void test_index_crlf__autocrlf_false_no_attrs(void)
 
 	cl_git_pass(git_oid_fromstr(&oid,
 		(GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__autocrlf_true_no_attrs(void)
@@ -58,7 +58,7 @@ void test_index_crlf__autocrlf_true_no_attrs(void)
 	entry = git_index_get_bypath(g_index, "newfile.txt", 0);
 
 	cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__autocrlf_input_no_attrs(void)
@@ -75,7 +75,7 @@ void test_index_crlf__autocrlf_input_no_attrs(void)
 	entry = git_index_get_bypath(g_index, "newfile.txt", 0);
 
 	cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__autocrlf_false_text_auto_attr(void)
@@ -94,7 +94,7 @@ void test_index_crlf__autocrlf_false_text_auto_attr(void)
 	entry = git_index_get_bypath(g_index, "newfile.txt", 0);
 
 	cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__autocrlf_true_text_auto_attr(void)
@@ -113,7 +113,7 @@ void test_index_crlf__autocrlf_true_text_auto_attr(void)
 	entry = git_index_get_bypath(g_index, "newfile.txt", 0);
 
 	cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__autocrlf_input_text_auto_attr(void)
@@ -132,7 +132,7 @@ void test_index_crlf__autocrlf_input_text_auto_attr(void)
 	entry = git_index_get_bypath(g_index, "newfile.txt", 0);
 
 	cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
-	cl_assert(git_oid_cmp(&oid, &entry->id) == 0);
+	cl_assert_equal_oid(&oid, &entry->id);
 }
 
 void test_index_crlf__safecrlf_true_no_attrs(void)
diff --git a/tests/index/read_tree.c b/tests/index/read_tree.c
index 6c6b401..0e18828 100644
--- a/tests/index/read_tree.c
+++ b/tests/index/read_tree.c
@@ -37,7 +37,7 @@ void test_index_read_tree__read_write_involution(void)
 	git_tree_free(tree);
 
 	cl_git_pass(git_index_write_tree(&tree_oid, index));
-	cl_assert(git_oid_cmp(&expected, &tree_oid) == 0);
+	cl_assert_equal_oid(&expected, &tree_oid);
 
 	git_index_free(index);
 	git_repository_free(repo);
diff --git a/tests/index/rename.c b/tests/index/rename.c
index b6fb61d..dd3cfa7 100644
--- a/tests/index/rename.c
+++ b/tests/index/rename.c
@@ -27,7 +27,7 @@ void test_index_rename__single_file(void)
 	cl_assert(!git_index_find(&position, index, "lame.name.txt"));
 
 	entry = git_index_get_byindex(index, position);
-	cl_assert(git_oid_cmp(&expected, &entry->id) == 0);
+	cl_assert_equal_oid(&expected, &entry->id);
 
 	/* This removes the entry from the index, but not from the object database */
 	cl_git_pass(git_index_remove(index, "lame.name.txt", 0));
@@ -41,7 +41,7 @@ void test_index_rename__single_file(void)
 	cl_assert(!git_index_find(&position, index, "fancy.name.txt"));
 
 	entry = git_index_get_byindex(index, position);
-	cl_assert(git_oid_cmp(&expected, &entry->id) == 0);
+	cl_assert_equal_oid(&expected, &entry->id);
 
 	git_index_free(index);
 	git_repository_free(repo);
diff --git a/tests/index/reuc.c b/tests/index/reuc.c
index 27240a3..0b4d71a 100644
--- a/tests/index/reuc.c
+++ b/tests/index/reuc.c
@@ -53,9 +53,9 @@ void test_index_reuc__add(void)
 	cl_assert(reuc->mode[0] == 0100644);
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &ancestor_oid) == 0);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &our_oid) == 0);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &their_oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &ancestor_oid);
+	cl_assert_equal_oid(&reuc->oid[1], &our_oid);
+	cl_assert_equal_oid(&reuc->oid[2], &their_oid);
 }
 
 void test_index_reuc__add_no_ancestor(void)
@@ -78,9 +78,9 @@ void test_index_reuc__add_no_ancestor(void)
 	cl_assert(reuc->mode[0] == 0);
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &ancestor_oid) == 0);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &our_oid) == 0);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &their_oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &ancestor_oid);
+	cl_assert_equal_oid(&reuc->oid[1], &our_oid);
+	cl_assert_equal_oid(&reuc->oid[2], &their_oid);
 }
 
 void test_index_reuc__read_bypath(void)
@@ -97,11 +97,11 @@ void test_index_reuc__read_bypath(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 
 	cl_assert(reuc = git_index_reuc_get_bypath(repo_index, "one.txt"));
 
@@ -110,11 +110,11 @@ void test_index_reuc__read_bypath(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, ONE_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, ONE_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, ONE_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 }
 
 void test_index_reuc__ignore_case(void)
@@ -142,11 +142,11 @@ void test_index_reuc__ignore_case(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 }
 
 void test_index_reuc__read_byindex(void)
@@ -163,11 +163,11 @@ void test_index_reuc__read_byindex(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, ONE_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, ONE_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, ONE_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 
 	cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1));
 
@@ -176,11 +176,11 @@ void test_index_reuc__read_byindex(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 }
 
 void test_index_reuc__updates_existing(void)
@@ -216,11 +216,11 @@ void test_index_reuc__updates_existing(void)
 
 	cl_assert_equal_s("TWO.txt", reuc->path);
 	git_oid_fromstr(&oid, TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 }
 
 void test_index_reuc__remove(void)
@@ -242,11 +242,11 @@ void test_index_reuc__remove(void)
 	cl_assert(reuc->mode[1] == 0100644);
 	cl_assert(reuc->mode[2] == 0100644);
 	git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[0], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[0], &oid);
 	git_oid_fromstr(&oid, TWO_OUR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[1], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[1], &oid);
 	git_oid_fromstr(&oid, TWO_THEIR_OID);
-	cl_assert(git_oid_cmp(&reuc->oid[2], &oid) == 0);
+	cl_assert_equal_oid(&reuc->oid[2], &oid);
 }
 
 void test_index_reuc__write(void)
diff --git a/tests/index/tests.c b/tests/index/tests.c
index fa5c0bb..3738899 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -243,11 +243,11 @@ void test_index_tests__add(void)
 	entry = git_index_get_byindex(index, 0);
 
 	/* And the built-in hashing mechanism worked as expected */
-	cl_assert(git_oid_cmp(&id1, &entry->id) == 0);
+	cl_assert_equal_oid(&id1, &entry->id);
 
 	/* Test access by path instead of index */
 	cl_assert((entry = git_index_get_bypath(index, "test.txt", 0)) != NULL);
-	cl_assert(git_oid_cmp(&id1, &entry->id) == 0);
+	cl_assert_equal_oid(&id1, &entry->id);
 
 	git_index_free(index);
 	git_repository_free(repo);
@@ -283,14 +283,14 @@ void test_index_tests__add_issue_1397(void)
 
 	/* Make sure the initial SHA-1 is correct */
 	cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL);
-	cl_assert_(git_oid_cmp(&id1, &entry->id) == 0, "first oid check");
+	cl_assert_equal_oid(&id1, &entry->id);
 
 	/* Update the index */
 	cl_git_pass(git_index_add_bypath(index, "crlf_file.txt"));
 
 	/* Check the new SHA-1 */
 	cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL);
-	cl_assert_(git_oid_cmp(&id1, &entry->id) == 0, "second oid check");
+	cl_assert_equal_oid(&id1, &entry->id);
 
 	git_index_free(index);
 }
diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c
index 62a4574..55f3824 100644
--- a/tests/merge/trees/trivial.c
+++ b/tests/merge/trees/trivial.c
@@ -259,7 +259,7 @@ void test_merge_trees_trivial__13(void)
 
 	cl_assert(entry = git_index_get_bypath(result, "modified-in-13.txt", 0));
 	cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
-	cl_assert(git_oid_cmp(&entry->id, &expected_oid) == 0);
+	cl_assert_equal_oid(&expected_oid, &entry->id);
 
 	cl_assert(git_index_reuc_entrycount(result) == 0);
 	cl_assert(merge_trivial_conflict_entrycount(result) == 0);
diff --git a/tests/notes/notes.c b/tests/notes/notes.c
index e48d9df..8b1b578 100644
--- a/tests/notes/notes.c
+++ b/tests/notes/notes.c
@@ -21,7 +21,7 @@ static void assert_note_equal(git_note *note, char *message, git_oid *note_oid) 
 	git_blob *blob;
 
 	cl_assert_equal_s(git_note_message(note), message);
-	cl_assert(!git_oid_cmp(git_note_id(note), note_oid));
+	cl_assert_equal_oid(git_note_id(note), note_oid);
 
 	cl_git_pass(git_blob_lookup(&blob, _repo, note_oid));
 	cl_assert_equal_s(git_note_message(note), (const char *)git_blob_rawcontent(blob));
@@ -61,10 +61,10 @@ static int note_list_cb(
 	cl_assert(*count < EXPECTATIONS_COUNT);
 
 	cl_git_pass(git_oid_fromstr(&expected_note_oid, list_expectations[*count].note_sha));
-	cl_assert(git_oid_cmp(&expected_note_oid, blob_id) == 0);
+	cl_assert_equal_oid(&expected_note_oid, blob_id);
 
 	cl_git_pass(git_oid_fromstr(&expected_target_oid, list_expectations[*count].annotated_object_sha));
-	cl_assert(git_oid_cmp(&expected_target_oid, annotated_obj_id) == 0);
+	cl_assert_equal_oid(&expected_target_oid, annotated_obj_id);
 
 	(*count)++;
 
@@ -290,7 +290,7 @@ void test_notes_notes__can_read_a_note_in_an_existing_fanout(void)
 	cl_git_pass(git_note_read(&note, _repo, "refs/notes/fanout", &target_oid));
 
 	cl_git_pass(git_oid_fromstr(&note_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
-	cl_assert(!git_oid_cmp(git_note_id(note), &note_oid));
+	cl_assert_equal_oid(git_note_id(note), &note_oid);
 
 	git_note_free(note);
 }
diff --git a/tests/notes/notesref.c b/tests/notes/notesref.c
index a331419..a59af20 100644
--- a/tests/notes/notesref.c
+++ b/tests/notes/notesref.c
@@ -46,13 +46,13 @@ void test_notes_notesref__config_corenotesref(void)
 
 	cl_git_pass(git_note_read(&_note, _repo, NULL, &oid));
 	cl_assert_equal_s("test123test\n", git_note_message(_note));
-	cl_assert(!git_oid_cmp(git_note_id(_note), &note_oid));
+	cl_assert_equal_oid(git_note_id(_note), &note_oid);
 
 	git_note_free(_note);
 
 	cl_git_pass(git_note_read(&_note, _repo, "refs/notes/mydefaultnotesref", &oid));
 	cl_assert_equal_s("test123test\n", git_note_message(_note));
-	cl_assert(!git_oid_cmp(git_note_id(_note), &note_oid));
+	cl_assert_equal_oid(git_note_id(_note), &note_oid);
 
 	cl_git_pass(git_note_default_ref(&default_ref, _repo));
 	cl_assert_equal_s("refs/notes/mydefaultnotesref", default_ref);
diff --git a/tests/object/lookupbypath.c b/tests/object/lookupbypath.c
index 31aac76..13cd6a1 100644
--- a/tests/object/lookupbypath.c
+++ b/tests/object/lookupbypath.c
@@ -52,16 +52,16 @@ void test_object_lookupbypath__from_root_tree(void)
 {
 	cl_git_pass(git_object_lookup_bypath(&g_actualobject, (git_object*)g_root_tree,
 				"subdir/subdir_test2.txt", GIT_OBJ_BLOB));
-	cl_assert_equal_i(0, git_oid_cmp(git_object_id(g_expectedobject),
-				git_object_id(g_actualobject)));
+	cl_assert_equal_oid(git_object_id(g_expectedobject),
+		git_object_id(g_actualobject));
 }
 
 void test_object_lookupbypath__from_head_commit(void)
 {
 	cl_git_pass(git_object_lookup_bypath(&g_actualobject, (git_object*)g_head_commit,
 				"subdir/subdir_test2.txt", GIT_OBJ_BLOB));
-	cl_assert_equal_i(0, git_oid_cmp(git_object_id(g_expectedobject),
-				git_object_id(g_actualobject)));
+	cl_assert_equal_oid(git_object_id(g_expectedobject),
+				git_object_id(g_actualobject));
 }
 
 void test_object_lookupbypath__from_subdir_tree(void)
@@ -74,8 +74,8 @@ void test_object_lookupbypath__from_subdir_tree(void)
 
 	cl_git_pass(git_object_lookup_bypath(&g_actualobject, (git_object*)tree,
 				"subdir_test2.txt", GIT_OBJ_BLOB));
-	cl_assert_equal_i(0, git_oid_cmp(git_object_id(g_expectedobject),
-				git_object_id(g_actualobject)));
+	cl_assert_equal_oid(git_object_id(g_expectedobject),
+				git_object_id(g_actualobject));
 
 	git_tree_entry_free(entry);
 	git_tree_free(tree);
diff --git a/tests/object/peel.c b/tests/object/peel.c
index b6c9c7a..6310388 100644
--- a/tests/object/peel.c
+++ b/tests/object/peel.c
@@ -29,7 +29,7 @@ static void assert_peel(
 	cl_git_pass(git_object_peel(&peeled, obj, requested_type));
 
 	cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
-	cl_assert_equal_i(0, git_oid_cmp(&expected_oid, git_object_id(peeled)));
+	cl_assert_equal_oid(&expected_oid, git_object_id(peeled));
 
 	cl_assert_equal_i(expected_type, git_object_type(peeled));
 
diff --git a/tests/odb/mixed.c b/tests/odb/mixed.c
index ceba4ec..2dad4b6 100644
--- a/tests/odb/mixed.c
+++ b/tests/odb/mixed.c
@@ -58,7 +58,7 @@ void test_odb_mixed__dup_oid_prefix_0(void) {
 	cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
 	cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
 	cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
-	cl_assert(git_oid_equal(&found, git_odb_object_id(obj)));
+	cl_assert_equal_oid(&found, git_odb_object_id(obj));
 	git_odb_object_free(obj);
 
 	strncpy(hex, "dea509d0b", sizeof(hex));
@@ -79,7 +79,7 @@ void test_odb_mixed__dup_oid_prefix_0(void) {
 	cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
 	cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
 	cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
-	cl_assert(git_oid_equal(&found, git_odb_object_id(obj)));
+	cl_assert_equal_oid(&found, git_odb_object_id(obj));
 	git_odb_object_free(obj);
 
 	strncpy(hex, "81b5bff5f", sizeof(hex));
@@ -100,7 +100,7 @@ void test_odb_mixed__dup_oid_prefix_0(void) {
 	cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
 	cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
 	cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
-	cl_assert(git_oid_equal(&found, git_odb_object_id(obj)));
+	cl_assert_equal_oid(&found, git_odb_object_id(obj));
 	git_odb_object_free(obj);
 
 	strncpy(hex, "0ddeadede", sizeof(hex));
diff --git a/tests/pack/indexer.c b/tests/pack/indexer.c
index 084f8e6..49a106d 100644
--- a/tests/pack/indexer.c
+++ b/tests/pack/indexer.c
@@ -74,7 +74,7 @@ void test_pack_indexer__fix_thin(void)
 	/* Store the missing base into your ODB so the indexer can fix the pack */
 	cl_git_pass(git_odb_write(&id, odb, base_obj, base_obj_len, GIT_OBJ_BLOB));
 	git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18");
-	cl_assert(!git_oid_cmp(&id, &should_id));
+	cl_assert_equal_oid(&should_id, &id);
 
 	cl_git_pass(git_indexer_new(&idx, ".", 0, odb, NULL, NULL));
 	cl_git_pass(git_indexer_append(idx, thin_pack, thin_pack_len, &stats));
@@ -86,7 +86,7 @@ void test_pack_indexer__fix_thin(void)
 	cl_assert_equal_i(stats.local_objects, 1);
 
 	git_oid_fromstr(&should_id, "11f0f69b334728fdd8bc86b80499f22f29d85b15");
-	cl_assert(!git_oid_cmp(git_indexer_hash(idx), &should_id));
+	cl_assert_equal_oid(&should_id, git_indexer_hash(idx));
 
 	git_indexer_free(idx);
 	git_odb_free(odb);
diff --git a/tests/refs/create.c b/tests/refs/create.c
index 50b8e84..8e4d8d7 100644
--- a/tests/refs/create.c
+++ b/tests/refs/create.c
@@ -45,7 +45,7 @@ void test_refs_create__symbolic(void)
 	cl_assert(git_reference_type(resolved_ref) == GIT_REF_OID);
 
 	/* ...and that it points to the current master tip */
-	cl_assert(git_oid_cmp(&id, git_reference_target(resolved_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(resolved_ref));
 	git_reference_free(looked_up_ref);
 	git_reference_free(resolved_ref);
 
@@ -54,7 +54,7 @@ void test_refs_create__symbolic(void)
 
 	cl_git_pass(git_reference_lookup(&looked_up_ref, repo2, new_head_tracker));
 	cl_git_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
-	cl_assert(git_oid_cmp(&id, git_reference_target(resolved_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(resolved_ref));
 
 	git_repository_free(repo2);
 
@@ -76,7 +76,7 @@ void test_refs_create__deep_symbolic(void)
 	cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL, NULL));
 	cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker));
 	cl_git_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
-	cl_assert(git_oid_cmp(&id, git_reference_target(resolved_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(resolved_ref));
 
 	git_reference_free(new_reference);
 	git_reference_free(looked_up_ref);
@@ -104,14 +104,14 @@ void test_refs_create__oid(void)
 	cl_assert_equal_s(looked_up_ref->name, new_head);
 
 	/* ...and that it points to the current master tip */
-	cl_assert(git_oid_cmp(&id, git_reference_target(looked_up_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(looked_up_ref));
 	git_reference_free(looked_up_ref);
 
 	/* Similar test with a fresh new repository */
 	cl_git_pass(git_repository_open(&repo2, "testrepo"));
 
 	cl_git_pass(git_reference_lookup(&looked_up_ref, repo2, new_head));
-	cl_assert(git_oid_cmp(&id, git_reference_target(looked_up_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(looked_up_ref));
 
 	git_repository_free(repo2);
 
diff --git a/tests/refs/createwithlog.c b/tests/refs/createwithlog.c
index 026ff6d..ab13d7d 100644
--- a/tests/refs/createwithlog.c
+++ b/tests/refs/createwithlog.c
@@ -42,7 +42,7 @@ void test_refs_createwithlog__creating_a_direct_reference_adds_a_reflog_entry(vo
 
 	entry = git_reflog_entry_byindex(reflog, 0);
 	cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_HEX_ZERO) == 0);
-	cl_assert(git_oid_cmp(&id, &entry->oid_cur) == 0);
+	cl_assert_equal_oid(&id, &entry->oid_cur);
 	cl_assert_equal_s(message, entry->msg);
 
 	git_reflog_free(reflog);
diff --git a/tests/refs/lookup.c b/tests/refs/lookup.c
index 2e31cf0..d076e49 100644
--- a/tests/refs/lookup.c
+++ b/tests/refs/lookup.c
@@ -44,7 +44,7 @@ void test_refs_lookup__oid(void)
 
 	cl_git_pass(git_reference_name_to_id(&tag, g_repo, "refs/tags/point_to_blob"));
 	cl_git_pass(git_oid_fromstr(&expected, "1385f264afb75a56a5bec74243be9b367ba4ca08"));
-	cl_assert(git_oid_cmp(&tag, &expected) == 0);
+	cl_assert_equal_oid(&expected, &tag);
 }
 
 void test_refs_lookup__namespace(void)
diff --git a/tests/refs/overwrite.c b/tests/refs/overwrite.c
index 78ce4ac..c237d76 100644
--- a/tests/refs/overwrite.c
+++ b/tests/refs/overwrite.c
@@ -78,7 +78,7 @@ void test_refs_overwrite__object_id(void)
 
 	/* Ensure it has been overwritten */
 	cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
-	cl_assert(!git_oid_cmp(&id, git_reference_target(ref)));
+	cl_assert_equal_oid(&id, git_reference_target(ref));
 
 	git_reference_free(ref);
 }
@@ -130,7 +130,7 @@ void test_refs_overwrite__symbolic_with_object_id(void)
 	/* Ensure it points to the right place */
 	cl_git_pass(git_reference_lookup(&ref, g_repo, ref_name));
 	cl_assert(git_reference_type(ref) & GIT_REF_OID);
-	cl_assert(!git_oid_cmp(git_reference_target(ref), &id));
+	cl_assert_equal_oid(&id, git_reference_target(ref));
 
 	git_reference_free(ref);
 }
diff --git a/tests/refs/peel.c b/tests/refs/peel.c
index f2fb6e2..542694c 100644
--- a/tests/refs/peel.c
+++ b/tests/refs/peel.c
@@ -33,7 +33,7 @@ static void assert_peel_generic(
 	cl_git_pass(git_reference_peel(&peeled, ref, requested_type));
 
 	cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
-	cl_assert_equal_i(0, git_oid_cmp(&expected_oid, git_object_id(peeled)));
+	cl_assert_equal_oid(&expected_oid, git_object_id(peeled));
 
 	cl_assert_equal_i(expected_type, git_object_type(peeled));
 
diff --git a/tests/refs/read.c b/tests/refs/read.c
index 52c307e..cb42a56 100644
--- a/tests/refs/read.c
+++ b/tests/refs/read.c
@@ -83,7 +83,7 @@ void test_refs_read__symbolic(void)
 	cl_assert(git_object_type(object) == GIT_OBJ_COMMIT);
 
 	git_oid_fromstr(&id, current_master_tip);
-	cl_assert(git_oid_cmp(&id, git_object_id(object)) == 0);
+	cl_assert_equal_oid(&id, git_object_id(object));
 
 	git_object_free(object);
 
@@ -111,7 +111,7 @@ void test_refs_read__nested_symbolic(void)
 	cl_assert(git_object_type(object) == GIT_OBJ_COMMIT);
 
 	git_oid_fromstr(&id, current_master_tip);
-	cl_assert(git_oid_cmp(&id, git_object_id(object)) == 0);
+	cl_assert_equal_oid(&id, git_object_id(object));
 
 	git_object_free(object);
 
@@ -130,13 +130,13 @@ void test_refs_read__head_then_master(void)
 
 	cl_git_pass(git_reference_lookup(&reference, g_repo, GIT_HEAD_FILE));
 	cl_git_pass(git_reference_resolve(&resolved_ref, reference));
-	cl_git_pass(git_oid_cmp(git_reference_target(comp_base_ref), git_reference_target(resolved_ref)));
+	cl_assert_equal_oid(git_reference_target(comp_base_ref), git_reference_target(resolved_ref));
 	git_reference_free(reference);
 	git_reference_free(resolved_ref);
 
 	cl_git_pass(git_reference_lookup(&reference, g_repo, current_head_target));
 	cl_git_pass(git_reference_resolve(&resolved_ref, reference));
-	cl_git_pass(git_oid_cmp(git_reference_target(comp_base_ref), git_reference_target(resolved_ref)));
+	cl_assert_equal_oid(git_reference_target(comp_base_ref), git_reference_target(resolved_ref));
 	git_reference_free(reference);
 	git_reference_free(resolved_ref);
 
@@ -152,7 +152,7 @@ void test_refs_read__master_then_head(void)
 	cl_git_pass(git_reference_lookup(&reference, g_repo, GIT_HEAD_FILE));
 
 	cl_git_pass(git_reference_resolve(&resolved_ref, reference));
-	cl_git_pass(git_oid_cmp(git_reference_target(master_ref), git_reference_target(resolved_ref)));
+	cl_assert_equal_oid(git_reference_target(master_ref), git_reference_target(resolved_ref));
 
 	git_reference_free(reference);
 	git_reference_free(resolved_ref);
@@ -201,7 +201,7 @@ void test_refs_read__chomped(void)
 
 	cl_git_pass(git_reference_lookup(&test, g_repo, "refs/heads/test"));
 	cl_git_pass(git_reference_lookup(&chomped, g_repo, "refs/heads/chomped"));
-	cl_git_pass(git_oid_cmp(git_reference_target(test), git_reference_target(chomped)));
+	cl_assert_equal_oid(git_reference_target(test), git_reference_target(chomped));
 
 	git_reference_free(test);
 	git_reference_free(chomped);
@@ -213,7 +213,7 @@ void test_refs_read__trailing(void)
 
 	cl_git_pass(git_reference_lookup(&test, g_repo, "refs/heads/test"));
 	cl_git_pass(git_reference_lookup(&trailing, g_repo, "refs/heads/trailing"));
-	cl_git_pass(git_oid_cmp(git_reference_target(test), git_reference_target(trailing)));
+	cl_assert_equal_oid(git_reference_target(test), git_reference_target(trailing));
 	git_reference_free(trailing);
 	cl_git_pass(git_reference_lookup(&trailing, g_repo, "FETCH_HEAD"));
 
diff --git a/tests/refs/rename.c b/tests/refs/rename.c
index 88f0afd..c7901bd 100644
--- a/tests/refs/rename.c
+++ b/tests/refs/rename.c
@@ -220,7 +220,7 @@ void test_refs_rename__force_loose_packed(void)
 	/* Check we actually renamed it */
 	cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, packed_test_head_name));
 	cl_assert_equal_s(looked_up_ref->name, packed_test_head_name);
-	cl_assert(!git_oid_cmp(&oid, git_reference_target(looked_up_ref)));
+	cl_assert_equal_oid(&oid, git_reference_target(looked_up_ref));
 	git_reference_free(looked_up_ref);
 
 	/* And that the previous one doesn't exist any longer */
@@ -245,7 +245,7 @@ void test_refs_rename__force_loose(void)
 	/* Check we actually renamed it */
 	cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, "refs/heads/test"));
 	cl_assert_equal_s(looked_up_ref->name,  "refs/heads/test");
-	cl_assert(!git_oid_cmp(&oid, git_reference_target(looked_up_ref)));
+	cl_assert_equal_oid(&oid, git_reference_target(looked_up_ref));
 	git_reference_free(looked_up_ref);
 
 	/* And that the previous one doesn't exist any longer */
diff --git a/tests/refs/settargetwithlog.c b/tests/refs/settargetwithlog.c
index 524ce77..3a33781 100644
--- a/tests/refs/settargetwithlog.c
+++ b/tests/refs/settargetwithlog.c
@@ -44,8 +44,8 @@ void test_refs_settargetwithlog__updating_a_direct_reference_adds_a_reflog_entry
 	cl_git_pass(git_reflog_read(&reflog, g_repo, br2_name));
 
 	entry = git_reflog_entry_byindex(reflog, 0);
-	cl_assert(git_oid_cmp(&current_id, &entry->oid_old) == 0);
-	cl_assert(git_oid_cmp(&target_id, &entry->oid_cur) == 0);
+	cl_assert_equal_oid(&current_id, &entry->oid_old);
+	cl_assert_equal_oid(&target_id, &entry->oid_cur);
 	cl_assert_equal_s(message, entry->msg);
 
 	git_reflog_free(reflog);
diff --git a/tests/refs/setter.c b/tests/refs/setter.c
index 9a945db..a5d073a 100644
--- a/tests/refs/setter.c
+++ b/tests/refs/setter.c
@@ -41,7 +41,7 @@ void test_refs_setter__update_direct(void)
 
 	cl_git_pass(git_reference_lookup(&test_ref, g_repo, ref_test_name));
 	cl_assert(git_reference_type(test_ref) == GIT_REF_OID);
-	cl_assert(git_oid_cmp(&id, git_reference_target(test_ref)) == 0);
+	cl_assert_equal_oid(&id, git_reference_target(test_ref));
 	git_reference_free(test_ref);
 }
 
diff --git a/tests/refs/unicode.c b/tests/refs/unicode.c
index 471b0b8..9c7527c 100644
--- a/tests/refs/unicode.c
+++ b/tests/refs/unicode.c
@@ -32,8 +32,7 @@ void test_refs_unicode__create_and_lookup(void)
 	cl_git_pass(git_repository_open(&repo2, "testrepo.git"));
 
 	cl_git_pass(git_reference_lookup(&ref2, repo2, REFNAME));
-	cl_assert_equal_i(
-		0, git_oid_cmp(git_reference_target(ref1), git_reference_target(ref2)));
+	cl_assert_equal_oid(git_reference_target(ref1), git_reference_target(ref2));
 	cl_assert_equal_s(REFNAME, git_reference_name(ref2));
 	git_reference_free(ref2);
 
@@ -43,8 +42,7 @@ void test_refs_unicode__create_and_lookup(void)
 #define REFNAME_DECOMPOSED "refs/heads/" "A" "\314\212" "ngstro" "\314\210" "m"
 
 	cl_git_pass(git_reference_lookup(&ref2, repo2, REFNAME_DECOMPOSED));
-	cl_assert_equal_i(
-		0, git_oid_cmp(git_reference_target(ref1), git_reference_target(ref2)));
+	cl_assert_equal_oid(git_reference_target(ref1), git_reference_target(ref2));
 	cl_assert_equal_s(REFNAME, git_reference_name(ref2));
 	git_reference_free(ref2);
 #endif
diff --git a/tests/repo/hashfile.c b/tests/repo/hashfile.c
index 4cc9f18..ae8e122 100644
--- a/tests/repo/hashfile.c
+++ b/tests/repo/hashfile.c
@@ -22,14 +22,14 @@ void test_repo_hashfile__simple(void)
 	/* hash with repo relative path */
 	cl_git_pass(git_odb_hashfile(&a, "status/current_file", GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, "current_file", GIT_OBJ_BLOB, NULL));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	cl_git_pass(git_buf_joinpath(&full, git_repository_workdir(_repo), "current_file"));
 
 	/* hash with full path */
 	cl_git_pass(git_odb_hashfile(&a, full.ptr, GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, full.ptr, GIT_OBJ_BLOB, NULL));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	/* hash with invalid type */
 	cl_git_fail(git_odb_hashfile(&a, full.ptr, GIT_OBJ_ANY));
@@ -58,12 +58,12 @@ void test_repo_hashfile__filtered(void)
 	/* equal hashes because filter is binary */
 	cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.bin", GIT_OBJ_BLOB, NULL));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	/* equal hashes when 'as_file' points to binary filtering */
 	cl_git_pass(git_odb_hashfile(&a, "status/testfile.txt", GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.txt", GIT_OBJ_BLOB, "foo.bin"));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	/* not equal hashes when 'as_file' points to text filtering */
 	cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
@@ -73,11 +73,11 @@ void test_repo_hashfile__filtered(void)
 	/* equal hashes when 'as_file' is empty and turns off filtering */
 	cl_git_pass(git_odb_hashfile(&a, "status/testfile.txt", GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.txt", GIT_OBJ_BLOB, ""));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	cl_git_pass(git_odb_hashfile(&a, "status/testfile.bin", GIT_OBJ_BLOB));
 	cl_git_pass(git_repository_hashfile(&b, _repo, "testfile.bin", GIT_OBJ_BLOB, ""));
-	cl_assert(git_oid_equal(&a, &b));
+	cl_assert_equal_oid(&a, &b);
 
 	/* some hash type failures */
 	cl_git_fail(git_odb_hashfile(&a, "status/testfile.txt", 0));
diff --git a/tests/repo/head.c b/tests/repo/head.c
index 79892a3..d678e15 100644
--- a/tests/repo/head.c
+++ b/tests/repo/head.c
@@ -229,13 +229,13 @@ static void test_reflog(git_repository *repo, size_t idx,
 	if (old_spec) {
 		git_object *obj;
 		cl_git_pass(git_revparse_single(&obj, repo, old_spec));
-		cl_assert_equal_i(0, git_oid_cmp(git_object_id(obj), git_reflog_entry_id_old(entry)));
+		cl_assert_equal_oid(git_object_id(obj), git_reflog_entry_id_old(entry));
 		git_object_free(obj);
 	}
 	if (new_spec) {
 		git_object *obj;
 		cl_git_pass(git_revparse_single(&obj, repo, new_spec));
-		cl_assert_equal_i(0, git_oid_cmp(git_object_id(obj), git_reflog_entry_id_new(entry)));
+		cl_assert_equal_oid(git_object_id(obj), git_reflog_entry_id_new(entry));
 		git_object_free(obj);
 	}
 
diff --git a/tests/revwalk/hidecb.c b/tests/revwalk/hidecb.c
index 26ff183..14cf39a 100644
--- a/tests/revwalk/hidecb.c
+++ b/tests/revwalk/hidecb.c
@@ -69,21 +69,15 @@ static int hide_commit_cb(const git_oid *commit_id, void *data)
 	GIT_UNUSED(commit_id);
 	GIT_UNUSED(data);
 
-	if (0 == git_oid_cmp(commit_id, &commit_ids[5]))
-		return 1;
-	else
-		return 0;
-
+	return (git_oid_cmp(commit_id, &commit_ids[5]) == 0);
 }
 
 /* In payload data, pointer to a commit id is passed */
 static int hide_commit_use_payload_cb(const git_oid *commit_id, void *data)
 {
 	git_oid *hide_commit_id = data;
-	if (git_oid_cmp(commit_id, hide_commit_id) == 0)
-		return 1;
-	else
-		return 0;
+
+	return (git_oid_cmp(commit_id, hide_commit_id) == 0);
 }
 
 void test_revwalk_hidecb__hide_all_cb(void)
@@ -170,7 +164,7 @@ void test_revwalk_hidecb__hide_some_commits(void)
 
 	i = 0;
 	while ((error = git_revwalk_next(&id, walk)) == 0) {
-		cl_assert_equal_i(git_oid_cmp(&id, &commit_ids[i]), 0);
+		cl_assert_equal_oid(&commit_ids[i], &id);
 		i++;
 	}
 
@@ -194,7 +188,7 @@ void test_revwalk_hidecb__test_payload(void)
 
 	i = 0;
 	while ((error = git_revwalk_next(&id, walk)) == 0) {
-		cl_assert_equal_i(git_oid_cmp(&id, &commit_ids[i]), 0);
+		cl_assert_equal_oid(&commit_ids[i], &id);
 		i++;
 	}
 
diff --git a/tests/revwalk/mergebase.c b/tests/revwalk/mergebase.c
index 9766350..2c7184f 100644
--- a/tests/revwalk/mergebase.c
+++ b/tests/revwalk/mergebase.c
@@ -30,7 +30,7 @@ void test_revwalk_mergebase__single1(void)
 	cl_git_pass(git_oid_fromstr(&expected, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
 
 	cl_git_pass(git_merge_base(&result, _repo, &one, &two));
-	cl_assert(git_oid_cmp(&result, &expected) == 0);
+	cl_assert_equal_oid(&expected, &result);
 
 	cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo, &one, &two));
 	cl_assert_equal_sz(ahead, 2);
@@ -51,7 +51,7 @@ void test_revwalk_mergebase__single2(void)
 	cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
 
 	cl_git_pass(git_merge_base(&result, _repo, &one, &two));
-	cl_assert(git_oid_cmp(&result, &expected) == 0);
+	cl_assert_equal_oid(&expected, &result);
 
 	cl_git_pass(git_graph_ahead_behind( &ahead, &behind, _repo, &one, &two));
 	cl_assert_equal_sz(ahead,  4);
@@ -72,10 +72,10 @@ void test_revwalk_mergebase__merged_branch(void)
 	cl_git_pass(git_oid_fromstr(&expected, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
 
 	cl_git_pass(git_merge_base(&result, _repo, &one, &two));
-	cl_assert(git_oid_cmp(&result, &expected) == 0);
+	cl_assert_equal_oid(&expected, &result);
 
 	cl_git_pass(git_merge_base(&result, _repo, &two, &one));
-	cl_assert(git_oid_cmp(&result, &expected) == 0);
+	cl_assert_equal_oid(&expected, &result);
 
 	cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo, &one, &two));
 	cl_assert_equal_sz(ahead,  0);
@@ -132,7 +132,7 @@ void test_revwalk_mergebase__prefer_youngest_merge_base(void)
 	cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
 
 	cl_git_pass(git_merge_base(&result, _repo, &one, &two));
-	cl_assert(git_oid_cmp(&result, &expected) == 0);
+	cl_assert_equal_oid(&expected, &result);
 }
 
 void test_revwalk_mergebase__no_off_by_one_missing(void)
@@ -177,7 +177,7 @@ static void assert_mergebase_many(const char *expected_sha, int count, ...)
 		cl_git_pass(git_merge_base_many(&oid, _repo, count, oids));
 		cl_git_pass(git_oid_fromstr(&expected, expected_sha));
 
-		cl_assert(git_oid_cmp(&expected, &oid) == 0);
+		cl_assert_equal_oid(&expected, &oid);
 	}
 
 	git__free(oids);
@@ -241,7 +241,7 @@ static void assert_mergebase_octopus(const char *expected_sha, int count, ...)
 		cl_git_pass(git_merge_base_octopus(&oid, _repo, count, oids));
 		cl_git_pass(git_oid_fromstr(&expected, expected_sha));
 
-		cl_assert(git_oid_cmp(&expected, &oid) == 0);
+		cl_assert_equal_oid(&expected, &oid);
 	}
 
 	git__free(oids);
diff --git a/tests/stash/drop.c b/tests/stash/drop.c
index 63ff037..89a0ade 100644
--- a/tests/stash/drop.c
+++ b/tests/stash/drop.c
@@ -115,7 +115,7 @@ void test_stash_drop__dropping_an_entry_rewrites_reflog_history(void)
 	cl_git_pass(git_reflog_read(&reflog, repo, GIT_REFS_STASH_FILE));
 	entry = git_reflog_entry_byindex(reflog, 0);
 
-	cl_assert_equal_i(0, git_oid_cmp(&oid, git_reflog_entry_id_old(entry)));
+	cl_assert_equal_oid(&oid, git_reflog_entry_id_old(entry));
 	cl_assert_equal_sz(count - 1, git_reflog_entrycount(reflog));
 
 	git_reflog_free(reflog);
@@ -147,7 +147,7 @@ void retrieve_top_stash_id(git_oid *out)
 	cl_git_pass(git_revparse_single(&top_stash, repo, "stash@{0}"));
 	cl_git_pass(git_reference_name_to_id(out, repo, GIT_REFS_STASH_FILE));
 
-	cl_assert_equal_i(true, git_oid_cmp(out, git_object_id(top_stash)) == 0);
+	cl_assert_equal_oid(out, git_object_id(top_stash));
 
 	git_object_free(top_stash);
 }
@@ -162,13 +162,13 @@ void test_stash_drop__dropping_the_top_stash_updates_the_stash_reference(void)
 	retrieve_top_stash_id(&oid);
 
 	cl_git_pass(git_revparse_single(&next_top_stash, repo, "stash@{1}"));
-	cl_assert(git_oid_cmp(&oid, git_object_id(next_top_stash)) != 0);
+	cl_assert(git_oid_cmp(&oid, git_object_id(next_top_stash)));
 
 	cl_git_pass(git_stash_drop(repo, 0));
 
 	retrieve_top_stash_id(&oid);
 
-	cl_git_pass(git_oid_cmp(&oid, git_object_id(next_top_stash)));
+	cl_assert_equal_oid(&oid, git_object_id(next_top_stash));
 
 	git_object_free(next_top_stash);
 }
diff --git a/tests/status/single.c b/tests/status/single.c
index 292c912..6efaab2 100644
--- a/tests/status/single.c
+++ b/tests/status/single.c
@@ -22,7 +22,7 @@ void test_status_single__hash_single_file(void)
 	cl_set_cleanup(&cleanup__remove_file, (void *)file_name);
 
 	cl_git_pass(git_odb_hashfile(&actual_id, file_name, GIT_OBJ_BLOB));
-	cl_assert(git_oid_cmp(&expected_id, &actual_id) == 0);
+	cl_assert_equal_oid(&expected_id, &actual_id);
 }
 
 /* test retrieving OID from an empty file apart from the ODB */
@@ -40,6 +40,6 @@ void test_status_single__hash_single_empty_file(void)
 	cl_set_cleanup(&cleanup__remove_file, (void *)file_name);
 
 	cl_git_pass(git_odb_hashfile(&actual_id, file_name, GIT_OBJ_BLOB));
-	cl_assert(git_oid_cmp(&expected_id, &actual_id) == 0);
+	cl_assert_equal_oid(&expected_id, &actual_id);
 }