diff options
| author | David Bremner <david@tethera.net> | 2022-07-29 08:31:37 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-09-03 08:24:43 -0300 |
| commit | 84e4e130e2c920b3dee91901582c4ab6276e2630 (patch) | |
| tree | 7323895279f5fac2760306cfa9d76b17d86cebf5 /test/T560-lib-error.sh | |
| parent | 8ba3057d01b11fb806581f8dc451a8891a4d4e0e (diff) | |
lib/open: create database path in some cases
There is some duplication of code here, but not all of the locations
valid to find a database make sense to create. Furthermore we nead two
passes, so the control flow in _choose_database_path would get a bit
convoluted.
Diffstat (limited to 'test/T560-lib-error.sh')
| -rwxr-xr-x | test/T560-lib-error.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 30cce943..78cae1cd 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -102,16 +102,17 @@ test_C <<'EOF' int main (int argc, char** argv) { notmuch_status_t stat; - char *msg; + char *msg = NULL; stat = notmuch_database_create_with_config (NULL, "", NULL, NULL, &msg); + printf ("%s\n", notmuch_status_to_string (stat)); if (msg) fputs (msg, stderr); } EOF cat <<'EOF' >EXPECTED == stdout == +No mail root found == stderr == -Error: could not locate database. EOF test_expect_equal_file EXPECTED OUTPUT @@ -123,16 +124,17 @@ int main (int argc, char** argv) { notmuch_database_t *db; notmuch_status_t stat; - char *msg; + char *msg = NULL; stat = notmuch_database_create_with_config (argv[1], "", NULL, &db, &msg); + printf ("%d\n", stat == NOTMUCH_STATUS_SUCCESS); if (msg) fputs (msg, stderr); } EOF cat <<'EOF' >EXPECTED == stdout == +1 == stderr == -Error: database path 'CWD/nonexistent/foo' does not exist or is not a directory. EOF test_expect_equal_file EXPECTED OUTPUT |
