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

Unified Diff: third_party/sqlite/src/test/journal3.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « third_party/sqlite/src/test/journal2.test ('k') | third_party/sqlite/src/test/jrnlmode.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/journal3.test
diff --git a/third_party/sqlite/src/test/journal3.test b/third_party/sqlite/src/test/journal3.test
new file mode 100644
index 0000000000000000000000000000000000000000..7d2972220247bb5c55fb3e5c78cd8463a8068a9f
--- /dev/null
+++ b/third_party/sqlite/src/test/journal3.test
@@ -0,0 +1,60 @@
+# 2010 July 15
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/lock_common.tcl
+source $testdir/malloc_common.tcl
+
+#-------------------------------------------------------------------------
+# If a connection is required to create a journal file, it creates it with
+# the same file-system permissions as the database file itself. Test this.
+#
+if {$::tcl_platform(platform) == "unix"} {
+
+ set umask [exec /bin/sh -c umask]
+ faultsim_delete_and_reopen
+ do_test journal3-1.1 { execsql { CREATE TABLE tx(y, z) } } {}
+
+ foreach {tn permissions} {
+ 1 00644
+ 2 00666
+ 3 00600
+ 4 00755
+ } {
+ db close
+ set effective [format %.5o [expr $permissions & ~$umask]]
+ do_test journal3-1.2.$tn.1 {
+ catch { file delete -force test.db-journal }
+ file attributes test.db -permissions $permissions
+ file attributes test.db -permissions
+ } $permissions
+ do_test journal3-1.2.$tn.2 { file exists test.db-journal } {0}
+ do_test journal3-1.2.$tn.3 {
+ sqlite3 db test.db
+ execsql {
+ BEGIN;
+ INSERT INTO tx DEFAULT VALUES;
+ }
+ file exists test.db-journal
+ } {1}
+ do_test journal3-1.2.$tn.4 {
+ file attr test.db-journal -perm
+ } $effective
+ do_execsql_test journal3-1.2.$tn.5 { ROLLBACK } {}
+ }
+
+
+}
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/journal2.test ('k') | third_party/sqlite/src/test/jrnlmode.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698