Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/DefaultFileSystem.cpp

Issue 10488022: Added Android build target (Closed)
Patch Set: Review comments addressed Created May 24, 2013, 8:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libadblockplus.gyp ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « libadblockplus.gyp ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld