Skip to content

Commit

Permalink
Extra check to avoid confusing asserts when running them from the wro…
Browse files Browse the repository at this point in the history
…ng directory
  • Loading branch information
radare committed May 17, 2024
1 parent 6bb987c commit 0fb0855
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/unit/test_r2r.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ bool test_r2r_fix(void) {

R2RTestResultInfo *result0 = R_NEW0 (R2RTestResultInfo);
r_pvector_push (results, result0);
if (r_pvector_length (&db->tests) == 0) {
eprintf ("Empty tests database. Please run this binary from the test/ directory.\n");
return false;
}
result0->test = r_pvector_at (&db->tests, 0);
result0->result = R2R_TEST_RESULT_FAILED;
result0->proc_out = R_NEW0 (R2RProcessOutput);
Expand Down

0 comments on commit 0fb0855

Please sign in to comment.