@@ -172,17 +172,17 @@ static void t_reftable_stack_add_one(void)
172
172
check_int (st -> readers_len , > , 0 );
173
173
174
174
#ifndef GIT_WINDOWS_NATIVE
175
- reftable_buf_addstr (& scratch , dir );
176
- reftable_buf_addstr (& scratch , "/tables.list" );
175
+ check (! reftable_buf_addstr (& scratch , dir ) );
176
+ check (! reftable_buf_addstr (& scratch , "/tables.list" ) );
177
177
err = stat (scratch .buf , & stat_result );
178
178
check (!err );
179
179
check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
180
180
181
181
reftable_buf_reset (& scratch );
182
- reftable_buf_addstr (& scratch , dir );
183
- reftable_buf_addstr (& scratch , "/" );
182
+ check (! reftable_buf_addstr (& scratch , dir ) );
183
+ check (! reftable_buf_addstr (& scratch , "/" ) );
184
184
/* do not try at home; not an external API for reftable. */
185
- reftable_buf_addstr (& scratch , st -> readers [0 ]-> name );
185
+ check (! reftable_buf_addstr (& scratch , st -> readers [0 ]-> name ) );
186
186
err = stat (scratch .buf , & stat_result );
187
187
check (!err );
188
188
check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
@@ -432,10 +432,10 @@ static void t_reftable_stack_auto_compaction_fails_gracefully(void)
432
432
* Adding a new table to the stack should not be impacted by this, even
433
433
* though auto-compaction will now fail.
434
434
*/
435
- reftable_buf_addstr (& table_path , dir );
436
- reftable_buf_addstr (& table_path , "/" );
437
- reftable_buf_addstr (& table_path , st -> readers [0 ]-> name );
438
- reftable_buf_addstr (& table_path , ".lock" );
435
+ check (! reftable_buf_addstr (& table_path , dir ) );
436
+ check (! reftable_buf_addstr (& table_path , "/" ) );
437
+ check (! reftable_buf_addstr (& table_path , st -> readers [0 ]-> name ) );
438
+ check (! reftable_buf_addstr (& table_path , ".lock" ) );
439
439
write_file_buf (table_path .buf , "" , 0 );
440
440
441
441
ref .update_index = 2 ;
@@ -575,17 +575,17 @@ static void t_reftable_stack_add(void)
575
575
}
576
576
577
577
#ifndef GIT_WINDOWS_NATIVE
578
- reftable_buf_addstr (& path , dir );
579
- reftable_buf_addstr (& path , "/tables.list" );
578
+ check (! reftable_buf_addstr (& path , dir ) );
579
+ check (! reftable_buf_addstr (& path , "/tables.list" ) );
580
580
err = stat (path .buf , & stat_result );
581
581
check (!err );
582
582
check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
583
583
584
584
reftable_buf_reset (& path );
585
- reftable_buf_addstr (& path , dir );
586
- reftable_buf_addstr (& path , "/" );
585
+ check (! reftable_buf_addstr (& path , dir ) );
586
+ check (! reftable_buf_addstr (& path , "/" ) );
587
587
/* do not try at home; not an external API for reftable. */
588
- reftable_buf_addstr (& path , st -> readers [0 ]-> name );
588
+ check (! reftable_buf_addstr (& path , st -> readers [0 ]-> name ) );
589
589
err = stat (path .buf , & stat_result );
590
590
check (!err );
591
591
check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
@@ -1078,10 +1078,10 @@ static void t_reftable_stack_auto_compaction_with_locked_tables(void)
1078
1078
* size, we expect that auto-compaction will want to compact all of the
1079
1079
* tables. Locking any of the tables will keep it from doing so.
1080
1080
*/
1081
- reftable_buf_addstr (& buf , dir );
1082
- reftable_buf_addstr (& buf , "/" );
1083
- reftable_buf_addstr (& buf , st -> readers [2 ]-> name );
1084
- reftable_buf_addstr (& buf , ".lock" );
1081
+ check (! reftable_buf_addstr (& buf , dir ) );
1082
+ check (! reftable_buf_addstr (& buf , "/" ) );
1083
+ check (! reftable_buf_addstr (& buf , st -> readers [2 ]-> name ) );
1084
+ check (! reftable_buf_addstr (& buf , ".lock" ) );
1085
1085
write_file_buf (buf .buf , "" , 0 );
1086
1086
1087
1087
/*
@@ -1164,10 +1164,10 @@ static void t_reftable_stack_compaction_with_locked_tables(void)
1164
1164
check_int (st -> merged -> readers_len , = = , 3 );
1165
1165
1166
1166
/* Lock one of the tables that we're about to compact. */
1167
- reftable_buf_addstr (& buf , dir );
1168
- reftable_buf_addstr (& buf , "/" );
1169
- reftable_buf_addstr (& buf , st -> readers [1 ]-> name );
1170
- reftable_buf_addstr (& buf , ".lock" );
1167
+ check (! reftable_buf_addstr (& buf , dir ) );
1168
+ check (! reftable_buf_addstr (& buf , "/" ) );
1169
+ check (! reftable_buf_addstr (& buf , st -> readers [1 ]-> name ) );
1170
+ check (! reftable_buf_addstr (& buf , ".lock" ) );
1171
1171
write_file_buf (buf .buf , "" , 0 );
1172
1172
1173
1173
/*
@@ -1324,13 +1324,13 @@ static void t_reftable_stack_reload_with_missing_table(void)
1324
1324
* our old readers. This should trigger a partial reload of the stack,
1325
1325
* where we try to reuse our old readers.
1326
1326
*/
1327
- reftable_buf_addstr (& content , st -> readers [0 ]-> name );
1328
- reftable_buf_addstr (& content , "\n" );
1329
- reftable_buf_addstr (& content , st -> readers [1 ]-> name );
1330
- reftable_buf_addstr (& content , "\n" );
1331
- reftable_buf_addstr (& content , "garbage\n" );
1332
- reftable_buf_addstr (& table_path , st -> list_file );
1333
- reftable_buf_addstr (& table_path , ".lock" );
1327
+ check (! reftable_buf_addstr (& content , st -> readers [0 ]-> name ) );
1328
+ check (! reftable_buf_addstr (& content , "\n" ) );
1329
+ check (! reftable_buf_addstr (& content , st -> readers [1 ]-> name ) );
1330
+ check (! reftable_buf_addstr (& content , "\n" ) );
1331
+ check (! reftable_buf_addstr (& content , "garbage\n" ) );
1332
+ check (! reftable_buf_addstr (& table_path , st -> list_file ) );
1333
+ check (! reftable_buf_addstr (& table_path , ".lock" ) );
1334
1334
write_file_buf (table_path .buf , content .buf , content .len );
1335
1335
err = rename (table_path .buf , st -> list_file );
1336
1336
check (!err );
0 commit comments