Index: src/test1.c ================================================================== --- src/test1.c +++ src/test1.c @@ -11,11 +11,11 @@ ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.139 2005/05/26 16:23:34 drh Exp $ +** $Id: test1.c,v 1.140 2005/05/27 09:41:13 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include "os.h" #include @@ -2405,10 +2405,11 @@ Tcl_SetObjResult(interp, Tcl_NewIntObj(xFunc(pStmt, col))); return TCL_OK; } +#ifndef SQLITE_OMIT_DISKIO /* ** Usage: sqlite3OsOpenReadWrite */ static int test_sqlite3OsOpenReadWrite( void * clientData, @@ -2564,10 +2565,11 @@ return TCL_ERROR; } Tcl_AppendResult(interp, zFile, 0); return TCL_OK; } +#endif /* ** Usage: sqlite_set_magic DB MAGIC-NUMBER ** ** Set the db->magic value. This is used to test error recovery logic. @@ -3047,17 +3049,19 @@ { "sqlite3_column_name16", test_stmt_utf16, sqlite3_column_name16 }, #endif { "sqlite3_global_recover", test_global_recover, 0 }, /* Functions from os.h */ +#ifndef SQLITE_OMIT_DISKIO { "sqlite3OsOpenReadWrite",test_sqlite3OsOpenReadWrite, 0 }, { "sqlite3OsClose", test_sqlite3OsClose, 0 }, { "sqlite3OsLock", test_sqlite3OsLock, 0 }, { "sqlite3OsTempFileName", test_sqlite3OsTempFileName, 0 }, /* Custom test interfaces */ { "sqlite3OsUnlock", test_sqlite3OsUnlock, 0 }, +#endif #ifndef SQLITE_OMIT_UTF16 { "add_test_collate", test_collate, 0 }, { "add_test_collate_needed", test_collate_needed, 0 }, { "add_test_function", test_function, 0 }, #endif Index: src/test2.c ================================================================== --- src/test2.c +++ src/test2.c @@ -11,11 +11,11 @@ ************************************************************************* ** Code for testing the pager.c module in SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test2.c,v 1.29 2005/02/06 02:45:43 drh Exp $ +** $Id: test2.c,v 1.30 2005/05/27 09:41:13 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" #include "pager.h" #include "tcl.h" @@ -506,10 +506,11 @@ strncpy((char*)pPage, argv[2], test_pagesize-1); ((char*)pPage)[test_pagesize-1] = 0; return TCL_OK; } +#ifndef SQLITE_OMIT_DISKIO /* ** Usage: fake_big_file N FILENAME ** ** Write a few bytes at the N megabyte point of FILENAME. This will ** create a large file. If the file was a valid SQLite database, then @@ -553,10 +554,11 @@ Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0); return TCL_ERROR; } return TCL_OK; } +#endif /* ** Register commands with the TCL interpreter. */ int Sqlitetest2_Init(Tcl_Interp *interp){ @@ -580,11 +582,13 @@ { "page_unref", (Tcl_CmdProc*)page_unref }, { "page_read", (Tcl_CmdProc*)page_read }, { "page_write", (Tcl_CmdProc*)page_write }, { "page_number", (Tcl_CmdProc*)page_number }, { "pager_truncate", (Tcl_CmdProc*)pager_truncate }, +#ifndef SQLITE_OMIT_DISKIO { "fake_big_file", (Tcl_CmdProc*)fake_big_file }, +#endif }; int i; for(i=0; iaDb[0].pBt); OsFile master; @@ -1224,10 +1225,11 @@ if( pBt ){ sqlite3BtreeCommit(pBt); } } } +#endif return rc; } /* Index: test/delete.test ================================================================== --- test/delete.test +++ test/delete.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the DELETE FROM statement. # -# $Id: delete.test,v 1.18 2004/11/04 04:42:28 drh Exp $ +# $Id: delete.test,v 1.19 2005/05/27 09:41:13 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to delete from a non-existant table. @@ -272,11 +272,11 @@ } } {123} db close catch {file attributes test.db -permissions 0444} catch {file attributes test.db -readonly 1} -sqlite3 db test.db +set ::DB [sqlite3 db test.db] do_test delete-8.1 { catchsql { DELETE FROM t3; } } {1 {attempt to write a readonly database}}