Skip to content

Commit c90be78

Browse files
avargitster
authored andcommitted
test-tool run-command: fix flip-flop init pattern
In be5d88e (test-tool run-command: learn to run (parts of) the testsuite, 2019-10-04) an init pattern was added that would use TESTSUITE_INIT, but then promptly memset() everything back to 0. We'd then set the "dup" on the two string lists. Our setting of "next" to "-1" thus did nothing, we'd reset it to "0" before using it. Let's set it to "0" instead, and trust the "STRING_LIST_INIT_DUP" to set "strdup_strings" appropriately for us. Note that while we compile this code, there's no in-tree user for the "testsuite" target being modified here anymore, see the discussion at and around <[email protected]>[1]. 1. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8b7c11b commit c90be78

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

t/helper/test-run-command.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct testsuite {
6161
int quiet, immediate, verbose, verbose_log, trace, write_junit_xml;
6262
};
6363
#define TESTSUITE_INIT \
64-
{ STRING_LIST_INIT_DUP, STRING_LIST_INIT_DUP, -1, 0, 0, 0, 0, 0, 0 }
64+
{ STRING_LIST_INIT_DUP, STRING_LIST_INIT_DUP, 0, 0, 0, 0, 0, 0, 0 }
6565

6666
static int next_test(struct child_process *cp, struct strbuf *err, void *cb,
6767
void **task_cb)
@@ -142,9 +142,6 @@ static int testsuite(int argc, const char **argv)
142142
OPT_END()
143143
};
144144

145-
memset(&suite, 0, sizeof(suite));
146-
suite.tests.strdup_strings = suite.failed.strdup_strings = 1;
147-
148145
argc = parse_options(argc, argv, NULL, options,
149146
testsuite_usage, PARSE_OPT_STOP_AT_NON_OPTION);
150147

0 commit comments

Comments
 (0)