Index: test/FileSystemJsObject.cpp |
=================================================================== |
--- a/test/FileSystemJsObject.cpp |
+++ b/test/FileSystemJsObject.cpp |
@@ -44,9 +44,9 @@ |
{ |
if (!success) |
throw std::runtime_error("Unable to read " + path); |
- std::stringstream* const stream = new std::stringstream; |
+ const auto stream = std::make_shared<std::stringstream>(); |
*stream << contentToRead; |
- return std::shared_ptr<std::istream>(stream); |
+ return stream; |
} |
void Write(const std::string& path, std::shared_ptr<std::istream> data) |
@@ -116,9 +116,15 @@ |
void SetUp() |
{ |
BaseJsTest::SetUp(); |
- mockFileSystem = MockFileSystemPtr(new MockFileSystem); |
+ mockFileSystem = std::make_shared<MockFileSystem>(); |
jsEngine->SetFileSystem(mockFileSystem); |
} |
+ |
+ void TearDown() |
+ { |
+ mockFileSystem.reset(); |
+ BaseJsTest::TearDown(); |
+ } |
}; |
} |