summaryrefslogtreecommitdiffstats
path: root/sql/test
diff options
context:
space:
mode:
Diffstat (limited to 'sql/test')
-rw-r--r--sql/test/scoped_error_ignorer.cc5
-rw-r--r--sql/test/scoped_error_ignorer.h9
2 files changed, 14 insertions, 0 deletions
diff --git a/sql/test/scoped_error_ignorer.cc b/sql/test/scoped_error_ignorer.cc
index c585229..7e07cf1 100644
--- a/sql/test/scoped_error_ignorer.cc
+++ b/sql/test/scoped_error_ignorer.cc
@@ -9,6 +9,11 @@
namespace sql {
+// static
+int ScopedErrorIgnorer::SQLiteLibVersionNumber() {
+ return sqlite3_libversion_number();
+}
+
ScopedErrorIgnorer::ScopedErrorIgnorer()
: checked_(false) {
callback_ =
diff --git a/sql/test/scoped_error_ignorer.h b/sql/test/scoped_error_ignorer.h
index e777179..79559a1 100644
--- a/sql/test/scoped_error_ignorer.h
+++ b/sql/test/scoped_error_ignorer.h
@@ -10,6 +10,11 @@
#include "base/basictypes.h"
#include "sql/connection.h"
+// This is not strictly necessary for the operation of ScopedErrorIgnorer, but
+// the class is not useful without the SQLite error codes.
+#include "third_party/sqlite/sqlite3.h"
+
+// TODO(shess): sql::test:: seems like it could be in order for this.
namespace sql {
// sql::Connection and sql::Statement treat most SQLite errors as
@@ -43,6 +48,10 @@ class ScopedErrorIgnorer {
// Record an error and check if it should be ignored.
bool ShouldIgnore(int err);
+ // Expose sqlite3_libversion_number() so that clients don't have to add a
+ // dependency on third_party/sqlite.
+ static int SQLiteLibVersionNumber();
+
private:
// Storage for callback passed to Connection::SetErrorIgnorer().
Connection::ErrorIgnorerCallback callback_;