Fix an file separator character issue with test_quota.c that was causing

it to fail on windows.

FossilOrigin-Name: ddb8d3e80df868bda0704feed31171fa055432b5
This commit is contained in:
drh 2011-08-25 03:38:31 +00:00
parent 31e8097658
commit 26541c9a00
4 changed files with 46 additions and 31 deletions

View File

@ -1,5 +1,5 @@
C Cherrypick\sthe\s[d4f6437f8d]\schange\sso\sthat\sSQLITE_FCNTL_SIZE_HINT\sis\salways\nhonored\sand\snever\sundone\sby\smemory\spressure\son\swindows.
D 2011-08-25T01:58:17.932
C Fix\san\sfile\sseparator\scharacter\sissue\swith\stest_quota.c\sthat\swas\scausing\nit\sto\sfail\son\swindows.
D 2011-08-25T03:38:31.807
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 8c930e7b493d59099ea1304bd0f2aed152eb3315
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -219,7 +219,7 @@ F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
F src/test_osinst.c 62b0b8ef21ce754cc94e17bb42377ed8795dba32
F src/test_pcache.c 7bf828972ac0d2403f5cfa4cd14da41f8ebe73d8
F src/test_quota.c 8cba4d8eb7db7118df3d735278e37b5b78b0e7b6
F src/test_quota.c a391c866217e92986c6f523f05b08aa6956c8419
F src/test_rtree.c 30c981837445a4e187ee850a49c4760d9642f7c3
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
@ -626,7 +626,7 @@ F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
F test/quota.test 482ba633252e88b7e3f492d0b5feddb4ec573e98
F test/quota.test 1c59a396e8f7b5d8466fa74b59f2aeb778d74f7a
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
F test/randexpr1.test 1084050991e9ba22c1c10edd8d84673b501cc25a
@ -961,7 +961,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5
F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings.sh b7fdb2cc525f5ef4fa43c80e771636dd3690f9d2
P 2b7fe8e5b74c3504edd0e3ff78096e357ee1b47c
R 36794aff5f4e59db0011ed3cfb68a8bd
P 67ff8d27f6aa6e0beff1f6b72a997b30a9647879
R 189663821404b788f9cb42e77814f964
U drh
Z d927f02499c2c18cd5f3df33fe1648f7
Z e58750e60b6d57b280118e37270351cf

View File

@ -1 +1 @@
67ff8d27f6aa6e0beff1f6b72a997b30a9647879
ddb8d3e80df868bda0704feed31171fa055432b5

View File

@ -815,8 +815,8 @@ int sqlite3_quota_file(const char *zFilename){
SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_DB, &outFlags);
}
if( rc==SQLITE_OK ){
quotaFileSize(fd, &iSize);
quotaClose(fd);
fd->pMethods->xFileSize(fd, &iSize);
fd->pMethods->xClose(fd);
}else if( rc==SQLITE_CANTOPEN ){
quotaGroup *pGroup;
quotaFile *pFile;

View File

@ -336,9 +336,18 @@ do_test quota-4.3.1 {
quota_list
} {}
unset -nocomplain quotagroup
if {$tcl_platform(platform)=="windows"} {
set quotagroup *\\quota-test-A?.db
} else {
set quotagroup */quota-test-A?.db
}
foreach file [glob -nocomplain quota-test-A*] {
forcedelete $file
}
do_test quota-4.4.1 {
set ::quota {}
sqlite3_quota_set */quota-test-A?.db 10000 quota_callback
sqlite3_quota_set $::quotagroup 10000 quota_callback
file delete -force ./quota-test-A1.db ./quota-test-A2.db
sqlite3 db ./quota-test-A1.db
db eval {
@ -346,7 +355,7 @@ do_test quota-4.4.1 {
INSERT INTO t1 VALUES(randomblob(5000));
}
quota_list
} {*/quota-test-A?.db}
} [list $quotagroup]
do_test quota-4.4.2 {
expr {$::quota==""}
} {1}
@ -358,36 +367,42 @@ do_test quota-4.4.3 {
INSERT INTO t1 VALUES(randomblob(5000));
}
quota_list
} {*/quota-test-A?.db}
} [list $quotagroup]
do_test quota-4.4.4 {
expr {$::quota!=""}
} {1}
do_test quota-4.4.5 {
db close
sqlite3_quota_set */quota-test-A?.db 0 {}
sqlite3_quota_set $::quotagroup 0 {}
sqlite3_quota_dump
} {}
do_test quota-4.4.6 {
sqlite3_quota_set */quota-test-A?.db 10000 quota_callback
sqlite3_quota_set $quotagroup 10000 quota_callback
sqlite3 db quota-test-A1.db
db eval {SELECT count(*) FROM sqlite_master}
quota_size */quota-test-A?.db
quota_size $quotagroup
} [file size quota-test-A1.db]
do_test quota-4.4.7 {
sqlite3_quota_file quota-test-A2.db
quota_size */quota-test-A?.db
quota_size $::quotagroup
} [expr {[file size quota-test-A1.db]+[file size quota-test-A2.db]}]
do_test quota-4.5.1 {
unset -nocomplain quotagroup
if {$tcl_platform(platform)=="windows"} {
set quotagroup *\\quota-test-B*
} else {
set quotagroup */quota-test-B*
}
foreach file [glob -nocomplain quota-test-B*] {
forcedelete $file
}
sqlite3_quota_set */quota-test-B* 100000 quota_callback
quota_size */quota-test-B*
do_test quota-4.5.1 {
sqlite3_quota_set $::quotagroup 100000 quota_callback
quota_size $::quotagroup
} {0}
do_test quota-4.5.2 {
sqlite3_quota_file quota-test-B1.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {0}
proc add_to_file {name n} {
set out [open $name a]
@ -398,36 +413,36 @@ proc add_to_file {name n} {
do_test quota-4.5.3 {
add_to_file quota-test-B1.txt 123
sqlite3_quota_file quota-test-B1.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {123}
do_test quota-4.5.4 {
add_to_file quota-test-B2.txt 234
sqlite3_quota_file quota-test-B2.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {357}
do_test quota-4.5.5 {
add_to_file quota-test-B1.txt 2000
sqlite3_quota_file quota-test-B1.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {2357}
do_test quota-4.5.6 {
forcedelete quota-test-B1.txt
sqlite3_quota_file quota-test-B1.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {234}
do_test quota-4.5.7 {
forcedelete quota-test-B2.txt
sqlite3_quota_file quota-test-B2.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {0}
do_test quota-4.5.8 {
add_to_file quota-test-B3.txt 1234
sqlite3_quota_file quota-test-B3.txt
quota_size */quota-test-B*
quota_size $::quotagroup
} {1234}
do_test quota-4.5.9 {
sqlite3_quota_set */quota-test-B* 0 {}
quota_size */quota-test-B*
sqlite3_quota_set $quotagroup 0 {}
quota_size $::quotagroup
} {0}
do_test quota-4.9.1 {