/ Check-in [95ffdaa5]
Login

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

Overview
Comment:Add further tests to ota5.test. Add "ota.test", for running all ota tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: 95ffdaa542df1c28fac97422e5a4b2c5cb81d50a
User & Date: dan 2014-09-19 18:08:39
Context
2014-10-20
16:24
Have the ota extension perform an incremental checkpoint after generating the wal file. check-in: 0bf1301a user: dan tags: ota-update
2014-09-19
18:08
Add further tests to ota5.test. Add "ota.test", for running all ota tests. check-in: 95ffdaa5 user: dan tags: ota-update
15:06
Add extra tests for the ota extension. check-in: 1e468fe1 user: dan tags: ota-update
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/ota/ota1.test.

     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   
    13         -set testdir [file join [file dirname $argv0] .. .. test]
           13  +if {![info exists testdir]} {
           14  +  set testdir [file join [file dirname [info script]] .. .. test]
           15  +}
    14     16   source $testdir/tester.tcl
    15     17   set ::testprefix ota1
    16     18   
    17     19   
    18     20   # Create a simple OTA database. That expects to write to a table:
    19     21   #
    20     22   #   CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);

Changes to ext/ota/ota2.test.

     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   
    13         -set testdir [file join [file dirname $argv0] .. .. test]
           13  +if {![info exists testdir]} {
           14  +  set testdir [file join [file dirname [info script]] .. .. test]
           15  +}
    14     16   source $testdir/tester.tcl
    15     17   set ::testprefix ota2
    16     18   
    17         -forcedelete test.db-oal test.db-bak
           19  +forcedelete {*}[glob -nocomplain test.db?*]
    18     20   
    19     21   do_execsql_test 1.0 {
    20     22     CREATE TABLE t1(a, b);
    21     23     INSERT INTO t1 VALUES(1, 2);
    22     24   } {}
    23     25   do_test 1.1 { glob test.db* } {test.db}
    24     26   

Changes to ext/ota/ota3.test.

     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   
    13         -set testdir [file join [file dirname $argv0] .. .. test]
           13  +if {![info exists testdir]} {
           14  +  set testdir [file join [file dirname [info script]] .. .. test]
           15  +}
    14     16   source $testdir/tester.tcl
    15     17   set ::testprefix ota3
    16     18   
    17     19   
    18     20   # Run the OTA in file $ota on target database $target until completion.
    19     21   #
    20     22   proc run_ota {target ota} {

Changes to ext/ota/ota4.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # Test some properties of the pager_ota_mode and ota_mode pragmas.
    13     13   #
    14     14   
    15         -set testdir [file join [file dirname $argv0] .. .. test]
           15  +if {![info exists testdir]} {
           16  +  set testdir [file join [file dirname [info script]] .. .. test]
           17  +}
    16     18   source $testdir/tester.tcl
    17     19   set ::testprefix ota4
    18     20   
    19     21   #-------------------------------------------------------------------------
    20     22   # The following tests aim to verify some properties of the pager_ota_mode
    21     23   # pragma:
    22     24   #

Changes to ext/ota/ota5.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # Test some properties of the pager_ota_mode and ota_mode pragmas.
    13     13   #
    14     14   
    15         -set testdir [file join [file dirname $argv0] .. .. test]
           15  +if {![info exists testdir]} {
           16  +  set testdir [file join [file dirname [info script]] .. .. test]
           17  +}
    16     18   source $testdir/tester.tcl
    17     19   set ::testprefix ota5
    18     20   
    19     21   
    20     22   # Run the OTA in file $ota on target database $target until completion.
    21     23   #
    22     24   proc run_ota {target ota} {
................................................................................
   231    233   
   232    234       db close
   233    235     }
   234    236   }
   235    237   
   236    238   #-------------------------------------------------------------------------
   237    239   #
          240  +reset_db
          241  +do_execsql_test 2.0 {
          242  +  CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, d, e);
          243  +  INSERT INTO t1 VALUES(-750250,'fyetckfaagjkzqjx',-185831,X'FEAD',444258.29);
          244  +  INSERT INTO t1 VALUES(649081,NULL,X'7DF25BF78778',-342324.63,'akvspktocwozo');
          245  +  INSERT INTO t1 VALUES(-133045,-44822.31,X'',287935,NULL);
          246  +  INSERT INTO t1 VALUES(202132,NULL,X'5399','cujsjtspryqeyovcdpz','m');
          247  +  INSERT INTO t1 VALUES(302910,NULL,'dvdhivtfkaedzhdcnn',-717113.41,688487);
          248  +  INSERT INTO t1 VALUES(-582327,X'7A267A',X'7E6B3CFE5CB9','zacuzilrok',-196478);
          249  +  INSERT INTO t1 VALUES(-190462,X'D1A087E7D68D9578','lsmleti',NULL,-928094);
          250  +  INSERT INTO t1 VALUES(-467665,176344.57,-536684.23,828876.22,X'903E');
          251  +  INSERT INTO t1 VALUES(-629138,632630.29,X'28D6',-774501,X'819BBBFC65');
          252  +  INSERT INTO t1 VALUES(-828110,-54379.24,-881121.44,X'',X'8D5A894F0D');
          253  +
          254  +  CREATE TABLE t2(a PRIMARY KEY, b, c, d, e) WITHOUT ROWID;
          255  +  INSERT INTO t2 VALUES(-65174,X'AC1DBFFE27310F',-194471.08,347988,X'84041BA6F9BDDE86A8');
          256  +  INSERT INTO t2 VALUES('bzbpi',-952693.69,811628.25,NULL,-817434);
          257  +  INSERT INTO t2 VALUES(-643830,NULL,'n',NULL,'dio');
          258  +  INSERT INTO t2 VALUES('rovoenxxj',NULL,'owupbtdcoxxnvg',-119676,X'55431DFA');
          259  +  INSERT INTO t2 VALUES(899770,'jlygdl',X'DBCA4D1A',NULL,-631773);
          260  +  INSERT INTO t2 VALUES(334698.80,NULL,-697585.58,-89277,-817352);
          261  +  INSERT INTO t2 VALUES(X'1A9EB7547A4AAF38','aiprdhkpzdz','anw','szvjbwdvzucybpwwqjt',X'53');
          262  +  INSERT INTO t2 VALUES(713220,NULL,'hfcqhqzjuqplvkum',X'20B076075649DE','fthgpvqdyy');
          263  +  INSERT INTO t2 VALUES(763908,NULL,'xgslzcpvwfknbr',X'75',X'668146');
          264  +  INSERT INTO t2 VALUES(X'E1BA2B6BA27278','wjbpd',NULL,139341,-290086.15);
          265  +}
          266  +db close
          267  +
          268  +set cksum [generate_ota_db test.db ota.db {
          269  +INSERT INTO t2 VALUES(222916.23,'idh',X'472C517405',X'E3',X'7C4F31824669');
          270  +INSERT INTO t2 VALUES('xcndjwafcoxwxizoktd',-319567.21,NULL,-720906.43,-577170);
          271  +INSERT INTO t2 VALUES(376369.99,-536058,'yoaiurfqupdscwc',X'29EC8A2542EC3953E9',-740485.22);
          272  +INSERT INTO t2 VALUES(X'0EFB4DC50693',-175590.83,X'1779E253CAB5B1789E',X'BC6903',NULL);
          273  +INSERT INTO t2 VALUES(-288299,'hfrp',NULL,528477,730676.77);
          274  +DELETE FROM t2 WHERE a < -60000;
          275  +
          276  +UPDATE t2 SET b = 'pgnnaaoflnw' WHERE a = 'bzbpi';
          277  +UPDATE t2 SET c = -675583 WHERE a = 'rovoenxxj';
          278  +UPDATE t2 SET d = X'09CDF2B2C241' WHERE a = 713220;
          279  +
          280  +INSERT INTO t1 VALUES(224938,'bmruycvfznhhnfmgqys','fr',854381,789143);
          281  +INSERT INTO t1 VALUES(-863931,-1386.26,X'2A058540C2FB5C',NULL,X'F9D5990A');
          282  +INSERT INTO t1 VALUES(673696,X'97301F0AC5735F44B5',X'440C',227999.92,-709599.79);
          283  +INSERT INTO t1 VALUES(-243640,NULL,-71718.11,X'1EEFEB38',X'8CC7C55D95E142FBA5');
          284  +INSERT INTO t1 VALUES(275893,X'',375606.30,X'0AF9EC334711FB',-468194);
          285  +DELETE FROM t1 WHERE a > 200000;
          286  +
          287  +UPDATE t1 SET b = 'pgnnaaoflnw' WHERE a = -190462;
          288  +UPDATE t1 SET c = -675583 WHERE a = -467665;
          289  +UPDATE t1 SET d = X'09CDF2B2C241' WHERE a = -133045;
          290  +
          291  +}]
          292  +
          293  +foreach {tn idx} {
          294  +  1 {
          295  +  }
          296  +  2 {
          297  +    CREATE UNIQUE INDEX i1 ON t1(b, c, d);
          298  +    CREATE UNIQUE INDEX i2 ON t1(d, e, a);
          299  +    CREATE UNIQUE INDEX i3 ON t1(e, d, c, b);
          300  +
          301  +    CREATE UNIQUE INDEX i4 ON t2(b, c, d);
          302  +    CREATE UNIQUE INDEX i5 ON t2(d, e, a);
          303  +    CREATE UNIQUE INDEX i6 ON t2(e, d, c, b);
          304  +  }
          305  +} {
          306  +  foreach cmd {run step} {
          307  +    forcecopy test.db test.db2
          308  +    forcecopy ota.db ota.db2
          309  +
          310  +    sqlite3 db test.db2
          311  +    db eval $idx
          312  +
          313  +    do_test 2.$tn.$cmd.1 {
          314  +      ${cmd}_ota test.db2 ota.db2
          315  +      datacksum db
          316  +    } $cksum
          317  +
          318  +    do_test 2.$tn.$cmd.2 {
          319  +      db eval { PRAGMA integrity_check } 
          320  +    } {ok}
          321  +
          322  +    db close
          323  +  }
          324  +}
   238    325   
   239    326   
   240    327   finish_test
   241    328   
   242    329   
   243    330   
   244    331   

Added test/ota.test.

            1  +# 2014 September 20
            2  +#
            3  +#    May you do good and not evil.
            4  +#    May you find forgiveness for yourself and forgive others.
            5  +#    May you share freely, never taking more than you give.
            6  +#
            7  +#***********************************************************************
            8  +# This file runs all rtree related tests.
            9  +#
           10  +
           11  +set testdir [file dirname $argv0]
           12  +source $testdir/permutations.test
           13  +
           14  +run_test_suite ota
           15  +
           16  +finish_test

Changes to test/permutations.test.

   918    918     fts3am.test  fts3an.test  fts3ao.test  fts3b.test
   919    919     fts3c.test   fts3d.test   fts3e.test   fts3query.test 
   920    920   }
   921    921   
   922    922   test_suite "rtree" -description {
   923    923     All R-tree related tests. Provides coverage of source file rtree.c.
   924    924   } -files [glob -nocomplain $::testdir/../ext/rtree/*.test]
          925  +
          926  +test_suite "ota" -description {
          927  +  OTA tests.
          928  +} -files [
          929  +  test_set [glob -nocomplain $::testdir/../ext/ota/*.test] -exclude ota.test
          930  +]
   925    931   
   926    932   test_suite "no_optimization" -description {
   927    933     Run test scripts with optimizations disabled using the
   928    934     sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface.
   929    935   } -files {
   930    936     where.test where2.test where3.test where4.test where5.test
   931    937     where6.test where7.test where8.test where9.test