aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-29 08:31:37 -0300
committerDavid Bremner <david@tethera.net>2022-09-03 08:24:43 -0300
commit84e4e130e2c920b3dee91901582c4ab6276e2630 (patch)
tree7323895279f5fac2760306cfa9d76b17d86cebf5 /test
parent8ba3057d01b11fb806581f8dc451a8891a4d4e0e (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')
-rwxr-xr-xtest/T055-path-config.sh1
-rwxr-xr-xtest/T560-lib-error.sh10
2 files changed, 6 insertions, 5 deletions
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 149aa6a1..fe295324 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -369,7 +369,6 @@ EOF
;&
mailroot_only)
test_begin_subtest "create database parent dir ($config)"
- test_subtest_known_broken
rm -r ${DATABASE_PATH}
notmuch new
test_expect_equal "$(xapian-metadata get ${XAPIAN_PATH} version)" 3
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