tests: avoid build warning

Check all the functions that return a Result.
This commit is contained in:
Dirk-Jan C. Binnema
2026-08-17 21:25:54 +03:00
committed by Seth Ladygo
parent d5a48e99f7
commit bdf2c8b6b1
6 changed files with 23 additions and 21 deletions

View File

@ -1043,7 +1043,7 @@ https://trac.xapian.org/ticket/719
MemDb mdb;
Config conf{mdb};
conf.set<Config::Id::NgramsEnabled>(true);
assert_valid_result(conf.set<Config::Id::NgramsEnabled>(true));
TempDir tdir;
auto store{make_test_store(tdir.path(), test_msgs, conf)};
@ -1113,11 +1113,13 @@ Boo!
g_assert_true(msg.sexp().to_string().find("shrike") == std::string::npos);
store.update_labels(msg, Labels::parse_delta_labels("+shrike"," ").value());
assert_valid_result(store.update_labels(
msg, Labels::parse_delta_labels("+shrike"," ").value()));
g_assert_true(msg.sexp().to_string().find("shrike") != std::string::npos);
store.update_labels(msg, Labels::parse_delta_labels("-shrike"," ").value());
assert_valid_result(store.update_labels(
msg, Labels::parse_delta_labels("-shrike"," ").value()));
g_assert_true(msg.sexp().to_string().find("shrike") == std::string::npos);
}

View File

@ -64,10 +64,10 @@ test_store_reinit()
{
MemDb mdb;
Config conf{mdb};
conf.set<Config::Id::MaxMessageSize>(1234567);
conf.set<Config::Id::BatchSize>(7654321);
conf.set<Config::Id::PersonalAddresses>(
StringVec{ "foo@example.com", "bar@example.com" });
assert_valid_result(conf.set<Config::Id::MaxMessageSize>(1234567));
assert_valid_result(conf.set<Config::Id::BatchSize>(7654321));
assert_valid_result(conf.set<Config::Id::PersonalAddresses>(
StringVec{ "foo@example.com", "bar@example.com" }));
auto store{Store::make_new(tempdir.path(), MuTestMaildir, conf)};
assert_valid_result(store);
@ -581,7 +581,7 @@ test_store_circular_symlink()
// there will be a lot of dups....
g_assert_false(store.empty());
remove_directory(testhome);
assert_valid_result(remove_directory(testhome));
}
static void