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

Side by Side Diff: chrome/browser/sync/util/query_helpers_unittest.cc

Issue 193103: Build sync engine as part of the browser build (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/sync/util/query_helpers.cc ('k') | chrome/browser/sync/util/sync_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/sync/util/query_helpers.h" 5 #include "chrome/browser/sync/util/query_helpers.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/sync/util/compat-file.h" 10 #include "chrome/browser/sync/util/compat_file.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using std::numeric_limits; 13 using std::numeric_limits;
14 using std::string; 14 using std::string;
15 15
16 TEST(QueryHelpers, APEncode) { 16 TEST(QueryHelpers, APEncode) {
17 string test; 17 string test;
18 char i; 18 char i;
19 for (i = numeric_limits<char>::min(); i < numeric_limits<char>::max(); ++i) 19 for (i = numeric_limits<char>::min(); i < numeric_limits<char>::max(); ++i)
20 test.push_back(i); 20 test.push_back(i);
21 test.push_back(i); 21 test.push_back(i);
22 const string encoded = APEncode(test); 22 const string encoded = APEncode(test);
23 const string decoded = APDecode(encoded); 23 const string decoded = APDecode(encoded);
24 ASSERT_EQ(test, decoded); 24 ASSERT_EQ(test, decoded);
25 } 25 }
26 26
27 TEST(QueryHelpers, TestExecFailure) { 27 TEST(QueryHelpers, TestExecFailure) {
28 sqlite3* database; 28 sqlite3* database;
29 const PathString test_database(PSTR("queryhelper_test.sqlite3")); 29 const PathString test_database(PSTR("queryhelper_test.sqlite3"));
30 PathRemove(test_database); 30 PathRemove(test_database);
31 ASSERT_EQ(SQLITE_OK, SqliteOpen(test_database, &database)); 31 ASSERT_EQ(SQLITE_OK, SqliteOpen(test_database, &database));
32 EXPECT_EQ(SQLITE_DONE, Exec(database, "CREATE TABLE test_table (idx int)")); 32 EXPECT_EQ(SQLITE_DONE, Exec(database, "CREATE TABLE test_table (idx int)"));
33 EXPECT_NE(SQLITE_DONE, Exec(database, "ALTER TABLE test_table ADD COLUMN " 33 EXPECT_NE(SQLITE_DONE, Exec(database, "ALTER TABLE test_table ADD COLUMN "
34 "broken int32 default ?", -1)); 34 "broken int32 default ?", -1));
35 PathRemove(test_database); 35 PathRemove(test_database);
36 } 36 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/query_helpers.cc ('k') | chrome/browser/sync/util/sync_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698