1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Reformulate and simplify some JS tests related to the previous checkin.

FossilOrigin-Name: 9ea2d3dcf798393a7fd231e199c0e2c6302949fe2a7f2573178fb0e50c78a2f4
This commit is contained in:
stephan
2022-12-01 04:45:51 +00:00
parent 2b2199570d
commit 9ec1a7a7a0
4 changed files with 19 additions and 22 deletions

View File

@@ -1232,22 +1232,18 @@ self.sqlite3InitModule = sqlite3InitModule;
if(1){
const vfsList = capi.sqlite3_js_vfs_list();
T.assert(vfsList.length>1);
T.assert('string'===typeof vfsList[0]);
//log("vfsList =",vfsList);
for(const v of vfsList){
T.assert('string' === typeof v)
.assert(wasm.isPtr(
capi.sqlite3_vfs_find(v)
));
}
// While we have vfsList handy, let's verify...
wasm.scopedAllocCall(()=>{
const vfsArg = (v)=>wasm.xWrap.testConvertArg('sqlite3_vfs*',v);
T.assert(wasm.isPtr(vfsArg(vfsList[0])));
const pVfs = capi.sqlite3_vfs_find(vfsList[0]);
const vfs = new capi.sqlite3_vfs(pVfs);
T.assert(wasm.isPtr(vfsArg(vfs)));
vfs.dispose();
for(const v of vfsList){
T.assert('string' === typeof v);
const pVfs = capi.sqlite3_vfs_find(v);
T.assert(wasm.isPtr(pVfs))
.assert(pVfs===vfsArg(v));
const vfs = new capi.sqlite3_vfs(pVfs);
try { T.assert(vfsArg(vfs)===pVfs) }
finally{ vfs.dispose() }
}
});
}
/**