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

Unified Diff: test/Prefs.cpp

Issue 29409580: Issue 5013 - Make parameter const ref when applicable. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: the input stream is no longer const. Created April 12, 2017, 3:08 p.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 | « test/FilterEngine.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Prefs.cpp
===================================================================
--- a/test/Prefs.cpp
+++ b/test/Prefs.cpp
@@ -32,22 +32,22 @@
std::shared_ptr<std::istream> Read(const std::string& path) const
{
if (path == "prefs.json" && !prefsContents.empty())
return std::shared_ptr<std::istream>(new std::istringstream(prefsContents));
return LazyFileSystem::Read(path);
}
- void Write(const std::string& path, std::shared_ptr<std::istream> content)
+ void Write(const std::string& path, std::istream& content)
{
if (path == "prefs.json")
{
std::stringstream ss;
- ss << content->rdbuf();
+ ss << content.rdbuf();
prefsContents = ss.str();
}
else
LazyFileSystem::Write(path, content);
}
StatResult Stat(const std::string& path) const
{
@@ -209,9 +209,9 @@
ResetJsEngine();
AdblockPlus::FilterEngine::Prefs preconfiguredPrefs;
preconfiguredPrefs["suppress_first_run_page"] = jsEngine->NewValue(true);
auto filterEngine = CreateFilterEngine(preconfiguredPrefs);
ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool());
ASSERT_FALSE(filterEngine->GetPref("suppress_first_run_page")->AsBool());
}
-}
+}
« no previous file with comments | « test/FilterEngine.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld