rz-test: do not use rz_vector_insert if there are no tests to add (#2717)

This commit is contained in:
Riccardo Schirone 2022-06-21 18:45:23 +02:00 committed by GitHub
parent 4dfad73567
commit 87d1bc2175
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -483,7 +483,11 @@ int rz_test_main(int argc, const char **argv) {
}
}
rz_pvector_insert_range(&state.queue, 0, state.db->tests.v.a, rz_pvector_len(&state.db->tests));
if (rz_pvector_len(&state.db->tests) != 0) {
rz_pvector_insert_range(&state.queue, 0, state.db->tests.v.a, rz_pvector_len(&state.db->tests));
} else {
eprintf("No tests discovered\n");
}
if (log_mode) {
// Log mode prints the state after every completed file.