mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
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:
committed by
Avi Kivity
parent
d8ba9678b4
commit
a548e5f5d1
@@ -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);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class tmpdir {
|
||||
fs::path _path;
|
||||
|
||||
private:
|
||||
void remove();
|
||||
void remove() noexcept;
|
||||
|
||||
public:
|
||||
tmpdir();
|
||||
|
||||
Reference in New Issue
Block a user