From 5118d5decc4eeed31ad571d6d3186a7cb1809627 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 28 Nov 2014 14:46:45 +0100 Subject: [PATCH] Refactor: Move Filesystem.h and FuseErrnoException.h to fuse package --- src/fspp/{impl => fuse}/Filesystem.h | 2 ++ src/fspp/fuse/Fuse.cpp | 16 ++++++++-------- src/fspp/fuse/Fuse.h | 2 +- src/fspp/{impl => fuse}/FuseErrnoException.h | 4 +++- src/fspp/impl/FilesystemImpl.cpp | 6 +++--- src/fspp/impl/FilesystemImpl.h | 4 ++-- src/test/fspp/fuse/BasicFuseTest.cpp | 2 +- src/test/fspp/fuse/FilesystemTest.cpp | 4 ++++ .../fspp/fuse/access/FuseAccessErrorTest.cpp | 4 ++-- .../FuseCreateAndOpenErrorTest.cpp | 4 ++-- .../fuse/fdatasync/FuseFdatasyncErrorTest.cpp | 4 ++-- .../FuseFdatasyncFileDescriptorTest.cpp | 4 ++-- src/test/fspp/fuse/flush/FuseFlushErrorTest.cpp | 4 ++-- src/test/fspp/fuse/fstat/FuseFstatErrorTest.cpp | 4 ++-- .../fspp/fuse/fstat/FuseFstatParameterTest.cpp | 4 ++-- src/test/fspp/fuse/fsync/FuseFsyncErrorTest.cpp | 4 ++-- .../fuse/fsync/FuseFsyncFileDescriptorTest.cpp | 4 ++-- .../fuse/ftruncate/FuseFTruncateErrorTest.cpp | 4 ++-- .../FuseFTruncateFileDescriptorTest.cpp | 4 ++-- src/test/fspp/fuse/lstat/FuseLstatErrorTest.cpp | 4 ++-- .../fspp/fuse/openFile/FuseOpenErrorTest.cpp | 4 ++-- src/test/fspp/fuse/read/FuseReadErrorTest.cpp | 4 ++-- .../fuse/read/FuseReadFileDescriptorTest.cpp | 4 ++-- src/test/fspp/fuse/read/FuseReadOverflowTest.cpp | 4 ++-- .../fspp/fuse/read/FuseReadReturnedDataTest.cpp | 4 ++-- .../fspp/fuse/truncate/FuseTruncateErrorTest.cpp | 4 ++-- src/test/fspp/fuse/write/FuseWriteDataTest.cpp | 4 ++-- src/test/fspp/fuse/write/FuseWriteErrorTest.cpp | 4 ++-- .../fuse/write/FuseWriteFileDescriptorTest.cpp | 4 ++-- .../fspp/fuse/write/FuseWriteOverflowTest.cpp | 4 ++-- src/test/testutils/FuseTest.cpp | 4 ++-- src/test/testutils/FuseTest.h | 6 +++--- 32 files changed, 73 insertions(+), 65 deletions(-) rename src/fspp/{impl => fuse}/Filesystem.h (98%) rename src/fspp/{impl => fuse}/FuseErrnoException.h (97%) create mode 100644 src/test/fspp/fuse/FilesystemTest.cpp diff --git a/src/fspp/impl/Filesystem.h b/src/fspp/fuse/Filesystem.h similarity index 98% rename from src/fspp/impl/Filesystem.h rename to src/fspp/fuse/Filesystem.h index e5e316d7..015e3cff 100644 --- a/src/fspp/impl/Filesystem.h +++ b/src/fspp/fuse/Filesystem.h @@ -8,6 +8,7 @@ #include namespace fspp { +namespace fuse { class Filesystem { public: virtual ~Filesystem() {} @@ -35,6 +36,7 @@ public: virtual void statfs(const boost::filesystem::path &path, struct statvfs *fsstat) = 0; }; +} } #endif diff --git a/src/fspp/fuse/Fuse.cpp b/src/fspp/fuse/Fuse.cpp index fc84a547..372bf4bc 100644 --- a/src/fspp/fuse/Fuse.cpp +++ b/src/fspp/fuse/Fuse.cpp @@ -2,8 +2,8 @@ #include #include -#include "fspp/impl/FuseErrnoException.h" -#include "fspp/impl/Filesystem.h" +#include "fspp/fuse/FuseErrnoException.h" +#include "Filesystem.h" using std::unique_ptr; using std::make_unique; @@ -223,7 +223,7 @@ int Fuse::getattr(const bf::path &path, struct stat *stbuf) { try { _fs->lstat(path, stbuf); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } @@ -243,7 +243,7 @@ int Fuse::fgetattr(const bf::path &path, struct stat *stbuf, fuse_file_info *fil try { _fs->fstat(fileinfo->fh, stbuf); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } @@ -270,7 +270,7 @@ int Fuse::mkdir(const bf::path &path, mode_t mode) { try { _fs->mkdir(path, mode); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } @@ -280,7 +280,7 @@ int Fuse::unlink(const bf::path &path) { try { _fs->unlink(path); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } @@ -289,7 +289,7 @@ int Fuse::rmdir(const bf::path &path) { try { _fs->rmdir(path); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } @@ -309,7 +309,7 @@ int Fuse::rename(const bf::path &from, const bf::path &to) { try { _fs->rename(from, to); return 0; - } catch(fspp::FuseErrnoException &e) { + } catch(fspp::fuse::FuseErrnoException &e) { return -e.getErrno(); } } diff --git a/src/fspp/fuse/Fuse.h b/src/fspp/fuse/Fuse.h index 636fe2a2..e97d624b 100644 --- a/src/fspp/fuse/Fuse.h +++ b/src/fspp/fuse/Fuse.h @@ -11,9 +11,9 @@ namespace fspp { class Device; -class Filesystem; namespace fuse { +class Filesystem; class Fuse { public: diff --git a/src/fspp/impl/FuseErrnoException.h b/src/fspp/fuse/FuseErrnoException.h similarity index 97% rename from src/fspp/impl/FuseErrnoException.h rename to src/fspp/fuse/FuseErrnoException.h index 6e8b32a2..7e73a9ff 100644 --- a/src/fspp/impl/FuseErrnoException.h +++ b/src/fspp/fuse/FuseErrnoException.h @@ -6,6 +6,7 @@ #include namespace fspp { +namespace fuse{ class FuseErrnoException: public std::runtime_error { public: @@ -35,6 +36,7 @@ inline int FuseErrnoException::getErrno() const { return _errno; } -} /* namespace fspp */ +} +} #endif /* FSPP_FUSE_FUSEERRNOEXCEPTION_H_ */ diff --git a/src/fspp/impl/FilesystemImpl.cpp b/src/fspp/impl/FilesystemImpl.cpp index 99b4fe48..e254a709 100644 --- a/src/fspp/impl/FilesystemImpl.cpp +++ b/src/fspp/impl/FilesystemImpl.cpp @@ -5,7 +5,7 @@ #include #include -#include "FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" #include "fspp/fs_interface/File.h" @@ -31,7 +31,7 @@ unique_ptr FilesystemImpl::LoadFile(const bf::path &path) { auto node = _device->Load(path); auto file = dynamic_pointer_move(node); if (!file) { - throw FuseErrnoException(EISDIR); + throw fuse::FuseErrnoException(EISDIR); } return file; } @@ -40,7 +40,7 @@ unique_ptr FilesystemImpl::LoadDir(const bf::path &path) { auto node = _device->Load(path); auto dir = dynamic_pointer_move(node); if (!dir) { - throw FuseErrnoException(ENOTDIR); + throw fuse::FuseErrnoException(ENOTDIR); } return dir; } diff --git a/src/fspp/impl/FilesystemImpl.h b/src/fspp/impl/FilesystemImpl.h index e02a9d49..0c78dff5 100644 --- a/src/fspp/impl/FilesystemImpl.h +++ b/src/fspp/impl/FilesystemImpl.h @@ -3,7 +3,7 @@ #define FSPP_IMPL_FILESYSTEMIMPL_H_ #include "FuseOpenFileList.h" -#include "Filesystem.h" +#include "fspp/fuse/Filesystem.h" #include "fspp/utils/macros.h" @@ -13,7 +13,7 @@ class File; class OpenFile; class Dir; -class FilesystemImpl: public Filesystem { +class FilesystemImpl: public fuse::Filesystem { public: FilesystemImpl(Device *device); virtual ~FilesystemImpl(); diff --git a/src/test/fspp/fuse/BasicFuseTest.cpp b/src/test/fspp/fuse/BasicFuseTest.cpp index 2615a6c4..d98bfff7 100644 --- a/src/test/fspp/fuse/BasicFuseTest.cpp +++ b/src/test/fspp/fuse/BasicFuseTest.cpp @@ -3,7 +3,7 @@ #include "test/testutils/FuseTest.h" -using namespace fspp; +using namespace fspp::fuse; using namespace fspp::fuse; using ::testing::_; diff --git a/src/test/fspp/fuse/FilesystemTest.cpp b/src/test/fspp/fuse/FilesystemTest.cpp new file mode 100644 index 00000000..d78cb35d --- /dev/null +++ b/src/test/fspp/fuse/FilesystemTest.cpp @@ -0,0 +1,4 @@ +/* + * Tests that the header can be included without needing additional header includes as dependencies. + */ +#include "fspp/fuse/Filesystem.h" diff --git a/src/test/fspp/fuse/access/FuseAccessErrorTest.cpp b/src/test/fspp/fuse/access/FuseAccessErrorTest.cpp index a819dbc9..d9d29b8d 100644 --- a/src/test/fspp/fuse/access/FuseAccessErrorTest.cpp +++ b/src/test/fspp/fuse/access/FuseAccessErrorTest.cpp @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using namespace fspp; +using namespace fspp::fuse; class FuseAccessErrorTest: public FuseAccessTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/createAndOpenFile/FuseCreateAndOpenErrorTest.cpp b/src/test/fspp/fuse/createAndOpenFile/FuseCreateAndOpenErrorTest.cpp index 6024dede..59ceff87 100644 --- a/src/test/fspp/fuse/createAndOpenFile/FuseCreateAndOpenErrorTest.cpp +++ b/src/test/fspp/fuse/createAndOpenFile/FuseCreateAndOpenErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseCreateAndOpenTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::WithParamInterface; using ::testing::Values; @@ -9,7 +9,7 @@ using ::testing::Throw; using ::testing::StrEq; using ::testing::_; -using namespace fspp; +using namespace fspp::fuse; class FuseCreateAndOpenErrorTest: public FuseCreateAndOpenTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/fdatasync/FuseFdatasyncErrorTest.cpp b/src/test/fspp/fuse/fdatasync/FuseFdatasyncErrorTest.cpp index e81e70fd..e0eec2fb 100644 --- a/src/test/fspp/fuse/fdatasync/FuseFdatasyncErrorTest.cpp +++ b/src/test/fspp/fuse/fdatasync/FuseFdatasyncErrorTest.cpp @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using namespace fspp; +using namespace fspp::fuse; class FuseFdatasyncErrorTest: public FuseFdatasyncTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/fdatasync/FuseFdatasyncFileDescriptorTest.cpp b/src/test/fspp/fuse/fdatasync/FuseFdatasyncFileDescriptorTest.cpp index 6bd7d26f..fb5c99c8 100644 --- a/src/test/fspp/fuse/fdatasync/FuseFdatasyncFileDescriptorTest.cpp +++ b/src/test/fspp/fuse/fdatasync/FuseFdatasyncFileDescriptorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFdatasyncTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -9,7 +9,7 @@ using ::testing::Values; using ::testing::Eq; using ::testing::Return; -using namespace fspp; +using namespace fspp::fuse; class FuseFdatasyncFileDescriptorTest: public FuseFdatasyncTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/flush/FuseFlushErrorTest.cpp b/src/test/fspp/fuse/flush/FuseFlushErrorTest.cpp index 91ebff85..0770d954 100644 --- a/src/test/fspp/fuse/flush/FuseFlushErrorTest.cpp +++ b/src/test/fspp/fuse/flush/FuseFlushErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFlushTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::WithParamInterface; using ::testing::StrEq; @@ -11,7 +11,7 @@ using ::testing::AtLeast; using ::testing::Values; using ::testing::_; -using fspp::FuseErrnoException; +using fspp::fuse::FuseErrnoException; class FuseFlushErrorTest: public FuseFlushTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/fstat/FuseFstatErrorTest.cpp b/src/test/fspp/fuse/fstat/FuseFstatErrorTest.cpp index 7c795229..a8b07606 100644 --- a/src/test/fspp/fuse/fstat/FuseFstatErrorTest.cpp +++ b/src/test/fspp/fuse/fstat/FuseFstatErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFstatTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Eq; using ::testing::Return; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; // Cite from FUSE documentation on the fgetattr function: // "Currently this is only called after the create() method if that is implemented (see above). diff --git a/src/test/fspp/fuse/fstat/FuseFstatParameterTest.cpp b/src/test/fspp/fuse/fstat/FuseFstatParameterTest.cpp index 23fb6c63..e0fd043f 100644 --- a/src/test/fspp/fuse/fstat/FuseFstatParameterTest.cpp +++ b/src/test/fspp/fuse/fstat/FuseFstatParameterTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFstatTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Eq; using ::testing::Return; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; // Cite from FUSE documentation on the fgetattr function: // "Currently this is only called after the create() method if that is implemented (see above). diff --git a/src/test/fspp/fuse/fsync/FuseFsyncErrorTest.cpp b/src/test/fspp/fuse/fsync/FuseFsyncErrorTest.cpp index 5901a0a7..ace07189 100644 --- a/src/test/fspp/fuse/fsync/FuseFsyncErrorTest.cpp +++ b/src/test/fspp/fuse/fsync/FuseFsyncErrorTest.cpp @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using namespace fspp; +using namespace fspp::fuse; class FuseFsyncErrorTest: public FuseFsyncTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/fsync/FuseFsyncFileDescriptorTest.cpp b/src/test/fspp/fuse/fsync/FuseFsyncFileDescriptorTest.cpp index 38eec350..d6413305 100644 --- a/src/test/fspp/fuse/fsync/FuseFsyncFileDescriptorTest.cpp +++ b/src/test/fspp/fuse/fsync/FuseFsyncFileDescriptorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFsyncTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -9,7 +9,7 @@ using ::testing::Values; using ::testing::Eq; using ::testing::Return; -using namespace fspp; +using namespace fspp::fuse; class FuseFsyncFileDescriptorTest: public FuseFsyncTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/ftruncate/FuseFTruncateErrorTest.cpp b/src/test/fspp/fuse/ftruncate/FuseFTruncateErrorTest.cpp index fb12cb28..2fbac786 100644 --- a/src/test/fspp/fuse/ftruncate/FuseFTruncateErrorTest.cpp +++ b/src/test/fspp/fuse/ftruncate/FuseFTruncateErrorTest.cpp @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using namespace fspp; +using namespace fspp::fuse; class FuseFTruncateErrorTest: public FuseFTruncateTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/ftruncate/FuseFTruncateFileDescriptorTest.cpp b/src/test/fspp/fuse/ftruncate/FuseFTruncateFileDescriptorTest.cpp index 9ccf8d64..2374bc81 100644 --- a/src/test/fspp/fuse/ftruncate/FuseFTruncateFileDescriptorTest.cpp +++ b/src/test/fspp/fuse/ftruncate/FuseFTruncateFileDescriptorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseFTruncateTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Eq; using ::testing::Return; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; class FuseFTruncateFileDescriptorTest: public FuseFTruncateTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/lstat/FuseLstatErrorTest.cpp b/src/test/fspp/fuse/lstat/FuseLstatErrorTest.cpp index f87ca39e..d2ba6b3c 100644 --- a/src/test/fspp/fuse/lstat/FuseLstatErrorTest.cpp +++ b/src/test/fspp/fuse/lstat/FuseLstatErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseLstatTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::StrEq; using ::testing::_; @@ -8,7 +8,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using fspp::FuseErrnoException; +using fspp::fuse::FuseErrnoException; class FuseLstatErrorTest: public FuseLstatTest, public WithParamInterface { public: diff --git a/src/test/fspp/fuse/openFile/FuseOpenErrorTest.cpp b/src/test/fspp/fuse/openFile/FuseOpenErrorTest.cpp index 7f53ecd0..5829dec8 100644 --- a/src/test/fspp/fuse/openFile/FuseOpenErrorTest.cpp +++ b/src/test/fspp/fuse/openFile/FuseOpenErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseOpenTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::WithParamInterface; using ::testing::Values; @@ -9,7 +9,7 @@ using ::testing::Throw; using ::testing::StrEq; using ::testing::_; -using namespace fspp; +using namespace fspp::fuse; class FuseOpenErrorTest: public FuseOpenTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/read/FuseReadErrorTest.cpp b/src/test/fspp/fuse/read/FuseReadErrorTest.cpp index 1dcbd455..14d3d16f 100644 --- a/src/test/fspp/fuse/read/FuseReadErrorTest.cpp +++ b/src/test/fspp/fuse/read/FuseReadErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseReadTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -12,7 +12,7 @@ using ::testing::Return; using ::testing::Invoke; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; class FuseReadErrorTest: public FuseReadTest, public WithParamInterface { public: diff --git a/src/test/fspp/fuse/read/FuseReadFileDescriptorTest.cpp b/src/test/fspp/fuse/read/FuseReadFileDescriptorTest.cpp index 560b9e3c..64282cdc 100644 --- a/src/test/fspp/fuse/read/FuseReadFileDescriptorTest.cpp +++ b/src/test/fspp/fuse/read/FuseReadFileDescriptorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseReadTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -11,7 +11,7 @@ using ::testing::Return; using ::testing::Invoke; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; class FuseReadFileDescriptorTest: public FuseReadTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/read/FuseReadOverflowTest.cpp b/src/test/fspp/fuse/read/FuseReadOverflowTest.cpp index 163104f8..a1bf067e 100644 --- a/src/test/fspp/fuse/read/FuseReadOverflowTest.cpp +++ b/src/test/fspp/fuse/read/FuseReadOverflowTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseReadTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -11,7 +11,7 @@ using ::testing::Action; using std::min; -using namespace fspp; +using namespace fspp::fuse; class FuseReadOverflowTest: public FuseReadTest { public: diff --git a/src/test/fspp/fuse/read/FuseReadReturnedDataTest.cpp b/src/test/fspp/fuse/read/FuseReadReturnedDataTest.cpp index eb52e614..3033ae0b 100644 --- a/src/test/fspp/fuse/read/FuseReadReturnedDataTest.cpp +++ b/src/test/fspp/fuse/read/FuseReadReturnedDataTest.cpp @@ -2,7 +2,7 @@ #include "test/testutils/VirtualTestFile.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" #include #include @@ -23,7 +23,7 @@ using std::min; using std::unique_ptr; using std::make_unique; -using namespace fspp; +using namespace fspp::fuse; // We can't test the count or size parameter directly, because fuse doesn't pass them 1:1. // It usually asks to read bigger blocks (probably does some caching). diff --git a/src/test/fspp/fuse/truncate/FuseTruncateErrorTest.cpp b/src/test/fspp/fuse/truncate/FuseTruncateErrorTest.cpp index 976b98b2..0daf39e2 100644 --- a/src/test/fspp/fuse/truncate/FuseTruncateErrorTest.cpp +++ b/src/test/fspp/fuse/truncate/FuseTruncateErrorTest.cpp @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -10,7 +10,7 @@ using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; -using namespace fspp; +using namespace fspp::fuse; class FuseTruncateErrorTest: public FuseTruncateTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/write/FuseWriteDataTest.cpp b/src/test/fspp/fuse/write/FuseWriteDataTest.cpp index 6256b93d..727f2fdb 100644 --- a/src/test/fspp/fuse/write/FuseWriteDataTest.cpp +++ b/src/test/fspp/fuse/write/FuseWriteDataTest.cpp @@ -2,7 +2,7 @@ #include "test/testutils/VirtualTestFile.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" #include #include @@ -23,7 +23,7 @@ using std::min; using std::unique_ptr; using std::make_unique; -using namespace fspp; +using namespace fspp::fuse; // We can't test the count or size parameter directly, because fuse doesn't pass them 1:1. // But we can test that the data passed to the ::write syscall is correctly written. diff --git a/src/test/fspp/fuse/write/FuseWriteErrorTest.cpp b/src/test/fspp/fuse/write/FuseWriteErrorTest.cpp index 5a737482..41dca2c6 100644 --- a/src/test/fspp/fuse/write/FuseWriteErrorTest.cpp +++ b/src/test/fspp/fuse/write/FuseWriteErrorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseWriteTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -12,7 +12,7 @@ using ::testing::Return; using ::testing::Invoke; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; class FuseWriteErrorTest: public FuseWriteTest, public WithParamInterface { public: diff --git a/src/test/fspp/fuse/write/FuseWriteFileDescriptorTest.cpp b/src/test/fspp/fuse/write/FuseWriteFileDescriptorTest.cpp index 6f92172a..6a18087a 100644 --- a/src/test/fspp/fuse/write/FuseWriteFileDescriptorTest.cpp +++ b/src/test/fspp/fuse/write/FuseWriteFileDescriptorTest.cpp @@ -1,6 +1,6 @@ #include "testutils/FuseWriteTest.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -11,7 +11,7 @@ using ::testing::Return; using ::testing::Invoke; using ::testing::Throw; -using namespace fspp; +using namespace fspp::fuse; class FuseWriteFileDescriptorTest: public FuseWriteTest, public WithParamInterface { }; diff --git a/src/test/fspp/fuse/write/FuseWriteOverflowTest.cpp b/src/test/fspp/fuse/write/FuseWriteOverflowTest.cpp index 21ffef84..36baf0c2 100644 --- a/src/test/fspp/fuse/write/FuseWriteOverflowTest.cpp +++ b/src/test/fspp/fuse/write/FuseWriteOverflowTest.cpp @@ -2,7 +2,7 @@ #include "test/testutils/VirtualTestFile.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/FuseErrnoException.h" using ::testing::_; using ::testing::StrEq; @@ -13,7 +13,7 @@ using ::testing::Action; using std::min; -using namespace fspp; +using namespace fspp::fuse; class FuseWriteOverflowTest: public FuseWriteTest { public: diff --git a/src/test/testutils/FuseTest.cpp b/src/test/testutils/FuseTest.cpp index fb99ff06..d932e52f 100644 --- a/src/test/testutils/FuseTest.cpp +++ b/src/test/testutils/FuseTest.cpp @@ -12,7 +12,7 @@ using std::make_unique; namespace bf = boost::filesystem; -using namespace fspp; +using namespace fspp::fuse; MockFilesystem::MockFilesystem() {} MockFilesystem::~MockFilesystem() {} @@ -83,7 +83,7 @@ Action FuseTest::ReturnIsDir = result->st_nlink = 1; }); -Action FuseTest::ReturnDoesntExist = Throw(fspp::FuseErrnoException(ENOENT)); +Action FuseTest::ReturnDoesntExist = Throw(fspp::fuse::FuseErrnoException(ENOENT)); void FuseTest::OnOpenReturnFileDescriptor(const char *filename, int descriptor) { EXPECT_CALL(fsimpl, openFile(StrEq(filename), _)).Times(1).WillOnce(Return(descriptor)); diff --git a/src/test/testutils/FuseTest.h b/src/test/testutils/FuseTest.h index 5eb06e89..c174b257 100644 --- a/src/test/testutils/FuseTest.h +++ b/src/test/testutils/FuseTest.h @@ -5,8 +5,8 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" -#include "fspp/impl/Filesystem.h" -#include "fspp/impl/FuseErrnoException.h" +#include "fspp/fuse/Filesystem.h" +#include "fspp/fuse/FuseErrnoException.h" #include "fspp/fuse/Fuse.h" #include @@ -32,7 +32,7 @@ } \ MOCK_METHOD4(NAME, RETURNTYPE(const char*, PARAM1, PARAM2, PARAM3)); \ -class MockFilesystem: public fspp::Filesystem { +class MockFilesystem: public fspp::fuse::Filesystem { public: MockFilesystem(); virtual ~MockFilesystem();