Move test logic for SQLITE_FCNTL_PRAGMA out of os_unix.c and into test_vfs.c.

FossilOrigin-Name: c81fc40b2b584820ac7d1c3848ebeb7225d4eeeb
diff --git a/manifest b/manifest
index dddb378..8c2bdd2 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C If\sthe\sSQLITE_FCNTL_PRAGMA\sfile-control\sreturns\sanything\sother\sthan\nSQLTIE_NOTFOUND\sand\sSQLITE_OK,\sthen\streat\sthe\sresult\sas\san\serror.
-D 2012-02-22T19:56:17.256
+C Move\stest\slogic\sfor\sSQLITE_FCNTL_PRAGMA\sout\sof\sos_unix.c\sand\sinto\stest_vfs.c.
+D 2012-02-22T20:08:49.412
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -166,7 +166,7 @@
 F src/os.h 59beba555b65a450bd1d804220532971d4299f60
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
-F src/os_unix.c 49e10d7d5783df93684b3c232f03394ad7171ee3
+F src/os_unix.c 0e3d2942d228d0366fb80a3640f35caf413b66d1
 F src/os_win.c 5ac061ae1326a71500cee578ed0fd9113b4f6a37
 F src/pager.c 2d892f7b901a8867a33bc21742086165a3a99af8
 F src/pager.h a435da8421dc7844b7f9c7f37b636c160c50208a
@@ -230,7 +230,7 @@
 F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
 F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
 F src/test_thread.c e286f2173563f2a1747c24bcda6b9d030bf4f4e4
-F src/test_vfs.c 37d523ce239e853a302933327ccbc8c73c4572c1
+F src/test_vfs.c 73f46bd9b5183ebcb77da22773886b81157cdc3d
 F src/test_vfstrace.c f20a32a5fd46feb59a93d2cf650f1ff92da3872b
 F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290
 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
@@ -275,7 +275,7 @@
 F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
 F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
 F test/async5.test 0dd8701bd588bf6e70c2557a22ae3f22b2567b4c
-F test/attach.test 80762134ca101a79dbe3dda5285d7897639057a7
+F test/attach.test 8511625fa8c7dabbcbc48fc491c0b07bae65fb0e
 F test/attach2.test e54436ed956d3d88bdee61221da59bf3935a0966
 F test/attach3.test d89ccfe4fe6e2b5e368d480fcdfe4b496c54cf4e
 F test/attach4.test 53bf502f17647c6d6c5add46dda6bac8b6f4665c
@@ -635,7 +635,7 @@
 F test/pcache.test 065aa286e722ab24f2e51792c1f093bf60656b16
 F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
 F test/permutations.test fa6f0e5f13fe0b1d3f7a7613179b7f7b20028184
-F test/pragma.test 01abcc2e43d080db8df0f9517233937c20892bd1
+F test/pragma.test f6111ded4d56b79436a60a757d62f3c96a9cf3f5
 F test/pragma2.test 3a55f82b954242c642f8342b17dffc8b47472947
 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
 F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
@@ -990,7 +990,7 @@
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 9a1da91850b6074e5f9d18382f517eb868cad63c
-R 38bcf4842421c21898ae536d39030b7a
+P 5643618108a8aafba67ed4004039b862bb5e5da8
+R 6e8e292599506d27fedbb78f0e61a658
 U drh
-Z 347350cb546f31164cbf5b1b4da5c224
+Z b333c9e71d55e82ea7cb2edfc422542b
diff --git a/manifest.uuid b/manifest.uuid
index fb958af..adc52f6 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-5643618108a8aafba67ed4004039b862bb5e5da8
\ No newline at end of file
+c81fc40b2b584820ac7d1c3848ebeb7225d4eeeb
\ No newline at end of file
diff --git a/src/os_unix.c b/src/os_unix.c
index f747d8a..48c1309 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3587,16 +3587,6 @@
       *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
       return SQLITE_OK;
     }
-    case SQLITE_FCNTL_PRAGMA: {
-      char **azArg = (char**)pArg;
-#ifdef SQLITE_TEST
-      if( sqlite3_stricmp(azArg[1], "filename")==0 ){
-        azArg[0] = sqlite3_mprintf("%s", pFile->zPath);
-        return SQLITE_OK;
-      }
-#endif
-      break;
-    }
 #ifndef NDEBUG
     /* The pager calls this method to signal that it has done
     ** a rollback and that the database is therefore unchanged and
diff --git a/src/test_vfs.c b/src/test_vfs.c
index c18d0f6..bab6779 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -496,6 +496,10 @@
       }
       return rc;
     }
+    if( sqlite3_stricmp(argv[1], "filename")==0 ){
+      argv[0] = sqlite3_mprintf("%s", p->zFilename);
+      return SQLITE_OK;
+    }
   }
   return sqlite3OsFileControl(p->pReal, op, pArg);
 }
diff --git a/test/attach.test b/test/attach.test
index 7835898..008eee6 100644
--- a/test/attach.test
+++ b/test/attach.test
@@ -272,17 +272,6 @@
 } ;# ifcapable schema_pragmas
 
 
-if {[regexp unix [file_control_vfsname db]]} {
-  ifcapable debug {
-    do_test attach-1.30.1 {
-      file tail [db eval {PRAGMA main.filename}]
-    } {test.db}
-    do_test attach-1.30.2 {
-      db eval {PRAGMA temp.filename}
-    } {}
-  }
-}
-
 ifcapable {trigger} {  # Only do the following tests if triggers are enabled
 do_test attach-2.1 {
   execsql {
diff --git a/test/pragma.test b/test/pragma.test
index fb1034f..00be9b8 100644
--- a/test/pragma.test
+++ b/test/pragma.test
@@ -1506,6 +1506,9 @@
 do_test pragma-19.4 {
   catchsql {PRAGMA error=7}
 } {1 {out of memory}}
+do_test pragma-19.5 {
+  file tail [execsql {PRAGMA filename}]
+} {test.db}
 
 
 finish_test