aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/tester1.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-01 04:45:51 +0000
committerstephan <stephan@noemail.net>2022-12-01 04:45:51 +0000
commit9ec1a7a7a07be84a597fb6d7a455b52275f8eab2 (patch)
treeda5178bcdb93a12a5e89b55b1916bb927ab43edc /ext/wasm/tester1.c-pp.js
parent2b2199570da5d8e3e6a5cf1caae97a66b705124f (diff)
downloadsqlite-9ec1a7a7a07be84a597fb6d7a455b52275f8eab2.tar.gz
sqlite-9ec1a7a7a07be84a597fb6d7a455b52275f8eab2.zip
Reformulate and simplify some JS tests related to the previous checkin.
FossilOrigin-Name: 9ea2d3dcf798393a7fd231e199c0e2c6302949fe2a7f2573178fb0e50c78a2f4
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r--ext/wasm/tester1.c-pp.js22
1 files changed, 9 insertions, 13 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js
index 1278e772f..b1d9cba2e 100644
--- a/ext/wasm/tester1.c-pp.js
+++ b/ext/wasm/tester1.c-pp.js
@@ -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() }
+ }
});
}
/**