-C Infrastructure\sfor\sa\snew\stest\sprogram\snamed\s"iotester"\sthat\sstrives\sto\sverify\nthe\soperation\sof\sa\sVFS\sobject.
-D 2024-08-13T19:30:03.469
+C Use\sthe\sxDelete\smethod\sof\sthe\sVFS\srather\sthan\sdirect\sinteration\swith\sthe\nfilesystem.
+D 2024-08-13T20:16:11.312
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
F test/ioerr5.test 5984da7bf74b6540aa356f2ab0c6ae68a6d12039a3d798a9ac6a100abc17d520
F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b
-F test/iotester.c 4df6dff77a78162808854dd6d3810ed4fe2a8fe4ba5e95a74575548f23480026
+F test/iotester.c 19b67e18ebbb7533345f3d875e931cfdeda1cbb912164924558203dea4cefd0e
F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9
F test/join.test f7abfef3faeaf2800308872e33a57e5b6e4a2b44fb8c6b90c6068412e71a6cf4
F test/join2.test 8561fe82ce434ac96de91544072e578dc2cadddf2d9bc9cd802f866a9b92502e
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 9c10664416274df6f8da53ddd86f6356c9704ad798fd4034d2784ae433c1c056
-R d53719958cd6e7f4f987278bf19c1278
+P b46d86c22bd486789affa9c5e41b8f6ee47bae23eee5efe0640db3d3860e8a7a
+R 6f0409e082147714d85cbd8fee9f5c89
U drh
-Z 4d2d6900391d50d204c15f38c15fadf7
+Z c0cc32f2d8d4cb762b1755f23b9fe78f
# Remove this line to create a well-formed Fossil manifest.
#include "sqlite3.h"
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
/* Number of elements in static array X */
#define COUNT(X) (sizeof(X)/sizeof(X[0]))
return res;
}
+/*
+** Delete a file by name using the xDelete method of the default VFS.
+*/
+void iotestDeleteFile(IOTester *p, const char *zFilename){
+ sqlite3_vfs *pVfs = sqlite3_vfs_find(0);
+ int rc;
+ assert( pVfs!=0 );
+ assert( pVfs->xDelete!=0 );
+ rc = pVfs->xDelete(pVfs, zFilename, 0);
+ if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_DELETE_NOENT ){
+ iotestError(p, "cannot delete file \"%s\"\n", zFilename);
+ }
+}
+
/*
** Open a database. Return a pointer to that database connection,
** or if something goes wrong, return a NULL pointer.
sqlite3 *db = 0;
p->zTestModule = "basic1";
iotestBeginTest(p, 1);
- iotestUnlink(p, "basic1.db");
+ iotestDeleteFile(p, "basic1.db");
if( p->nFault ) return;
iotestBeginTest(p, 2);
db = iotestOpen(p, "basic1.db");
basic1_exit:
sqlite3_close(db);
- iotestUnlink(p, "basic1.db");
+ iotestDeleteFile(p, "basic1.db");
}
/********************** Out-Of-Band System Interactions **********************
** to work on alternative operating systems.
*/
#include <stdio.h>
-#ifdef _WIN32
-# include <io.h>
-#else
-# include <unistd.h>
-# include <errno.h>
-#endif
-
-/* Remove the named file from disk, if it exists.
-**
-** If the file does not exist, this routine is a no-op.
-** If the file does exists but could not be removed, this routine raises
-** and error in the IOTester module.
-*/
-void iotestUnlink(IOTester *p, const char *zFilename){
- int rc;
-#ifdef _WIN32
- rc = remove(zFilename);
-#else
- rc = unlink(zFilename);
-#endif
- if( rc!=0 && errno!=ENOENT ){
- iotestError(p, "cannot delete file \"%s\"\n", zFilename);
- }
-}
/*
** Start a new test case. (This is under the "Out-of-band" section because