| Index: test/DefaultFileSystem.cpp |
| =================================================================== |
| --- a/test/DefaultFileSystem.cpp |
| +++ b/test/DefaultFileSystem.cpp |
| @@ -10,21 +10,20 @@ |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| * GNU General Public License for more details. |
| * |
| * You should have received a copy of the GNU General Public License |
| * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| */ |
| +#include <sstream> |
| #include <AdblockPlus.h> |
| #include <gtest/gtest.h> |
| -#include "../src/Utils.h" |
| - |
| namespace |
| { |
| const std::string testPath = "libadblockplus-t\xc3\xa4st-file"; |
| void WriteString(AdblockPlus::FileSystem& fileSystem, |
| const std::string& content) |
| { |
| std::tr1::shared_ptr<std::stringstream> input(new std::stringstream); |
| @@ -32,19 +31,20 @@ namespace |
| fileSystem.Write(testPath, input); |
| } |
| } |
| TEST(DefaultFileSystemTest, WriteReadRemove) |
| { |
| AdblockPlus::DefaultFileSystem fileSystem; |
| WriteString(fileSystem, "foo"); |
| - std::string output = AdblockPlus::Utils::Slurp(*fileSystem.Read(testPath)); |
| + std::stringstream output; |
| + output << fileSystem.Read(testPath)->rdbuf(); |
| fileSystem.Remove(testPath); |
| - ASSERT_EQ("foo", output); |
| + ASSERT_EQ("foo", output.str()); |
| } |
| TEST(DefaultFileSystemTest, StatWorkingDirectory) |
| { |
| AdblockPlus::DefaultFileSystem fileSystem; |
| const AdblockPlus::FileSystem::StatResult result = fileSystem.Stat("."); |
| ASSERT_TRUE(result.exists); |
| ASSERT_TRUE(result.isDirectory); |