| Index: test/DefaultFileSystem.cpp |
| =================================================================== |
| --- a/test/DefaultFileSystem.cpp |
| +++ b/test/DefaultFileSystem.cpp |
| @@ -21,30 +21,28 @@ |
| namespace |
| { |
| const std::string testPath = "libadblockplus-t\xc3\xa4st-file"; |
| void WriteString(AdblockPlus::FileSystem& fileSystem, |
| const std::string& content) |
| { |
| - std::stringstream input; |
| - input << content; |
| - fileSystem.Write(testPath, input); |
| + AdblockPlus::FileSystem::IOBuffer buffer(content.cbegin(), content.cend()); |
| + fileSystem.Write(testPath, buffer); |
| } |
| } |
| TEST(DefaultFileSystemTest, WriteReadRemove) |
| { |
| AdblockPlus::DefaultFileSystem fileSystem; |
| WriteString(fileSystem, "foo"); |
| - std::stringstream output; |
| - output << fileSystem.Read(testPath)->rdbuf(); |
| + auto output = fileSystem.Read(testPath); |
| fileSystem.Remove(testPath); |
| - ASSERT_EQ("foo", output.str()); |
| + ASSERT_EQ("foo", std::string(output.cbegin(), output.cend())); |
| } |
| TEST(DefaultFileSystemTest, StatWorkingDirectory) |
| { |
| AdblockPlus::DefaultFileSystem fileSystem; |
| const AdblockPlus::FileSystem::StatResult result = fileSystem.Stat("."); |
| ASSERT_TRUE(result.exists); |
| ASSERT_TRUE(result.isDirectory); |