test: Mark tmpdir::remove noexcept

Also disable the allocation failure injection in it.

Refs #6831.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
Message-Id: <20200729200019.250908-2-espindola@scylladb.com>
This commit is contained in:
Rafael Ávila de Espíndola
2020-07-29 13:00:19 -07:00
committed by Avi Kivity
parent d8ba9678b4
commit a548e5f5d1
2 changed files with 9 additions and 2 deletions

View File

@@ -21,7 +21,14 @@
#include "test/lib/tmpdir.hh"
void tmpdir::remove() {
#include <seastar/util/alloc_failure_injector.hh>
// This is not really noexcept. But it is used only from the
// destructor and move assignment operators which have to be
// noexcept. This is only for testing, so a std::unexpected call if if
// remove fails is fine.
void tmpdir::remove() noexcept {
memory::disable_failure_guard dfg;
if (!_path.empty()) {
fs::remove_all(_path);
}

View File

@@ -35,7 +35,7 @@ class tmpdir {
fs::path _path;
private:
void remove();
void remove() noexcept;
public:
tmpdir();