os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/varint.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
# 2001 September 15
sl@0
     2
#
sl@0
     3
# The author disclaims copyright to this source code.  In place of
sl@0
     4
# a legal notice, here is a blessing:
sl@0
     5
#
sl@0
     6
#    May you do good and not evil.
sl@0
     7
#    May you find forgiveness for yourself and forgive others.
sl@0
     8
#    May you share freely, never taking more than you give.
sl@0
     9
#
sl@0
    10
#***********************************************************************
sl@0
    11
# This file implements regression tests for SQLite library.  The
sl@0
    12
# focus of this script is variable-length integer encoding scheme.
sl@0
    13
#
sl@0
    14
# $Id: varint.test,v 1.1 2004/05/18 15:57:42 drh Exp $
sl@0
    15
sl@0
    16
sl@0
    17
set testdir [file dirname $argv0]
sl@0
    18
source $testdir/tester.tcl
sl@0
    19
sl@0
    20
# Test reading and writing of varints.
sl@0
    21
#
sl@0
    22
set cnt 0
sl@0
    23
foreach start {0 100 10000 1000000 0x10000000} {
sl@0
    24
  foreach mult {1 0x10 0x100 0x1000 0x10000 0x100000 0x1000000 0x10000000} {
sl@0
    25
    foreach incr {1 500 10000 50000000} {
sl@0
    26
      incr cnt
sl@0
    27
      do_test varint-1.$cnt {
sl@0
    28
        btree_varint_test $start $mult 5000 $incr
sl@0
    29
      } {}
sl@0
    30
    }
sl@0
    31
  }
sl@0
    32
}