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

Unified Diff: test/DefaultFileSystem.cpp

Issue 29731562: Issue 6477 - separate done and error callbacks in IFileSystem::Read (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git@c0a6434596a83383e37678ef3b6ecef00ed6a261
Patch Set: Created March 23, 2018, 10:58 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
Index: test/DefaultFileSystem.cpp
diff --git a/test/DefaultFileSystem.cpp b/test/DefaultFileSystem.cpp
index 49493ce40e08083be122f55537376a03a7a1eb9e..65532615241ef79795070644ece5402fdbde43f1 100644
--- a/test/DefaultFileSystem.cpp
+++ b/test/DefaultFileSystem.cpp
@@ -130,16 +130,21 @@ TEST_F(DefaultFileSystemTest, WriteReadRemove)
WriteString("foo");
bool hasReadRun = false;
+ bool hasErrorRun = false;
fileSystem->Read(testFileName,
- [this, &hasReadRun](IFileSystem::IOBuffer&& content, const std::string& error)
- {
- EXPECT_TRUE(error.empty());
- EXPECT_EQ("foo", std::string(content.cbegin(), content.cend()));
- hasReadRun = true;
- });
+ [this, &hasReadRun](IFileSystem::IOBuffer&& content)
+ {
+ EXPECT_EQ("foo", std::string(content.cbegin(), content.cend()));
+ hasReadRun = true;
+ }, [&hasErrorRun](const std::string& error)
+ {
+ hasErrorRun = true;
+ });
EXPECT_FALSE(hasReadRun);
+ EXPECT_FALSE(hasErrorRun);
PumpTask();
EXPECT_TRUE(hasReadRun);
+ EXPECT_FALSE(hasErrorRun);
bool hasRemoveRun = false;
fileSystem->Remove(testFileName, [&hasRemoveRun](const std::string& error)
« test/BaseJsTest.h ('K') | « test/BaseJsTest.h ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld