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.
5 #include "sql/test/error_callback_support.h"
7 #include "testing/gtest/include/gtest/gtest.h"
11 void CaptureErrorCallback(int* error_pointer
, int error
, sql::Statement
* stmt
) {
12 *error_pointer
= error
;
15 ScopedErrorCallback::ScopedErrorCallback(
17 const sql::Connection::ErrorCallback
& cb
)
19 // Make sure someone isn't trying to nest things.
20 EXPECT_FALSE(db_
->has_error_callback());
21 db_
->set_error_callback(cb
);
24 ScopedErrorCallback::~ScopedErrorCallback() {
25 db_
->reset_error_callback();