xref: /sqlite-3.40.0/test/varint.test (revision 6bcabfe1)
1d8820e80Sdrh# 2001 September 15
2d8820e80Sdrh#
3d8820e80Sdrh# The author disclaims copyright to this source code.  In place of
4d8820e80Sdrh# a legal notice, here is a blessing:
5d8820e80Sdrh#
6d8820e80Sdrh#    May you do good and not evil.
7d8820e80Sdrh#    May you find forgiveness for yourself and forgive others.
8d8820e80Sdrh#    May you share freely, never taking more than you give.
9d8820e80Sdrh#
10d8820e80Sdrh#***********************************************************************
11d8820e80Sdrh# This file implements regression tests for SQLite library.  The
12d8820e80Sdrh# focus of this script is variable-length integer encoding scheme.
13d8820e80Sdrh#
14d8820e80Sdrh# $Id: varint.test,v 1.1 2004/05/18 15:57:42 drh Exp $
15d8820e80Sdrh
16d8820e80Sdrh
17d8820e80Sdrhset testdir [file dirname $argv0]
18d8820e80Sdrhsource $testdir/tester.tcl
19d8820e80Sdrh
20d8820e80Sdrh# Test reading and writing of varints.
21d8820e80Sdrh#
22d8820e80Sdrhset cnt 0
23d8820e80Sdrhforeach start {0 100 10000 1000000 0x10000000} {
24d8820e80Sdrh  foreach mult {1 0x10 0x100 0x1000 0x10000 0x100000 0x1000000 0x10000000} {
25d8820e80Sdrh    foreach incr {1 500 10000 50000000} {
26d8820e80Sdrh      incr cnt
27d8820e80Sdrh      do_test varint-1.$cnt {
28d8820e80Sdrh        btree_varint_test $start $mult 5000 $incr
29d8820e80Sdrh      } {}
30d8820e80Sdrh    }
31d8820e80Sdrh  }
32d8820e80Sdrh}
33*6bcabfe1Sdan
34*6bcabfe1Sdanfinish_test
35