t/unit-tests: convert reftable record test to use clar
Adapt reftable record test file to use clar by using clar assertions where necessary. Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Seyi Kuforiji committed
Jul 24, 2025 at 15:28 UTC
2596bef5841ffa6a1454e3e5e6249de2fb695072
3 files changed
+131
-122
Makefile
-1
@@ -1383,7 +1383,6 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
1383
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/lib-oid.o
1384
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/lib-reftable-clar.o
1385
1386
-UNIT_TEST_PROGRAMS += t-reftable-record
1386
UNIT_TEST_PROGRAMS += t-reftable-stack
1387
UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
1388
UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
t/meson.build
+1
-1
@@ -13,6 +13,7 @@ clar_test_suites = [
13
'unit-tests/u-reftable-merged.c',
14
'unit-tests/u-reftable-pq.c',
15
'unit-tests/u-reftable-readwrite.c',
16
+ 'unit-tests/u-reftable-record.c',
17
'unit-tests/u-reftable-table.c',
18
'unit-tests/u-reftable-tree.c',
19
'unit-tests/u-strbuf.c',
@@ -61,7 +62,6 @@ clar_unit_tests = executable('unit-tests',
62
test('unit-tests', clar_unit_tests)
63
64
unit_test_programs = [
64
- 'unit-tests/t-reftable-record.c',
65
'unit-tests/t-reftable-stack.c',
66
]
67
t/unit-tests/u-reftable-record.c
renamed
+130
-120
@@ -6,7 +6,8 @@
6
https://developers.google.com/open-source/licenses/bsd
7
*/
8
9
-#include "test-lib.h"
9
+#include "unit-test.h"
10
+#include "lib-reftable-clar.h"
11
#include "reftable/basics.h"
12
#include "reftable/constants.h"
13
#include "reftable/record.h"
@@ -17,16 +18,17 @@ static void t_copy(struct reftable_record *rec)
18
uint8_t typ;
19
20
typ = reftable_record_type(rec);
20
- check(!reftable_record_init(©, typ));
21
+ cl_assert_equal_i(reftable_record_init(©, typ), 0);
22
reftable_record_copy_from(©, rec, REFTABLE_HASH_SIZE_SHA1);
23
/* do it twice to catch memory leaks */
24
reftable_record_copy_from(©, rec, REFTABLE_HASH_SIZE_SHA1);
24
- check(reftable_record_equal(rec, ©, REFTABLE_HASH_SIZE_SHA1));
25
+ cl_assert(reftable_record_equal(rec, ©,
26
+ REFTABLE_HASH_SIZE_SHA1) != 0);
27
28
reftable_record_release(©);
29
}
30
29
-static void t_varint_roundtrip(void)
31
+void test_reftable_record__varint_roundtrip(void)
32
{
33
uint64_t inputs[] = { 0,
34
1,
@@ -49,16 +51,16 @@ static void t_varint_roundtrip(void)
51
int n = put_var_int(&out, in);
52
uint64_t got = 0;
53
52
- check_int(n, >, 0);
54
+ cl_assert(n > 0);
55
out.len = n;
56
n = get_var_int(&got, &out);
55
- check_int(n, >, 0);
57
+ cl_assert(n > 0);
58
57
- check_int(got, ==, in);
59
+ cl_assert_equal_i(got, in);
60
}
61
}
62
61
-static void t_varint_overflow(void)
63
+void test_reftable_record__varint_overflow(void)
64
{
65
unsigned char buf[] = {
66
0xFF, 0xFF, 0xFF, 0xFF,
@@ -70,8 +72,7 @@ static void t_varint_overflow(void)
72
.len = sizeof(buf),
73
};
74
uint64_t value;
73
- int err = get_var_int(&value, &view);
74
- check_int(err, ==, -1);
75
+ cl_assert_equal_i(get_var_int(&value, &view), -1);
76
}
77
78
static void set_hash(uint8_t *h, int j)
@@ -80,7 +81,7 @@ static void set_hash(uint8_t *h, int j)
81
h[i] = (j >> i) & 0xff;
82
}
83
83
-static void t_reftable_ref_record_comparison(void)
84
+void test_reftable_record__ref_record_comparison(void)
85
{
86
struct reftable_record in[3] = {
87
{
@@ -102,21 +103,23 @@ static void t_reftable_ref_record_comparison(void)
103
};
104
int cmp;
105
105
- check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
106
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
107
- check(!cmp);
106
+ cl_assert(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1) == 0);
107
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
108
+ cl_assert(!cmp);
109
109
- check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
110
- check(!reftable_record_cmp(&in[1], &in[2], &cmp));
111
- check_int(cmp, >, 0);
110
+ cl_assert(reftable_record_equal(&in[1], &in[2],
111
+ REFTABLE_HASH_SIZE_SHA1) == 0);
112
+ cl_assert_equal_i(reftable_record_cmp(&in[1], &in[2], &cmp), 0);
113
+ cl_assert(cmp > 0);
114
115
in[1].u.ref.value_type = in[0].u.ref.value_type;
114
- check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
115
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
116
- check(!cmp);
116
+ cl_assert(reftable_record_equal(&in[0], &in[1],
117
+ REFTABLE_HASH_SIZE_SHA1) != 0);
118
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
119
+ cl_assert(!cmp);
120
}
121
119
-static void t_reftable_ref_record_compare_name(void)
122
+void test_reftable_record__ref_record_compare_name(void)
123
{
124
struct reftable_ref_record recs[3] = {
125
{
@@ -130,12 +133,15 @@ static void t_reftable_ref_record_compare_name(void)
133
},
134
};
135
133
- check_int(reftable_ref_record_compare_name(&recs[0], &recs[1]), <, 0);
134
- check_int(reftable_ref_record_compare_name(&recs[1], &recs[0]), >, 0);
135
- check_int(reftable_ref_record_compare_name(&recs[0], &recs[2]), ==, 0);
136
+ cl_assert(reftable_ref_record_compare_name(&recs[0],
137
+ &recs[1]) < 0);
138
+ cl_assert(reftable_ref_record_compare_name(&recs[1],
139
+ &recs[0]) > 0);
140
+ cl_assert_equal_i(reftable_ref_record_compare_name(&recs[0],
141
+ &recs[2]), 0);
142
}
143
138
-static void t_reftable_ref_record_roundtrip(void)
144
+void test_reftable_record__ref_record_roundtrip(void)
145
{
146
struct reftable_buf scratch = REFTABLE_BUF_INIT;
147
@@ -172,19 +178,21 @@ static void t_reftable_ref_record_roundtrip(void)
178
179
t_copy(&in);
180
175
- check_int(reftable_record_val_type(&in), ==, i);
176
- check_int(reftable_record_is_deletion(&in), ==, i == REFTABLE_REF_DELETION);
181
+ cl_assert_equal_i(reftable_record_val_type(&in), i);
182
+ cl_assert_equal_i(reftable_record_is_deletion(&in),
183
+ i == REFTABLE_REF_DELETION);
184
185
reftable_record_key(&in, &key);
186
n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
180
- check_int(n, >, 0);
187
+ cl_assert(n > 0);
188
189
/* decode into a non-zero reftable_record to test for leaks. */
190
m = reftable_record_decode(&out, key, i, dest, REFTABLE_HASH_SIZE_SHA1, &scratch);
184
- check_int(n, ==, m);
191
+ cl_assert_equal_i(n, m);
192
186
- check(reftable_ref_record_equal(&in.u.ref, &out.u.ref,
187
- REFTABLE_HASH_SIZE_SHA1));
193
+ cl_assert(reftable_ref_record_equal(&in.u.ref,
194
+ &out.u.ref,
195
+ REFTABLE_HASH_SIZE_SHA1) != 0);
196
reftable_record_release(&in);
197
198
reftable_buf_release(&key);
@@ -194,7 +202,7 @@ static void t_reftable_ref_record_roundtrip(void)
202
reftable_buf_release(&scratch);
203
}
204
197
-static void t_reftable_log_record_comparison(void)
205
+void test_reftable_record__log_record_comparison(void)
206
{
207
struct reftable_record in[3] = {
208
{
@@ -215,21 +223,24 @@ static void t_reftable_log_record_comparison(void)
223
};
224
int cmp;
225
218
- check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
219
- check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
220
- check(!reftable_record_cmp(&in[1], &in[2], &cmp));
221
- check_int(cmp, >, 0);
226
+ cl_assert_equal_i(reftable_record_equal(&in[0], &in[1],
227
+ REFTABLE_HASH_SIZE_SHA1), 0);
228
+ cl_assert_equal_i(reftable_record_equal(&in[1], &in[2],
229
+ REFTABLE_HASH_SIZE_SHA1), 0);
230
+ cl_assert_equal_i(reftable_record_cmp(&in[1], &in[2], &cmp), 0);
231
+ cl_assert(cmp > 0);
232
/* comparison should be reversed for equal keys, because
233
* comparison is now performed on the basis of update indices */
224
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
225
- check_int(cmp, <, 0);
234
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
235
+ cl_assert(cmp < 0);
236
237
in[1].u.log.update_index = in[0].u.log.update_index;
228
- check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
229
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
238
+ cl_assert(reftable_record_equal(&in[0], &in[1],
239
+ REFTABLE_HASH_SIZE_SHA1) != 0);
240
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
241
}
242
232
-static void t_reftable_log_record_compare_key(void)
243
+void test_reftable_record__log_record_compare_key(void)
244
{
245
struct reftable_log_record logs[3] = {
246
{
@@ -246,19 +257,24 @@ static void t_reftable_log_record_compare_key(void)
257
},
258
};
259
249
- check_int(reftable_log_record_compare_key(&logs[0], &logs[1]), <, 0);
250
- check_int(reftable_log_record_compare_key(&logs[1], &logs[0]), >, 0);
260
+ cl_assert(reftable_log_record_compare_key(&logs[0],
261
+ &logs[1]) < 0);
262
+ cl_assert(reftable_log_record_compare_key(&logs[1],
263
+ &logs[0]) > 0);
264
265
logs[1].update_index = logs[0].update_index;
253
- check_int(reftable_log_record_compare_key(&logs[0], &logs[1]), <, 0);
266
+ cl_assert(reftable_log_record_compare_key(&logs[0],
267
+ &logs[1]) < 0);
268
255
- check_int(reftable_log_record_compare_key(&logs[0], &logs[2]), >, 0);
256
- check_int(reftable_log_record_compare_key(&logs[2], &logs[0]), <, 0);
269
+ cl_assert(reftable_log_record_compare_key(&logs[0],
270
+ &logs[2]) > 0);
271
+ cl_assert(reftable_log_record_compare_key(&logs[2],
272
+ &logs[0]) < 0);
273
logs[2].update_index = logs[0].update_index;
258
- check_int(reftable_log_record_compare_key(&logs[0], &logs[2]), ==, 0);
274
+ cl_assert_equal_i(reftable_log_record_compare_key(&logs[0], &logs[2]), 0);
275
}
276
261
-static void t_reftable_log_record_roundtrip(void)
277
+void test_reftable_record__log_record_roundtrip(void)
278
{
279
struct reftable_log_record in[] = {
280
{
@@ -292,9 +308,9 @@ static void t_reftable_log_record_roundtrip(void)
308
set_hash(in[2].value.update.new_hash, 3);
309
set_hash(in[2].value.update.old_hash, 4);
310
295
- check(!reftable_log_record_is_deletion(&in[0]));
296
- check(reftable_log_record_is_deletion(&in[1]));
297
- check(!reftable_log_record_is_deletion(&in[2]));
311
+ cl_assert_equal_i(reftable_log_record_is_deletion(&in[0]), 0);
312
+ cl_assert(reftable_log_record_is_deletion(&in[1]) != 0);
313
+ cl_assert_equal_i(reftable_log_record_is_deletion(&in[2]), 0);
314
315
for (size_t i = 0; i < ARRAY_SIZE(in); i++) {
316
struct reftable_record rec = { .type = REFTABLE_BLOCK_TYPE_LOG };
@@ -328,14 +344,14 @@ static void t_reftable_log_record_roundtrip(void)
344
reftable_record_key(&rec, &key);
345
346
n = reftable_record_encode(&rec, dest, REFTABLE_HASH_SIZE_SHA1);
331
- check_int(n, >=, 0);
347
+ cl_assert(n >= 0);
348
valtype = reftable_record_val_type(&rec);
349
m = reftable_record_decode(&out, key, valtype, dest,
350
REFTABLE_HASH_SIZE_SHA1, &scratch);
335
- check_int(n, ==, m);
351
+ cl_assert_equal_i(n, m);
352
337
- check(reftable_log_record_equal(&in[i], &out.u.log,
338
- REFTABLE_HASH_SIZE_SHA1));
353
+ cl_assert(reftable_log_record_equal(&in[i], &out.u.log,
354
+ REFTABLE_HASH_SIZE_SHA1) != 0);
355
reftable_log_record_release(&in[i]);
356
reftable_buf_release(&key);
357
reftable_record_release(&out);
@@ -344,7 +360,7 @@ static void t_reftable_log_record_roundtrip(void)
360
reftable_buf_release(&scratch);
361
}
362
347
-static void t_key_roundtrip(void)
363
+void test_reftable_record__key_roundtrip(void)
364
{
365
uint8_t buffer[1024] = { 0 };
366
struct string_view dest = {
@@ -359,25 +375,28 @@ static void t_key_roundtrip(void)
375
int n, m;
376
uint8_t rt_extra;
377
362
- check(!reftable_buf_addstr(&last_key, "refs/heads/master"));
363
- check(!reftable_buf_addstr(&key, "refs/tags/bla"));
378
+ cl_assert_equal_i(reftable_buf_addstr(&last_key,
379
+ "refs/heads/master"), 0);
380
+ cl_assert_equal_i(reftable_buf_addstr(&key,
381
+ "refs/tags/bla"), 0);
382
extra = 6;
383
n = reftable_encode_key(&restart, dest, last_key, key, extra);
366
- check(!restart);
367
- check_int(n, >, 0);
384
+ cl_assert(!restart);
385
+ cl_assert(n > 0);
386
369
- check(!reftable_buf_addstr(&roundtrip, "refs/heads/master"));
387
+ cl_assert_equal_i(reftable_buf_addstr(&roundtrip,
388
+ "refs/heads/master"), 0);
389
m = reftable_decode_key(&roundtrip, &rt_extra, dest);
371
- check_int(n, ==, m);
372
- check(!reftable_buf_cmp(&key, &roundtrip));
373
- check_int(rt_extra, ==, extra);
390
+ cl_assert_equal_i(n, m);
391
+ cl_assert_equal_i(reftable_buf_cmp(&key, &roundtrip), 0);
392
+ cl_assert_equal_i(rt_extra, extra);
393
394
reftable_buf_release(&last_key);
395
reftable_buf_release(&key);
396
reftable_buf_release(&roundtrip);
397
}
398
380
-static void t_reftable_obj_record_comparison(void)
399
+void test_reftable_record__obj_record_comparison(void)
400
{
401
402
uint8_t id_bytes[] = { 0, 1, 2, 3, 4, 5, 6 };
@@ -405,21 +424,23 @@ static void t_reftable_obj_record_comparison(void)
424
};
425
int cmp;
426
408
- check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
409
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
410
- check(!cmp);
427
+ cl_assert_equal_i(reftable_record_equal(&in[0], &in[1],
428
+ REFTABLE_HASH_SIZE_SHA1), 0);
429
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
430
+ cl_assert(!cmp);
431
412
- check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
413
- check(!reftable_record_cmp(&in[1], &in[2], &cmp));
414
- check_int(cmp, >, 0);
432
+ cl_assert_equal_i(reftable_record_equal(&in[1], &in[2],
433
+ REFTABLE_HASH_SIZE_SHA1), 0);
434
+ cl_assert_equal_i(reftable_record_cmp(&in[1], &in[2], &cmp), 0);
435
+ cl_assert(cmp > 0);
436
437
in[1].u.obj.offset_len = in[0].u.obj.offset_len;
417
- check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
418
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
419
- check(!cmp);
438
+ cl_assert(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1) != 0);
439
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
440
+ cl_assert(!cmp);
441
}
442
422
-static void t_reftable_obj_record_roundtrip(void)
443
+void test_reftable_record__obj_record_roundtrip(void)
444
{
445
uint8_t testHash1[REFTABLE_HASH_SIZE_SHA1] = { 1, 2, 3, 4, 0 };
446
uint64_t till9[] = { 1, 2, 3, 4, 500, 600, 700, 800, 9000 };
@@ -460,17 +481,18 @@ static void t_reftable_obj_record_roundtrip(void)
481
int n, m;
482
uint8_t extra;
483
463
- check(!reftable_record_is_deletion(&in));
484
+ cl_assert_equal_i(reftable_record_is_deletion(&in), 0);
485
t_copy(&in);
486
reftable_record_key(&in, &key);
487
n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
467
- check_int(n, >, 0);
488
+ cl_assert(n > 0);
489
extra = reftable_record_val_type(&in);
490
m = reftable_record_decode(&out, key, extra, dest,
491
REFTABLE_HASH_SIZE_SHA1, &scratch);
471
- check_int(n, ==, m);
492
+ cl_assert_equal_i(n, m);
493
473
- check(reftable_record_equal(&in, &out, REFTABLE_HASH_SIZE_SHA1));
494
+ cl_assert(reftable_record_equal(&in, &out,
495
+ REFTABLE_HASH_SIZE_SHA1) != 0);
496
reftable_buf_release(&key);
497
reftable_record_release(&out);
498
}
@@ -478,7 +500,7 @@ static void t_reftable_obj_record_roundtrip(void)
500
reftable_buf_release(&scratch);
501
}
502
481
-static void t_reftable_index_record_comparison(void)
503
+void test_reftable_record__index_record_comparison(void)
504
{
505
struct reftable_record in[3] = {
506
{
@@ -499,28 +521,33 @@ static void t_reftable_index_record_comparison(void)
521
};
522
int cmp;
523
502
- check(!reftable_buf_addstr(&in[0].u.idx.last_key, "refs/heads/master"));
503
- check(!reftable_buf_addstr(&in[1].u.idx.last_key, "refs/heads/master"));
504
- check(!reftable_buf_addstr(&in[2].u.idx.last_key, "refs/heads/branch"));
524
+ cl_assert_equal_i(reftable_buf_addstr(&in[0].u.idx.last_key,
525
+ "refs/heads/master"), 0);
526
+ cl_assert_equal_i(reftable_buf_addstr(&in[1].u.idx.last_key, "refs/heads/master"), 0);
527
+ cl_assert(reftable_buf_addstr(&in[2].u.idx.last_key,
528
+ "refs/heads/branch") == 0);
529
506
- check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
507
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
508
- check(!cmp);
530
+ cl_assert_equal_i(reftable_record_equal(&in[0], &in[1],
531
+ REFTABLE_HASH_SIZE_SHA1), 0);
532
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
533
+ cl_assert(!cmp);
534
510
- check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
511
- check(!reftable_record_cmp(&in[1], &in[2], &cmp));
512
- check_int(cmp, >, 0);
535
+ cl_assert_equal_i(reftable_record_equal(&in[1], &in[2],
536
+ REFTABLE_HASH_SIZE_SHA1), 0);
537
+ cl_assert_equal_i(reftable_record_cmp(&in[1], &in[2], &cmp), 0);
538
+ cl_assert(cmp > 0);
539
540
in[1].u.idx.offset = in[0].u.idx.offset;
515
- check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
516
- check(!reftable_record_cmp(&in[0], &in[1], &cmp));
517
- check(!cmp);
541
+ cl_assert(reftable_record_equal(&in[0], &in[1],
542
+ REFTABLE_HASH_SIZE_SHA1) != 0);
543
+ cl_assert_equal_i(reftable_record_cmp(&in[0], &in[1], &cmp), 0);
544
+ cl_assert(!cmp);
545
546
for (size_t i = 0; i < ARRAY_SIZE(in); i++)
547
reftable_record_release(&in[i]);
548
}
549
523
-static void t_reftable_index_record_roundtrip(void)
550
+void test_reftable_record__index_record_roundtrip(void)
551
{
552
struct reftable_record in = {
553
.type = REFTABLE_BLOCK_TYPE_INDEX,
@@ -543,43 +570,26 @@ static void t_reftable_index_record_roundtrip(void)
570
int n, m;
571
uint8_t extra;
572
546
- check(!reftable_buf_addstr(&in.u.idx.last_key, "refs/heads/master"));
573
+ cl_assert_equal_i(reftable_buf_addstr(&in.u.idx.last_key,
574
+ "refs/heads/master"), 0);
575
reftable_record_key(&in, &key);
576
t_copy(&in);
577
550
- check(!reftable_record_is_deletion(&in));
551
- check(!reftable_buf_cmp(&key, &in.u.idx.last_key));
578
+ cl_assert_equal_i(reftable_record_is_deletion(&in), 0);
579
+ cl_assert_equal_i(reftable_buf_cmp(&key, &in.u.idx.last_key), 0);
580
n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
553
- check_int(n, >, 0);
581
+ cl_assert(n > 0);
582
583
extra = reftable_record_val_type(&in);
556
- m = reftable_record_decode(&out, key, extra, dest, REFTABLE_HASH_SIZE_SHA1,
557
- &scratch);
558
- check_int(m, ==, n);
584
+ m = reftable_record_decode(&out, key, extra, dest,
585
+ REFTABLE_HASH_SIZE_SHA1, &scratch);
586
+ cl_assert_equal_i(m, n);
587
560
- check(reftable_record_equal(&in, &out, REFTABLE_HASH_SIZE_SHA1));
588
+ cl_assert(reftable_record_equal(&in, &out,
589
+ REFTABLE_HASH_SIZE_SHA1) != 0);
590
591
reftable_record_release(&out);
592
reftable_buf_release(&key);
593
reftable_buf_release(&scratch);
594
reftable_buf_release(&in.u.idx.last_key);
595
}
567
-
568
-int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
569
-{
570
- TEST(t_reftable_ref_record_comparison(), "comparison operations work on ref record");
571
- TEST(t_reftable_log_record_comparison(), "comparison operations work on log record");
572
- TEST(t_reftable_index_record_comparison(), "comparison operations work on index record");
573
- TEST(t_reftable_obj_record_comparison(), "comparison operations work on obj record");
574
- TEST(t_reftable_ref_record_compare_name(), "reftable_ref_record_compare_name works");
575
- TEST(t_reftable_log_record_compare_key(), "reftable_log_record_compare_key works");
576
- TEST(t_reftable_log_record_roundtrip(), "record operations work on log record");
577
- TEST(t_reftable_ref_record_roundtrip(), "record operations work on ref record");
578
- TEST(t_varint_roundtrip(), "put_var_int and get_var_int work");
579
- TEST(t_varint_overflow(), "get_var_int notices an integer overflow");
580
- TEST(t_key_roundtrip(), "reftable_encode_key and reftable_decode_key work");
581
- TEST(t_reftable_obj_record_roundtrip(), "record operations work on obj record");
582
- TEST(t_reftable_index_record_roundtrip(), "record operations work on index record");
583
-
584
- return test_done();
585
-}