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

Unified Diff: sql/statement_unittest.cc

Issue 1991503002: [sql] sql::ScopedErrorIgnorer rename to sql::test::ScopedErrorExpecter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/sql.gyp ('k') | sql/test/scoped_error_expecter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/statement_unittest.cc
diff --git a/sql/statement_unittest.cc b/sql/statement_unittest.cc
index 1565b3e48a97bdd936ae3fd52aee324d4a8e906d..75adf63c52c1b65ed02f0a54eb458eabe9e411d2 100644
--- a/sql/statement_unittest.cc
+++ b/sql/statement_unittest.cc
@@ -11,7 +11,7 @@
#include "sql/correct_sql_test_base.h"
#include "sql/statement.h"
#include "sql/test/error_callback_support.h"
-#include "sql/test/scoped_error_ignorer.h"
+#include "sql/test/scoped_error_expecter.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/sqlite/sqlite3.h"
@@ -78,18 +78,20 @@ TEST_F(SQLStatementTest, ErrorCallback) {
EXPECT_EQ(SQLITE_MISMATCH, error);
}
-// Error ignorer works for error running a statement.
+// Error expecter works for error running a statement.
TEST_F(SQLStatementTest, ScopedIgnoreError) {
ASSERT_TRUE(db().Execute("CREATE TABLE foo (a INTEGER PRIMARY KEY, b)"));
sql::Statement s(db().GetUniqueStatement("INSERT INTO foo (a) VALUES (?)"));
EXPECT_TRUE(s.is_valid());
- sql::ScopedErrorIgnorer ignore_errors;
- ignore_errors.IgnoreError(SQLITE_MISMATCH);
- s.BindCString(0, "bad bad");
- ASSERT_FALSE(s.Run());
- ASSERT_TRUE(ignore_errors.CheckIgnoredErrors());
+ {
+ sql::test::ScopedErrorExpecter expecter;
+ expecter.ExpectError(SQLITE_MISMATCH);
+ s.BindCString(0, "bad bad");
+ ASSERT_FALSE(s.Run());
+ ASSERT_TRUE(expecter.SawExpectedErrors());
+ }
}
TEST_F(SQLStatementTest, Reset) {
« no previous file with comments | « sql/sql.gyp ('k') | sql/test/scoped_error_expecter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698