From 1b5ba8e022836fa8ab93bc90df1b34a29ea6e134 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 17 Jan 2013 14:18:26 -0500 Subject: Imported Upstream version 2.1.1 --- test/quota2.test | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'test/quota2.test') diff --git a/test/quota2.test b/test/quota2.test index 5bb50d7..1482db6 100644 --- a/test/quota2.test +++ b/test/quota2.test @@ -12,6 +12,13 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl + +# If SQLITE_CURDIR is not defined, omit this file. +ifcapable !curdir { + finish_test + return +} + source $testdir/malloc_common.tcl db close @@ -164,11 +171,17 @@ do_test quota2-2.1 { do_test quota2-2.2 { set ::quota } {} -do_test quota2-2.3 { +do_test quota2-2.3.1 { sqlite3_quota_rewind $::h1 + sqlite3_quota_file_available $::h1 +} {7000} +do_test quota2-2.3.2 { set ::x [sqlite3_quota_fread $::h1 1001 7] string length $::x } {6006} +do_test quota2-2.3.3 { + sqlite3_quota_file_available $::h1 +} {0} do_test quota2-2.4 { string match $::x [string range $::bigtext 0 6005] } {1} @@ -180,22 +193,40 @@ do_test quota2-2.6 { sqlite3_quota_fseek $::h1 -100 SEEK_END sqlite3_quota_ftell $::h1 } {6900} +do_test quota2-2.6.1 { + sqlite3_quota_file_available $::h1 +} {100} do_test quota2-2.7 { sqlite3_quota_fseek $::h1 -100 SEEK_CUR sqlite3_quota_ftell $::h1 } {6800} +do_test quota2-2.7.1 { + sqlite3_quota_file_available $::h1 +} {200} do_test quota2-2.8 { sqlite3_quota_fseek $::h1 50 SEEK_CUR sqlite3_quota_ftell $::h1 } {6850} +do_test quota2-2.8.1 { + sqlite3_quota_file_available $::h1 +} {150} do_test quota2-2.9 { sqlite3_quota_fseek $::h1 50 SEEK_SET sqlite3_quota_ftell $::h1 } {50} +do_test quota2-2.9.1 { + sqlite3_quota_file_available $::h1 +} {6950} do_test quota2-2.10 { sqlite3_quota_rewind $::h1 sqlite3_quota_ftell $::h1 } {0} +do_test quota2-2.10.1 { + sqlite3_quota_file_available $::h1 +} {7000} +do_test quota2-2.10.2 { + sqlite3_quota_ferror $::h1 +} {0} do_test quota2-2.11 { standard_path [sqlite3_quota_dump] } {{*/quota2b/* 5000 0} {*/quota2a/* 4000 0}} -- cgit v1.2.3