Commit fe232e08 authored by tfarina@chromium.org's avatar tfarina@chromium.org

bookmarks: Fix mistakes found by cppcheck.

bookmark_index_unittest.cc:
Summary: Function parameter 'expected_titles' should be passed by reference.
Message: Parameter 'expected_titles' is passed as a value. It could be passed as a (const) reference which is usually faster and recommended in C++.

bookmark_model_unittest.cc:
Summary: Member variable 'BookmarkModelTestWithProfile::bb_model_' is not initialized in the constructor.
Message: Member variable 'BookmarkModelTestWithProfile::bb_model_' is not initialized in the constructor.

R=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10828168

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150346 0039d316-1c4b-4281-b951-d872f2087c98
parent b69afa2b
...@@ -51,7 +51,7 @@ class BookmarkIndexTest : public testing::Test { ...@@ -51,7 +51,7 @@ class BookmarkIndexTest : public testing::Test {
} }
void ExpectMatches(const std::string& query, void ExpectMatches(const std::string& query,
const std::vector<std::string> expected_titles) { const std::vector<std::string>& expected_titles) {
std::vector<bookmark_utils::TitleMatch> matches; std::vector<bookmark_utils::TitleMatch> matches;
model_->GetBookmarksWithTitlesMatching(ASCIIToUTF16(query), 1000, &matches); model_->GetBookmarksWithTitlesMatching(ASCIIToUTF16(query), 1000, &matches);
ASSERT_EQ(expected_titles.size(), matches.size()); ASSERT_EQ(expected_titles.size(), matches.size());
......
...@@ -795,7 +795,8 @@ void PopulateBookmarkNode(TestNode* parent, ...@@ -795,7 +795,8 @@ void PopulateBookmarkNode(TestNode* parent,
class BookmarkModelTestWithProfile : public testing::Test { class BookmarkModelTestWithProfile : public testing::Test {
public: public:
BookmarkModelTestWithProfile() BookmarkModelTestWithProfile()
: ui_thread_(BrowserThread::UI, &message_loop_), : bb_model_(NULL),
ui_thread_(BrowserThread::UI, &message_loop_),
file_thread_(BrowserThread::FILE, &message_loop_) {} file_thread_(BrowserThread::FILE, &message_loop_) {}
// testing::Test: // testing::Test:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment