aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test49
1 files changed, 49 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test b/libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test
new file mode 100644
index 0000000..678a12c
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/btree9.test
@@ -0,0 +1,49 @@
1# 2007 May 01
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library. The
12# focus of this script is btree database backend.
13#
14# $Id: btree9.test,v 1.1 2007/05/02 01:34:32 drh Exp $
15
16set testdir [file dirname $argv0]
17source $testdir/tester.tcl
18
19# The sqlite3BtreeInsert() API now has an additional "nZero" parameter
20# which specifies the number of zero bytes to append to the end of the
21# data. This feature allows large zero-filled BLOBs to be created without
22# having to allocate a big chunk of memory to instantiate the blob.
23#
24# The following code tests the new feature.
25#
26
27# Create the database
28#
29do_test btree9-1.1 {
30 file delete -force test1.bt
31 file delete -force test1.bt-journal
32 set b1 [btree_open test1.bt 2000 0]
33 btree_begin_transaction $b1
34 set t1 [btree_create_table $b1 5]
35 set c1 [btree_cursor $b1 $t1 1]
36 btree_insert $c1 1 data-for-1 20000
37 btree_move_to $c1 1
38 btree_key $c1
39} {1}
40do_test btree9-1.2 {
41 btree_payload_size $c1
42} {20010}
43
44
45btree_close_cursor $c1
46btree_commit $b1
47btree_close $b1
48
49finish_test