Files
TheRock/rocm-systems/projects/rocprofiler-sdk/external/sqlite/test/loadext2.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

169 lines
3.2 KiB
Plaintext

# 2006 August 23
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is automatic extension loading and the
# sqlite3_auto_extension() API.
#
# $Id: loadext2.test,v 1.3 2008/03/19 16:08:54 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Only run these tests if the approriate APIs are defined
# in the system under test.
#
ifcapable !load_ext {
finish_test
return
}
if {[info command sqlite3_auto_extension_sqr]==""} {
finish_test
return
}
# None of the extension are loaded by default.
#
do_test loadext2-1.1 {
catchsql {
SELECT sqr(2)
}
} {1 {no such function: sqr}}
do_test loadext2-1.2 {
catchsql {
SELECT cube(2)
}
} {1 {no such function: cube}}
# Extensions loaders not currently registered
#
do_test loadext2-1.2.1 {
sqlite3_cancel_auto_extension_sqr
} {0}
do_test loadext2-1.2.2 {
sqlite3_cancel_auto_extension_sqr
} {0}
do_test loadext2-1.2.3 {
sqlite3_cancel_auto_extension_sqr
} {0}
# Register auto-loaders. Still functions do not exist.
#
do_test loadext2-1.3 {
sqlite3_auto_extension_sqr
sqlite3_auto_extension_cube
catchsql {
SELECT sqr(2)
}
} {1 {no such function: sqr}}
do_test loadext2-1.4 {
catchsql {
SELECT cube(2)
}
} {1 {no such function: cube}}
# Functions do exist in a new database connection
#
do_test loadext2-1.5 {
sqlite3 db test.db
catchsql {
SELECT sqr(2)
}
} {0 4.0}
do_test loadext2-1.6 {
catchsql {
SELECT cube(2)
}
} {0 8.0}
# Reset extension auto loading. Existing extensions still exist.
#
do_test loadext2-1.7.1 {
sqlite3_cancel_auto_extension_sqr
} {1}
do_test loadext2-1.7.2 {
sqlite3_cancel_auto_extension_sqr
} {0}
do_test loadext2-1.7.3 {
sqlite3_cancel_auto_extension_cube
} {1}
do_test loadext2-1.7.4 {
sqlite3_cancel_auto_extension_cube
} {0}
do_test loadext2-1.7.5 {
catchsql {
SELECT sqr(2)
}
} {0 4.0}
do_test loadext2-1.8 {
catchsql {
SELECT cube(2)
}
} {0 8.0}
# Register only the sqr() function.
#
do_test loadext2-1.9 {
sqlite3_auto_extension_sqr
sqlite3 db test.db
catchsql {
SELECT sqr(2)
}
} {0 4.0}
do_test loadext2-1.10 {
catchsql {
SELECT cube(2)
}
} {1 {no such function: cube}}
# Register only the cube() function.
#
do_test loadext2-1.11 {
sqlite3_reset_auto_extension
sqlite3_auto_extension_cube
sqlite3 db test.db
catchsql {
SELECT sqr(2)
}
} {1 {no such function: sqr}}
do_test loadext2-1.12 {
catchsql {
SELECT cube(2)
}
} {0 8.0}
# Register a broken entry point.
#
do_test loadext2-1.13 {
sqlite3_auto_extension_broken
set rc [catch {sqlite3 db test.db} errmsg]
lappend rc $errmsg
} {1 {automatic extension loading failed: broken autoext!}}
do_test loadext2-1.14 {
catchsql {
SELECT sqr(2)
}
} {1 {no such function: sqr}}
do_test loadext2-1.15 {
catchsql {
SELECT cube(2)
}
} {0 8.0}
sqlite3_reset_auto_extension
autoinstall_test_functions
finish_test