aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/sqlite-tests.el
diff options
context:
space:
mode:
authorEli Zaretskii2023-05-20 15:43:44 +0300
committerEli Zaretskii2023-05-20 15:43:44 +0300
commitead3a2abbfc347b0f562c1e051b370a0617ee8aa (patch)
tree25633d5df72f473e681fc18d2ffb5fae66e0847e /test/src/sqlite-tests.el
parenta6bddd176582f8bea79ec77e1e27bb583a6ef0b5 (diff)
downloademacs-ead3a2abbfc347b0f562c1e051b370a0617ee8aa.tar.gz
emacs-ead3a2abbfc347b0f562c1e051b370a0617ee8aa.zip
Fix loading SQLite extensions
* src/sqlite.c (sqlite3_db_config) [WINDOWSNT]: Load from the DLL. (Fsqlite_load_extension): Use 'sqlite3_db_config' to enable and disable loading of extensions. Add a few free extensions to the allow-list. Fix testing for the ".dll" extension. (Bug#63590) * test/src/sqlite-tests.el (sqlite-load-extension): Fix the test to require successful load if the extension does exist.
Diffstat (limited to 'test/src/sqlite-tests.el')
-rw-r--r--test/src/sqlite-tests.el23
1 files changed, 14 insertions, 9 deletions
diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el
index 460651def78..f7144c15887 100644
--- a/test/src/sqlite-tests.el
+++ b/test/src/sqlite-tests.el
@@ -197,10 +197,13 @@
197 (sqlite-load-extension db "/usr/lib/sqlite3/")) 197 (sqlite-load-extension db "/usr/lib/sqlite3/"))
198 (should-error 198 (should-error
199 (sqlite-load-extension db "/usr/lib/sqlite3")) 199 (sqlite-load-extension db "/usr/lib/sqlite3"))
200 (should 200 (if (eq system-type 'windows-nt)
201 (memq 201 (should
202 (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so") 202 (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.dll")
203 '(nil t))) 203 (file-readable-p "/usr/lib/sqlite3/pcre.dll")))
204 (should
205 (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so")
206 (file-readable-p "/usr/lib/sqlite3/pcre.so"))))
204 207
205 (should-error 208 (should-error
206 (sqlite-load-extension 209 (sqlite-load-extension
@@ -211,11 +214,13 @@
211 (should-error 214 (should-error
212 (sqlite-load-extension 215 (sqlite-load-extension
213 db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable")) 216 db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable"))
214 (should 217 (if (eq system-type 'windows-nt)
215 (memq 218 (should
216 (sqlite-load-extension 219 (eq (sqlite-load-extension db "/usr/lib/sqlite3/csvtable.dll")
217 db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") 220 (file-readable-p "/usr/lib/sqlite3/csvtable.dll")))
218 '(nil t))))) 221 (should
222 (eq (sqlite-load-extension db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so")
223 (file-readable-p "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so"))))))
219 224
220(ert-deftest sqlite-blob () 225(ert-deftest sqlite-blob ()
221 (skip-unless (sqlite-available-p)) 226 (skip-unless (sqlite-available-p))