Basic coverage of DS_ErrorCodeToErrorMessage

This commit is contained in:
Reuben Morais 2020-05-18 17:27:27 +02:00
parent d3d5398d6b
commit afb8c55b6e
2 changed files with 8 additions and 1 deletions

View File

@ -398,7 +398,9 @@ main(int argc, char **argv)
// sphinx-doc: c_ref_model_start
int status = DS_CreateModel(model, &ctx);
if (status != 0) {
fprintf(stderr, "Could not create model.\n");
char* error = DS_ErrorCodeToErrorMessage(status);
fprintf(stderr, "Could not create model: %s\n", error);
free(error);
return 1;
}

View File

@ -367,6 +367,11 @@ run_electronjs_inference_tests()
run_basic_inference_tests()
{
set +e
deepspeech --model does_not_exist --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} 2>${TASKCLUSTER_TMP_DIR}/stderr
set -e
grep "Missing model information" ${TASKCLUSTER_TMP_DIR}/stderr
set +e
phrase_pbmodel_nolm=$(deepspeech --model ${TASKCLUSTER_TMP_DIR}/${model_name} --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} 2>${TASKCLUSTER_TMP_DIR}/stderr)
status=$?