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

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

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/util/query_helpers.h"
6
7 #include <limits>
8 #include <string>
9
10 #include "chrome/browser/sync/util/compat-file.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 using std::numeric_limits;
14 using std::string;
15
16 TEST(QueryHelpers, APEncode) {
17 string test;
18 char i;
19 for (i = numeric_limits<char>::min(); i < numeric_limits<char>::max(); ++i)
20 test.push_back(i);
21 test.push_back(i);
22 const string encoded = APEncode(test);
23 const string decoded = APDecode(encoded);
24 ASSERT_EQ(test, decoded);
25 }
26
27 TEST(QueryHelpers, TestExecFailure) {
28 sqlite3* database;
29 const PathString test_database(PSTR("queryhelper_test.sqlite3"));
30 PathRemove(test_database);
31 ASSERT_EQ(SQLITE_OK, SqliteOpen(test_database, &database));
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 "
34 "broken int32 default ?", -1));
35 PathRemove(test_database);
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698