diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2025-03-27 14:32:57 +0000 |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2025-03-27 14:32:57 +0000 |
commit | 87b90921b6e0bd0c415bd6723a9d90b50bfd2747 (patch) | |
tree | 1ac49e7d0f7f5686abd28db7c43aef946937aa17 /test | |
parent | eb2644024af7124222b2e5e0faab66275aefbb92 (diff) | |
download | sqlite-87b90921b6e0bd0c415bd6723a9d90b50bfd2747.tar.gz sqlite-87b90921b6e0bd0c415bd6723a9d90b50bfd2747.zip |
In Tcl, always use eq/ne for comparing strings, not ==/!=
FossilOrigin-Name: f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4
Diffstat (limited to 'test')
-rw-r--r-- | test/all.test | 2 | ||||
-rw-r--r-- | test/analyzer1.test | 2 | ||||
-rw-r--r-- | test/attach.test | 2 | ||||
-rw-r--r-- | test/avtrans.test | 2 | ||||
-rw-r--r-- | test/chunksize.test | 2 | ||||
-rw-r--r-- | test/filectrl.test | 2 | ||||
-rw-r--r-- | test/io.test | 2 | ||||
-rw-r--r-- | test/ioerr.test | 4 | ||||
-rw-r--r-- | test/journal1.test | 2 | ||||
-rw-r--r-- | test/lock.test | 2 | ||||
-rw-r--r-- | test/malloc.test | 2 | ||||
-rw-r--r-- | test/misc7.test | 6 | ||||
-rw-r--r-- | test/nockpt.test | 2 | ||||
-rw-r--r-- | test/pager1.test | 2 | ||||
-rw-r--r-- | test/permutations.test | 2 | ||||
-rw-r--r-- | test/pragma.test | 2 | ||||
-rw-r--r-- | test/quota.test | 6 | ||||
-rw-r--r-- | test/readonly.test | 2 | ||||
-rw-r--r-- | test/shared.test | 4 | ||||
-rw-r--r-- | test/shared3.test | 2 | ||||
-rw-r--r-- | test/shell3.test | 2 | ||||
-rw-r--r-- | test/shell8.test | 2 | ||||
-rw-r--r-- | test/symlink2.test | 2 | ||||
-rw-r--r-- | test/uri.test | 4 | ||||
-rw-r--r-- | test/vacuum-into.test | 4 | ||||
-rw-r--r-- | test/vtabH.test | 4 | ||||
-rw-r--r-- | test/walblock.test | 2 | ||||
-rw-r--r-- | test/walcrash4.test | 2 | ||||
-rw-r--r-- | test/walsetlk.test | 6 | ||||
-rw-r--r-- | test/win32heap.test | 2 | ||||
-rw-r--r-- | test/writecrash.test | 2 | ||||
-rw-r--r-- | test/zipfile.test | 8 |
32 files changed, 46 insertions, 46 deletions
diff --git a/test/all.test b/test/all.test index 46e8115fb..22d7b8dae 100644 --- a/test/all.test +++ b/test/all.test @@ -42,7 +42,7 @@ run_test_suite pcache100 run_test_suite prepare run_test_suite mmap -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { ifcapable !default_autovacuum { run_test_suite autovacuum_crash } diff --git a/test/analyzer1.test b/test/analyzer1.test index a9239d61e..1f0b0f637 100644 --- a/test/analyzer1.test +++ b/test/analyzer1.test @@ -19,7 +19,7 @@ ifcapable !vtab { return } -if {$tcl_platform(os)=="Windows NT"} { +if {$tcl_platform(platform) eq "windows"} { set PROG "sqlite3_analyzer.exe" } else { set PROG "./sqlite3_analyzer" diff --git a/test/attach.test b/test/attach.test index 557201d65..3445c43fa 100644 --- a/test/attach.test +++ b/test/attach.test @@ -759,7 +759,7 @@ do_test attach-6.1 { ATTACH DATABASE 'no-such-file' AS nosuch; } } {0 {}} -if {$tcl_platform(platform)=="unix"} { +if {$tcl_platform(platform) eq "unix"} { do_test attach-6.2 { sqlite3 dbx cannot-read dbx eval {CREATE TABLE t1(a,b,c)} diff --git a/test/avtrans.test b/test/avtrans.test index 6fc4a3e39..b483c71a4 100644 --- a/test/avtrans.test +++ b/test/avtrans.test @@ -903,7 +903,7 @@ for {set i 2} {$i<=$limit} {incr i} { INSERT INTO t3 SELECT randstr(10,400) FROM t3 WHERE random()%10==0; } } {} - if {$tcl_platform(platform)=="unix"} { + if {$tcl_platform(platform) eq "unix"} { do_test avtrans-9.$i.4-$cnt { expr {$sqlite_sync_count>0} } 1 diff --git a/test/chunksize.test b/test/chunksize.test index 47d118d84..be3795fc5 100644 --- a/test/chunksize.test +++ b/test/chunksize.test @@ -14,7 +14,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix chunksize -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(platform) ne "unix"} { finish_test return } diff --git a/test/filectrl.test b/test/filectrl.test index fee29e044..9b1a1c758 100644 --- a/test/filectrl.test +++ b/test/filectrl.test @@ -47,7 +47,7 @@ db close forcedelete .test_control_lockproxy.db-conch test.proxy forcedelete test.db test2.db -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { do_test filectrl-2.1 { sqlite3 db test2.db set size [file size test2.db] diff --git a/test/io.test b/test/io.test index 0024fefd6..1dc84bdee 100644 --- a/test/io.test +++ b/test/io.test @@ -465,7 +465,7 @@ do_test io-4.2.1 { execsql { INSERT INTO abc VALUES('c', 'd') } file exists test.db-journal } {1} -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { do_test io-4.2.2 { hexio_read test.db-journal 8 4 } {FFFFFFFF} diff --git a/test/ioerr.test b/test/ioerr.test index fb54d8b38..c76c9c1e6 100644 --- a/test/ioerr.test +++ b/test/ioerr.test @@ -172,7 +172,7 @@ ifcapable crashtest&&attach { # These tests can't be run on windows because the windows version of # SQLite holds a mandatory exclusive lock on journal files it has open. # -if {$tcl_platform(platform)!="windows" && ![atomic_batch_write test.db]} { +if {$tcl_platform(platform) ne"windows" && ![atomic_batch_write test.db]} { do_ioerr_test ioerr-7 -tclprep { db close sqlite3 db2 test2.db @@ -211,7 +211,7 @@ do_ioerr_test ioerr-8 -ckrefcount true -tclprep { # For test coverage: Cause an IO error whilst reading the master-journal # name from a journal file. -if {$tcl_platform(platform)=="unix" && [atomic_batch_write test.db]==0} { +if {$tcl_platform(platform) eq "unix" && [atomic_batch_write test.db]==0} { do_ioerr_test ioerr-9 -ckrefcount true -tclprep { execsql { CREATE TABLE t1(a,b,c); diff --git a/test/journal1.test b/test/journal1.test index bcbafe30f..56c862f05 100644 --- a/test/journal1.test +++ b/test/journal1.test @@ -25,7 +25,7 @@ source $testdir/tester.tcl # Or with atomic_batch_write systems, as journal files are # not created. # -if {$tcl_platform(platform)=="windows" +if {$tcl_platform(platform) eq "windows" || [atomic_batch_write test.db] } { finish_test diff --git a/test/lock.test b/test/lock.test index cacb6d3ff..3f4631a62 100644 --- a/test/lock.test +++ b/test/lock.test @@ -145,7 +145,7 @@ do_test lock-1.21 { # connections, because UNIX supports reader/writer locks. Under windows, # this is not possible. # -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { do_test lock-1.22 { db eval {SELECT * FROM t1} qv { set r [catch {db2 eval {SELECT a FROM t1}} msg] diff --git a/test/malloc.test b/test/malloc.test index 5e82e8028..e53bfcd19 100644 --- a/test/malloc.test +++ b/test/malloc.test @@ -329,7 +329,7 @@ ifcapable crashtest&&attach { } } -if {$tcl_platform(platform)!="windows" && [atomic_batch_write test.db]==0} { +if {$tcl_platform(platform) ne "windows" && [atomic_batch_write test.db]==0} { do_malloc_test 14 -tclprep { catch {db close} sqlite3 db2 test2.db diff --git a/test/misc7.test b/test/misc7.test index add9014b0..f4ef2d210 100644 --- a/test/misc7.test +++ b/test/misc7.test @@ -100,7 +100,7 @@ proc do_fileopen_test {prefix sql} { execsql { CREATE TABLE abc(a PRIMARY KEY, b, c); } db close -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { do_fileopen_test misc7-6.1 { BEGIN; INSERT INTO abc VALUES(1, 2, 3); @@ -390,7 +390,7 @@ do_test misc7-16.X { # These tests do not work on windows due to restrictions in the # windows file system. # -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { # Some network filesystems (ex: AFP) do not support setting read-only # permissions. Only run these tests if full unix permission setting @@ -534,7 +534,7 @@ do_test misc7-22.4 { catch { db close } forcedelete test.db -if {$::tcl_platform(platform)=="unix" +if {$::tcl_platform(platform) eq "unix" && [atomic_batch_write test.db]==0 } { reset_db diff --git a/test/nockpt.test b/test/nockpt.test index 84b2953e6..f5d11732b 100644 --- a/test/nockpt.test +++ b/test/nockpt.test @@ -61,7 +61,7 @@ do_test 1.14 { sqlite3_db_config db NO_CKPT_ON_CLOSE 1 } {1} do_execsql_test 1.14 { PRAGMA main.journal_mode = delete } {delete} do_test 1.15 { file exists test.db-wal } {0} -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(platform) ne "windows"} { #------------------------------------------------------------------------- # Test an unusual scenario: # diff --git a/test/pager1.test b/test/pager1.test index 91a32c2c6..9a39e6f37 100644 --- a/test/pager1.test +++ b/test/pager1.test @@ -567,7 +567,7 @@ foreach {tn1 tcl} { # make sure SQLite doesn't get confused by this. # set nPadding [expr 511 - $::mj_filename_length] - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { # TBD need to figure out how to do this correctly for Windows!!! set nPadding [expr 255 - $::mj_filename_length] } diff --git a/test/permutations.test b/test/permutations.test index 5bbef184c..87a14ef66 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -104,7 +104,7 @@ foreach f [glob -nocomplain $testdir/../ext/session/*.test] { } unset f -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(platform) ne "unix"} { set alltests [test_set $alltests -exclude crash.test crash2.test] } set alltests [test_set $alltests -exclude { diff --git a/test/pragma.test b/test/pragma.test index e823a6763..5249cc7c4 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -1823,7 +1823,7 @@ do_test pragma-19.5 { file tail [lindex [execsql {PRAGMA filename}] 0] } {test.db} -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { # Test data_store_directory pragma # db close diff --git a/test/quota.test b/test/quota.test index 5d0bda3ad..f49600043 100644 --- a/test/quota.test +++ b/test/quota.test @@ -216,7 +216,7 @@ do_test quota-3.2.9 { set ::quota [list] proc quota_callback {file limitvar size} { upvar $limitvar limit - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set file [ lindex [string map {\\ \/} $file] 0 ] } lappend ::quota $file $size @@ -351,7 +351,7 @@ do_test quota-4.3.1 { } {} unset -nocomplain quotagroup -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set quotagroup *\\quota-test-A?.db } else { set quotagroup */quota-test-A?.db @@ -402,7 +402,7 @@ do_test quota-4.4.7 { } [expr {[file size quota-test-A1.db]+[file size quota-test-A2.db]}] unset -nocomplain quotagroup -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set quotagroup *\\quota-test-B* } else { set quotagroup */quota-test-B* diff --git a/test/readonly.test b/test/readonly.test index 303300e6f..00392266e 100644 --- a/test/readonly.test +++ b/test/readonly.test @@ -15,7 +15,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/shared.test b/test/shared.test index 146830e56..42292ab40 100644 --- a/test/shared.test +++ b/test/shared.test @@ -161,7 +161,7 @@ do_test shared-$av.1.8 { do_test shared-$av.2.1 { # Open connection db3 to the database. - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { sqlite3 db3 "file:test.db?cache=private" -uri 1 } else { sqlite3 db3 TEST.DB @@ -797,7 +797,7 @@ do_test shared-$av.10.2 { do_test shared-$av.10.3 { # An external connection should be able to read the database, but not # prepare a write operation. - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { sqlite3 db3 "file:test.db?cache=private" -uri 1 } else { sqlite3 db3 TEST.DB diff --git a/test/shared3.test b/test/shared3.test index e31306999..2e32398ca 100644 --- a/test/shared3.test +++ b/test/shared3.test @@ -70,7 +70,7 @@ do_test shared3-2.5 { # test case shared3-2.3 above). The goal of the following tests is to # ensure that the cache-size really is 10 pages. # -#if {$::tcl_platform(platform)=="unix"} { +#if {$::tcl_platform(platform) eq "unix"} { # set alternative_name ./test.db #} else { # set alternative_name TEST.DB diff --git a/test/shell3.test b/test/shell3.test index ef3ea784f..6bb49f5c3 100644 --- a/test/shell3.test +++ b/test/shell3.test @@ -36,7 +36,7 @@ sqlite3 db test.db # different. This causes problems for the tests below. To avoid # issues, these tests are disabled for windows. # -if {$::tcl_platform(platform)=="windows"} { +if {$::tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/shell8.test b/test/shell8.test index ca37598e9..e55539636 100644 --- a/test/shell8.test +++ b/test/shell8.test @@ -55,7 +55,7 @@ proc dir_to_list {dirname {n -1}} { set res [list] foreach f [glob -nocomplain $dirname/*] { set mtime [file mtime $f] - if {$::tcl_platform(platform)!="windows"} { + if {$::tcl_platform(platform) ne "windows"} { set perm [file attributes $f -perm] } else { set perm 0 diff --git a/test/symlink2.test b/test/symlink2.test index 9a2237e4c..7305f6dd3 100644 --- a/test/symlink2.test +++ b/test/symlink2.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl set testprefix symlink2 # This only runs on Windows. -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(platform) ne "windows"} { finish_test return } diff --git a/test/uri.test b/test/uri.test index 2b388c400..74da225ac 100644 --- a/test/uri.test +++ b/test/uri.test @@ -59,7 +59,7 @@ foreach {tn uri file} { if {[string first %00 $uri]>=0} continue } - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { # # NOTE: Due to limits on legal characters for file names imposed by # Windows, we must skip the final two tests here (i.e. the @@ -306,7 +306,7 @@ foreach {tn uri res} { 6 "file://x/PWD/test.db" {invalid uri authority: x} } { - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { set uri [string map [list PWD [string range [get_pwd] 3 end]] $uri] } else { set uri [string map [list PWD [string range [get_pwd] 1 end]] $uri] diff --git a/test/vacuum-into.test b/test/vacuum-into.test index d559b7fb3..c041ebe7a 100644 --- a/test/vacuum-into.test +++ b/test/vacuum-into.test @@ -111,7 +111,7 @@ do_catchsql_test vacuum-into-420 { # The ability to VACUUM INTO a read-only database db close -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { file attributes test.db -readonly 1 } else { file attributes test.db -permissions 292 ;# 292 == 0444 @@ -121,7 +121,7 @@ forcedelete test.db2 do_execsql_test vacuum-into-500 { VACUUM INTO 'test.db2'; } -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { file attributes test.db -readonly 0 } else { file attributes test.db -permissions 420 ;# 420 = 0644 diff --git a/test/vtabH.test b/test/vtabH.test index cf3dcafd9..07704cefb 100644 --- a/test/vtabH.test +++ b/test/vtabH.test @@ -124,13 +124,13 @@ foreach ::tclvar_set_omit {0 1} { #------------------------------------------------------------------------- # -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set drive [string range [pwd] 0 1] set ::env(fstreeDrive) $drive } reset_db register_fs_module db -if {$tcl_platform(platform)!="windows" || \ +if {$tcl_platform(platform) ne "windows" || \ [regexp -nocase -- {^[A-Z]:} $drive]} { do_execsql_test 3.0 { SELECT name FROM fsdir WHERE dir = '.' AND name = 'test.db'; diff --git a/test/walblock.test b/test/walblock.test index 23167a883..86a52b3f9 100644 --- a/test/walblock.test +++ b/test/walblock.test @@ -17,7 +17,7 @@ source $testdir/wal_common.tcl finish_test; return; # Feature currently not implemented. ifcapable !wal {finish_test ; return } -if {$::tcl_platform(platform)!="unix"} { finish_test ; return } +if {$::tcl_platform(platform) ne "unix"} { finish_test ; return } set testprefix walblock catch { db close } diff --git a/test/walcrash4.test b/test/walcrash4.test index 80839b39e..43292def4 100644 --- a/test/walcrash4.test +++ b/test/walcrash4.test @@ -38,7 +38,7 @@ faultsim_save_and_close # The error message is different on unix and windows # -if {$::tcl_platform(platform)=="windows"} { +if {$::tcl_platform(platform) eq "windows"} { set msg "child killed: unknown signal" } else { set msg "child process exited abnormally" diff --git a/test/walsetlk.test b/test/walsetlk.test index b65eb9ab6..969bcaf46 100644 --- a/test/walsetlk.test +++ b/test/walsetlk.test @@ -204,10 +204,10 @@ do_multiclient_test tn { # set bSleep 1 if {$::sqlite_options(setlk_timeout)==1} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set bSleep 0 } - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { set bSleep [expr $tn==2] } } @@ -252,7 +252,7 @@ do_test 3.1b { # Set bExpect to true if calls to xSleep() are expected. Such calls are # expected unless this is an SQLITE_ENABLE_SETLK_TIMEOUT=1 build. set bExpect 1 -if {$tcl_platform(platform)=="windows" && $::sqlite_options(setlk_timeout)==1} { +if {$tcl_platform(platform) eq "windows" && $::sqlite_options(setlk_timeout)==1} { set bExpect 0 } do_test 3.2 { diff --git a/test/win32heap.test b/test/win32heap.test index 82a3f6b66..b62126b77 100644 --- a/test/win32heap.test +++ b/test/win32heap.test @@ -12,7 +12,7 @@ # focus of this script is the Win32 heap implementation. # -if {$tcl_platform(platform)!="windows"} return +if {$tcl_platform(platform) ne "windows"} return set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/test/writecrash.test b/test/writecrash.test index 01bc4dbb5..aca89aafb 100644 --- a/test/writecrash.test +++ b/test/writecrash.test @@ -21,7 +21,7 @@ set testprefix writecrash do_not_use_codec -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/zipfile.test b/test/zipfile.test index 0f854a676..016a20b42 100644 --- a/test/zipfile.test +++ b/test/zipfile.test @@ -45,7 +45,7 @@ if {[catch {exec unzip} msg]==0 && \ [regexp -line {^UnZip \d+\.\d+ .*? Info-ZIP\.} $msg]} { set ::UNZIP unzip proc fix_stat_mode {name mode} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { # # NOTE: Set or unset the write bits of the file permissions # based on the read-only attribute because the Win32 @@ -280,7 +280,7 @@ do_execsql_test 1.6.2 { i.txt 33188 4 zxcvb 0 } -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { set modes -rw-r--r-x set perms 33189 } else { @@ -407,7 +407,7 @@ if {[info exists ::UNZIP]} { do_test 2.5.1 { forcedelete dirname forcedelete dirname2 - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { set null /dev/null } else { set null NUL @@ -765,7 +765,7 @@ do_execsql_test 11.11 { } {b0suffix two b2suffix one} -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { do_test 12.0 { catch { file delete -force subdir } foreach {path sz} { |