From 88339755d6cd001226e3495018cee129150b9557 Mon Sep 17 00:00:00 2001 From: marko Date: Fri, 3 May 2024 02:49:23 +0300 Subject: [PATCH] lib: refactoring for coverage --- lib/reactor/future.hh | 4 ++-- lib/reactor/io/file.cc | 6 ++---- lib/utils/log.hh | 6 ++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/reactor/future.hh b/lib/reactor/future.hh index ad0a555..e3a929e 100644 --- a/lib/reactor/future.hh +++ b/lib/reactor/future.hh @@ -371,12 +371,12 @@ private: IntrusivePtr> state; }; -template +template Future make_ready_future(Args&&... args) { return Future(IntrusivePtr>(new State(std::forward(args)...))); } -template +template Future make_exception_future(std::exception_ptr exc) { return Future(IntrusivePtr>(new State(std::move(exc)))); } diff --git a/lib/reactor/io/file.cc b/lib/reactor/io/file.cc index 1ca0a94..32379ca 100644 --- a/lib/reactor/io/file.cc +++ b/lib/reactor/io/file.cc @@ -8,8 +8,6 @@ namespace corey { namespace { -Log logger("io/file"); - } // namespace Future File::open(const char* path, int flags) { @@ -26,8 +24,8 @@ Future File::open(const char* path, int flags, mode_t mode) { constexpr int invalid_fd = -1; -File::File() noexcept : File(invalid_fd) { logger.debug("File()"); } -File::File(int fd) : _fd(fd) { logger.debug("File({})", fd); } +File::File() noexcept : File(invalid_fd) { } +File::File(int fd) : _fd(fd) {} File::File(File&& other) noexcept: _fd(other._fd) { other._fd = invalid_fd; diff --git a/lib/utils/log.hh b/lib/utils/log.hh index 83c55ad..7fbd0d0 100644 --- a/lib/utils/log.hh +++ b/lib/utils/log.hh @@ -20,11 +20,13 @@ public: error = 3 }; + std::string get_name() const { return name; } + Level get_level() const { return filter_level; } + const Sink<>& get_sink() const { return sink; } + Level set_level(Level); Sink<> set_sink(Sink<>&&); - const Sink<>& get_sink() const { return sink; } - Log(std::string_view name); Log(std::string_view, Level); Log(std::string_view, Sink<>&&);