This source file includes following definitions.
- CaptureErrorCallback
#include "sql/test/error_callback_support.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace sql {
void CaptureErrorCallback(int* error_pointer, int error, sql::Statement* stmt) {
*error_pointer = error;
}
ScopedErrorCallback::ScopedErrorCallback(
sql::Connection* db,
const sql::Connection::ErrorCallback& cb)
: db_(db) {
EXPECT_FALSE(db_->has_error_callback());
db_->set_error_callback(cb);
}
ScopedErrorCallback::~ScopedErrorCallback() {
db_->reset_error_callback();
}
}