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

Side by Side Diff: sql/test/error_callback_support.cc

Issue 17726002: [sql] Callback and scoped-ignore tests for sql::Statement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: prevent nesting, TODO. Created 7 years, 5 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 | « sql/test/error_callback_support.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 "sql/test/error_callback_support.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace sql {
10
11 void CaptureErrorCallback(int* error_pointer, int error, sql::Statement* stmt) {
12 *error_pointer = error;
13 }
14
15 ScopedErrorCallback::ScopedErrorCallback(
16 sql::Connection* db,
17 const sql::Connection::ErrorCallback& cb)
18 : db_(db) {
19 // Make sure someone isn't trying to nest things.
20 EXPECT_FALSE(db_->has_error_callback());
21 db_->set_error_callback(cb);
22 }
23
24 ScopedErrorCallback::~ScopedErrorCallback() {
25 db_->reset_error_callback();
26 }
27
28 } // namespace
OLDNEW
« no previous file with comments | « sql/test/error_callback_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698