summaryrefslogtreecommitdiff
path: root/test/capi3c.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/capi3c.test')
-rw-r--r--test/capi3c.test19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/capi3c.test b/test/capi3c.test
index c1d5510..4092091 100644
--- a/test/capi3c.test
+++ b/test/capi3c.test
@@ -849,18 +849,25 @@ do_test capi3c-11.9.2 {
catchsql {
ROLLBACK;
}
-} {1 {cannot rollback transaction - SQL statements in progress}}
+} {0 {}}
do_test capi3c-11.9.3 {
sqlite3_get_autocommit $DB
-} 0
+} 1
do_test capi3c-11.10 {
sqlite3_step $STMT
-} {SQLITE_ROW}
+} {SQLITE_ABORT}
+ifcapable !autoreset {
+ # If SQLITE_OMIT_AUTORESET is defined, then the statement must be
+ # reset() before it can be passed to step() again.
+ do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE}
+ do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT}
+}
do_test capi3c-11.11 {
sqlite3_step $STMT
} {SQLITE_ROW}
do_test capi3c-11.12 {
sqlite3_step $STMT
+ sqlite3_step $STMT
} {SQLITE_DONE}
do_test capi3c-11.13 {
sqlite3_finalize $STMT
@@ -869,15 +876,15 @@ do_test capi3c-11.14 {
execsql {
SELECT a FROM t2;
}
-} {1 2 3}
+} {1 2}
do_test capi3c-11.14.1 {
sqlite3_get_autocommit $DB
-} 0
+} 1
do_test capi3c-11.15 {
catchsql {
ROLLBACK;
}
-} {0 {}}
+} {1 {cannot rollback - no transaction is active}}
do_test capi3c-11.15.1 {
sqlite3_get_autocommit $DB
} 1