@@ -172,17 +172,17 @@ static void t_reftable_stack_add_one(void)
172172 check_int (st -> readers_len , > , 0 );
173173
174174#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" ) );
177177 err = stat (scratch .buf , & stat_result );
178178 check (!err );
179179 check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
180180
181181 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 , "/" ) );
184184 /* 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 ) );
186186 err = stat (scratch .buf , & stat_result );
187187 check (!err );
188188 check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
@@ -432,10 +432,10 @@ static void t_reftable_stack_auto_compaction_fails_gracefully(void)
432432 * Adding a new table to the stack should not be impacted by this, even
433433 * though auto-compaction will now fail.
434434 */
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" ) );
439439 write_file_buf (table_path .buf , "" , 0 );
440440
441441 ref .update_index = 2 ;
@@ -575,17 +575,17 @@ static void t_reftable_stack_add(void)
575575 }
576576
577577#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" ) );
580580 err = stat (path .buf , & stat_result );
581581 check (!err );
582582 check_int ((stat_result .st_mode & 0777 ), = = , opts .default_permissions );
583583
584584 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 , "/" ) );
587587 /* 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 ) );
589589 err = stat (path .buf , & stat_result );
590590 check (!err );
591591 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)
10781078 * size, we expect that auto-compaction will want to compact all of the
10791079 * tables. Locking any of the tables will keep it from doing so.
10801080 */
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" ) );
10851085 write_file_buf (buf .buf , "" , 0 );
10861086
10871087 /*
@@ -1164,10 +1164,10 @@ static void t_reftable_stack_compaction_with_locked_tables(void)
11641164 check_int (st -> merged -> readers_len , = = , 3 );
11651165
11661166 /* 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" ) );
11711171 write_file_buf (buf .buf , "" , 0 );
11721172
11731173 /*
@@ -1324,13 +1324,13 @@ static void t_reftable_stack_reload_with_missing_table(void)
13241324 * our old readers. This should trigger a partial reload of the stack,
13251325 * where we try to reuse our old readers.
13261326 */
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" ) );
13341334 write_file_buf (table_path .buf , content .buf , content .len );
13351335 err = rename (table_path .buf , st -> list_file );
13361336 check (!err );
0 commit comments