Commit 034c02f0 authored by Timo Teräs's avatar Timo Teräs

test: don't crash if the expected files are not there

parent 9cd57a8f
......@@ -104,18 +104,22 @@ static int test_main(void *pctx, struct apk_database *db, int argc, char **argv)
/* load installed db */
if (ctx->installed_db != NULL) {
bs = apk_bstream_from_file(AT_FDCWD, ctx->installed_db);
if (bs != NULL) {
apk_db_index_read(db, bs, -1);
bs->close(bs, NULL);
}
}
/* load additional indexes */
if (ctx->repos) {
for (i = 0; i < ctx->repos->num; i++) {
bs = apk_bstream_from_file(AT_FDCWD, ctx->repos->item[i]);
if (bs != NULL) {
apk_db_index_read(db, bs, i);
bs->close(bs, NULL);
}
}
}
/* construct new world */
apk_deps_parse(db, &db->world, APK_BLOB_STR(argv[0]));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment