summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-05-20 15:43:44 +0300
committerEli Zaretskii <eliz@gnu.org>2023-05-20 15:43:44 +0300
commitead3a2abbfc347b0f562c1e051b370a0617ee8aa (patch)
tree25633d5df72f473e681fc18d2ffb5fae66e0847e /test
parenta6bddd176582f8bea79ec77e1e27bb583a6ef0b5 (diff)
downloademacs-ead3a2abbfc347b0f562c1e051b370a0617ee8aa.tar.gz
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')
-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 @@
(sqlite-load-extension db "/usr/lib/sqlite3/"))
(should-error
(sqlite-load-extension db "/usr/lib/sqlite3"))
- (should
- (memq
- (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so")
- '(nil t)))
+ (if (eq system-type 'windows-nt)
+ (should
+ (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.dll")
+ (file-readable-p "/usr/lib/sqlite3/pcre.dll")))
+ (should
+ (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so")
+ (file-readable-p "/usr/lib/sqlite3/pcre.so"))))
(should-error
(sqlite-load-extension
@@ -211,11 +214,13 @@
(should-error
(sqlite-load-extension
db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable"))
- (should
- (memq
- (sqlite-load-extension
- db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so")
- '(nil t)))))
+ (if (eq system-type 'windows-nt)
+ (should
+ (eq (sqlite-load-extension db "/usr/lib/sqlite3/csvtable.dll")
+ (file-readable-p "/usr/lib/sqlite3/csvtable.dll")))
+ (should
+ (eq (sqlite-load-extension db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so")
+ (file-readable-p "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so"))))))
(ert-deftest sqlite-blob ()
(skip-unless (sqlite-available-p))