SQLite

Check-in [2b41c4959d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to test script io.test to work on symbian. (CVS 5717)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2b41c4959da2ef5a882a658e85ee34d07d31f379
User & Date: danielk1977 2008-09-18 11:18:41.000
Context
2008-09-18
11:30
Changes to test script nan.test to work on symbian. (CVS 5718) (check-in: 0889b22a29 user: danielk1977 tags: trunk)
11:18
Changes to test script io.test to work on symbian. (CVS 5717) (check-in: 2b41c4959d user: danielk1977 tags: trunk)
01:08
Performance improvements in getAndInitPage(): omit the upper bound check on page number if the page is already in cache. (CVS 5716) (check-in: badd0873e6 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/io.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
#
# The focus of this file is testing some specific characteristics of the 
# IO traffic generated by SQLite (making sure SQLite is not writing out
# more database pages than it has to, stuff like that).
#
# $Id: io.test,v 1.18 2008/08/20 14:49:25 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

db close
sqlite3_simulate_device
sqlite3 db test.db -vfs devsym







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
#
# The focus of this file is testing some specific characteristics of the 
# IO traffic generated by SQLite (making sure SQLite is not writing out
# more database pages than it has to, stuff like that).
#
# $Id: io.test,v 1.19 2008/09/18 11:18:41 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

db close
sqlite3_simulate_device
sqlite3 db test.db -vfs devsym
396
397
398
399
400
401
402
403



404
405
406
407
408
409
410
411
412
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
    }
    # File has grown - showing there was a cache-spill - but there 
    # have been no calls to fsync():



    list [file size test.db] [nSync]
  } {31744 0}
  do_test io-3.3 {
    # The COMMIT requires a single fsync() - to the database file.
    execsql { COMMIT }
    list [file size test.db] [nSync]
  } {39936 1}
}








|
>
>
>
|
|







396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
      INSERT INTO abc SELECT * FROM abc;
    }
    # File has grown - showing there was a cache-spill - but there 
    # have been no calls to fsync(). The file is probably about 30KB.
    # But some VFS implementations (symbian) buffer writes so the actual
    # size may be a little less than that. So this test case just tests
    # that the file is now greater than 20000 bytes in size.
    list [expr [file size test.db]>20000] [nSync]
  } {1 0}
  do_test io-3.3 {
    # The COMMIT requires a single fsync() - to the database file.
    execsql { COMMIT }
    list [file size test.db] [nSync]
  } {39936 1}
}

488
489
490
491
492
493
494




495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

510
511
512
513
514
515
516
do_test io-4.3.3 {
  execsql {
    BEGIN;
    UPDATE abc SET a = 'x';
  }
  file exists test.db-journal
} {1}




do_test io-4.3.4 {
  # The UPDATE statement in the statement above modifies 41 pages 
  # (all pages in the database except page 1 and the root page of 
  # abc). Because the cache_size is set to 10, this must have required
  # at least 4 cache-spills. If there were no journal headers written
  # to the journal file after the cache-spill, then the size of the
  # journal file is give by:
  #
  #    <jrnl file size> = <jrnl header size> + nPage * (<page-size> + 8)
  #
  # If the journal file contains additional headers, this formula
  # will not predict the size of the journal file.
  #
  file size test.db-journal
} [expr 512 + (1024+8)*41]


#----------------------------------------------------------------------
# Test cases io-5.* test that the default page size is selected and
# used correctly.
#
set tn 0
foreach {char                 sectorsize pgsize} {







>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
do_test io-4.3.3 {
  execsql {
    BEGIN;
    UPDATE abc SET a = 'x';
  }
  file exists test.db-journal
} {1}
if {$tcl_platform(platform) != "symbian"} {
  # This test is not run on symbian because the file-buffer makes it
  # difficult to predict the exact size of the file as reported by 
  # [file size].
  do_test io-4.3.4 {
    # The UPDATE statement in the statement above modifies 41 pages 
    # (all pages in the database except page 1 and the root page of 
    # abc). Because the cache_size is set to 10, this must have required
    # at least 4 cache-spills. If there were no journal headers written
    # to the journal file after the cache-spill, then the size of the
    # journal file is give by:
    #
    #    <jrnl file size> = <jrnl header size> + nPage * (<page-size> + 8)
    #
    # If the journal file contains additional headers, this formula
    # will not predict the size of the journal file.
    #
    file size test.db-journal
  } [expr 512 + (1024+8)*41]
}

#----------------------------------------------------------------------
# Test cases io-5.* test that the default page size is selected and
# used correctly.
#
set tn 0
foreach {char                 sectorsize pgsize} {