Added support for completely disabling noexcept using MIJIN_TEST_NO_NOEXCEPT (for testing).

This commit is contained in:
2024-08-29 00:01:23 +02:00
parent a43f92fb58
commit 9ba097fc2f
41 changed files with 643 additions and 564 deletions

View File

@@ -5,6 +5,7 @@
#define MIJIN_VIRTUAL_FILESYSTEM_RELATIVE_HPP_INCLUDED 1
#include "./filesystem.hpp"
#include "../internal/common.hpp"
namespace mijin
{
@@ -32,10 +33,10 @@ public:
explicit RelativeFileSystemAdapter(fs::path root, TArgs&&... args)
: wrapped_(std::forward<TArgs>(args)...), root_(std::move(root)) {}
RelativeFileSystemAdapter(const RelativeFileSystemAdapter&) = default;
RelativeFileSystemAdapter(RelativeFileSystemAdapter&&) noexcept = default;
RelativeFileSystemAdapter(RelativeFileSystemAdapter&&) MIJIN_NOEXCEPT = default;
RelativeFileSystemAdapter& operator=(const RelativeFileSystemAdapter&) = default;
RelativeFileSystemAdapter& operator=(RelativeFileSystemAdapter&&) noexcept = default;
RelativeFileSystemAdapter& operator=(RelativeFileSystemAdapter&&) MIJIN_NOEXCEPT = default;
std::vector<fs::path> getRoots() override;
fs::path getHomeFolder() override;
@@ -44,7 +45,7 @@ public:
Optional<fs::path> getNativePath(const fs::path& file) override;
StreamError open(const fs::path& path, FileOpenMode mode, std::unique_ptr<Stream>& outStream) override;
private:
fs::path appendPath(const fs::path& other) const noexcept;
fs::path appendPath(const fs::path& other) const MIJIN_NOEXCEPT;
};
//
@@ -94,7 +95,7 @@ StreamError RelativeFileSystemAdapter<TWrapped>::open(const fs::path& path, File
}
template<typename TWrapped>
fs::path RelativeFileSystemAdapter<TWrapped>::appendPath(const fs::path& other) const noexcept
fs::path RelativeFileSystemAdapter<TWrapped>::appendPath(const fs::path& other) const MIJIN_NOEXCEPT
{
fs::path combinedPath = root_;
if (other.is_absolute()) {