mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fixes for compiler warnings. Also more coverage. (CVS 1775)
FossilOrigin-Name: fa19c77bf045787faa4cdc40bcfbd9eeae8594ae
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
#***********************************************************************
|
||||
# This file runs all tests.
|
||||
#
|
||||
# $Id: all.test,v 1.20 2004/06/26 19:35:30 drh Exp $
|
||||
# $Id: all.test,v 1.21 2004/06/30 08:20:16 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -105,9 +105,13 @@ if {$tcl_platform(platform)=="unix"} {
|
||||
}
|
||||
|
||||
# Run the malloc tests and the misuse test after memory leak detection.
|
||||
# Both tests leak memory.
|
||||
# Both tests leak memory. Currently, misuse.test also leaks a handful of
|
||||
# file descriptors. This is not considered a problem, but can cause tests
|
||||
# in malloc.test to fail. So set the open-file count to zero before running
|
||||
# malloc.test to get around this.
|
||||
#
|
||||
catch {source $testdir/misuse.test}
|
||||
set sqlite_open_file_count 0
|
||||
catch {source $testdir/malloc.test}
|
||||
|
||||
catch {db close}
|
||||
|
@ -13,7 +13,7 @@
|
||||
# various suported unicode encodings (UTF-8, UTF-16, UTF-16le and
|
||||
# UTF-16be).
|
||||
#
|
||||
# $Id: enc2.test,v 1.16 2004/06/29 13:18:24 danielk1977 Exp $
|
||||
# $Id: enc2.test,v 1.17 2004/06/30 08:20:16 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -27,8 +27,11 @@ source $testdir/tester.tcl
|
||||
# as the main database.
|
||||
# enc2.5.*: Test the behaviour of the library when a collation sequence is
|
||||
# not available for the most desirable text encoding.
|
||||
# enc2.6.*: Test that the VerifyCookie opcode protects against assuming the
|
||||
# enc2.6.*: Similar test for user functions.
|
||||
# enc2.7.*: Test that the VerifyCookie opcode protects against assuming the
|
||||
# wrong text encoding for the database.
|
||||
# enc2.8.*: Test sqlite3_complete16()
|
||||
#
|
||||
|
||||
db close
|
||||
|
||||
@ -261,7 +264,7 @@ do_test enc2-5.11 {
|
||||
} {one two three four five UTF-8}
|
||||
|
||||
# Also test that a UTF-16 collation factory works.
|
||||
do_test enc2-6-12 {
|
||||
do_test enc2-5-12 {
|
||||
add_test_collate $DB 0 0 0
|
||||
catchsql {
|
||||
SELECT * FROM t5 ORDER BY 1 COLLATE test_collate
|
||||
@ -276,8 +279,8 @@ do_test enc2-5.13 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
|
||||
# The following tests - enc2-5.* - test that SQLite selects the correct
|
||||
# collation sequence when more than one is available.
|
||||
# The following tests - enc2-6.* - test that SQLite selects the correct
|
||||
# user function when more than one is available.
|
||||
|
||||
proc test_function {enc arg} {
|
||||
return "$enc $arg"
|
||||
@ -385,7 +388,7 @@ do_test enc2-6.10 {
|
||||
db close
|
||||
file delete -force test.db
|
||||
|
||||
# The following tests - enc2-6.* - function as follows:
|
||||
# The following tests - enc2-7.* - function as follows:
|
||||
#
|
||||
# 1: Open an empty database file assuming UTF-16 encoding.
|
||||
# 2: Open the same database with a different handle assuming UTF-8. Create
|
||||
@ -427,5 +430,16 @@ do_test enc2-7.5 {
|
||||
db close
|
||||
db2 close
|
||||
|
||||
proc utf16 {utf8} {
|
||||
set utf16 [encoding convertto unicode $utf8]
|
||||
append utf16 "\x00\x00"
|
||||
return $utf16
|
||||
}
|
||||
do_test enc2-8.1 {
|
||||
sqlite3_complete16 [utf16 "SELECT * FROM t1;"]
|
||||
} {1}
|
||||
do_test enc2-8.2 {
|
||||
sqlite3_complete16 [utf16 "SELECT * FROM"]
|
||||
} {0}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user