Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1525)

Side by Side Diff: chrome/browser/sync/syncable/directory_backing_store_unittest.cc

Issue 7719007: Add a gyp flag to enable dcheck by default in release without (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 } 1660 }
1661 std::string bad_data("BAD DATA"); 1661 std::string bad_data("BAD DATA");
1662 EXPECT_TRUE(file_util::WriteFile(GetDatabasePath(), bad_data.data(), 1662 EXPECT_TRUE(file_util::WriteFile(GetDatabasePath(), bad_data.data(),
1663 bad_data.size())); 1663 bad_data.size()));
1664 { 1664 {
1665 scoped_ptr<DirectoryBackingStore> dbs( 1665 scoped_ptr<DirectoryBackingStore> dbs(
1666 new DirectoryBackingStore(GetUsername(), GetDatabasePath())); 1666 new DirectoryBackingStore(GetUsername(), GetDatabasePath()));
1667 1667
1668 // In release mode, we expect the sync database to nuke itself and start 1668 // In release mode, we expect the sync database to nuke itself and start
1669 // over if it detects invalid/corrupted data. 1669 // over if it detects invalid/corrupted data.
1670 #if defined(NDEBUG) 1670 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
1671 EXPECT_TRUE(dbs->BeginLoad()); 1671 EXPECT_TRUE(dbs->BeginLoad());
1672 #elif defined(NDEBUG) && defined(DCHECK_ALWAYS_ON)
1673 EXPECT_DEATH(dbs->BeginLoad(), "stmt_");
1672 #else 1674 #else
1673 EXPECT_DEATH(dbs->BeginLoad(), "sqlite error"); 1675 EXPECT_DEATH(dbs->BeginLoad(), "sqlite error");
1674 #endif 1676 #endif
1675 } 1677 }
1676 } 1678 }
1677 1679
1678 TEST_F(DirectoryBackingStoreTest, DeleteEntries) { 1680 TEST_F(DirectoryBackingStoreTest, DeleteEntries) {
1679 SetUpCurrentDatabaseAndCheckVersion(); 1681 SetUpCurrentDatabaseAndCheckVersion();
1680 scoped_ptr<DirectoryBackingStore> dbs( 1682 scoped_ptr<DirectoryBackingStore> dbs(
1681 new DirectoryBackingStore(GetUsername(), GetDatabasePath())); 1683 new DirectoryBackingStore(GetUsername(), GetDatabasePath()));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 1716
1715 STLDeleteElements(&index); 1717 STLDeleteElements(&index);
1716 dbs->LoadEntries(&index); 1718 dbs->LoadEntries(&index);
1717 EXPECT_EQ(0U, index.size()); 1719 EXPECT_EQ(0U, index.size());
1718 1720
1719 dbs->EndLoad(); 1721 dbs->EndLoad();
1720 dbs->EndSave(); 1722 dbs->EndSave();
1721 } 1723 }
1722 1724
1723 } // namespace syncable 1725 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_notifier_impl_unittest.cc ('k') | chrome/test/automation/automation_proxy_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698