/ Check-in [650b3282]
Login

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

Overview
Comment:Fix test issues for Windows portability.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:650b32825a85baff11b8e568649fd797066c8ab1
User & Date: mistachkin 2013-09-13 23:26:47
Context
2013-09-13
23:27
Fix Windows SDK compiler warning. check-in: d5fc3f1d user: mistachkin tags: trunk
23:26
Fix test issues for Windows portability. check-in: 650b3282 user: mistachkin tags: trunk
22:38
VSIX tooling changes to support Visual Studio 2013. check-in: d56fac40 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/bigfile2.test.

    53     53     execsql { INSERT INTO t1 VALUES(3, $str) }
    54     54     db close
    55     55     sqlite3 db test.db
    56     56     db one { SELECT b FROM t1 WHERE a = 3 }
    57     57   } $str
    58     58   
    59     59   db close
    60         -file delete test.db
           60  +delete_file test.db
    61     61   
    62     62   finish_test

Changes to test/quota.test.

   357    357   } 
   358    358   foreach file [glob -nocomplain quota-test-A*] {
   359    359     forcedelete $file
   360    360   }
   361    361   do_test quota-4.4.1 {
   362    362     set ::quota {}
   363    363     sqlite3_quota_set $::quotagroup 10000 quota_callback
   364         -  file delete -force ./quota-test-A1.db ./quota-test-A2.db
          364  +  forcedelete ./quota-test-A1.db ./quota-test-A2.db
   365    365     sqlite3 db ./quota-test-A1.db
   366    366     db eval {
   367    367        CREATE TABLE t1(x);
   368    368        INSERT INTO t1 VALUES(randomblob(5000));
   369    369     }
   370    370     quota_list
   371    371   } [list $quotagroup]

Changes to test/quota2.test.

    21     21   
    22     22   source $testdir/malloc_common.tcl
    23     23   
    24     24   db close
    25     25   sqlite3_quota_initialize "" 1
    26     26   
    27     27   foreach dir {quota2a/x1 quota2a/x2 quota2a quota2b quota2c} {
    28         -  file delete -force $dir
           28  +  forcedelete $dir
    29     29   }
    30     30   foreach dir {quota2a quota2a/x1 quota2a/x2 quota2b quota2c} {
    31     31     file mkdir $dir
    32     32   }
    33     33   
    34     34   # The standard_path procedure converts a pathname into a standard format
    35     35   # that is the same across platforms.

Changes to test/shell1.test.

   532    532   } {1 {Error: unknown command or invalid arguments:  "quit". Enter ".help" for help}}
   533    533   
   534    534   # .read FILENAME         Execute SQL in FILENAME
   535    535   do_test shell1-3.19.1 {
   536    536     catchcmd "test.db" ".read"
   537    537   } {1 {Error: unknown command or invalid arguments:  "read". Enter ".help" for help}}
   538    538   do_test shell1-3.19.2 {
   539         -  file delete -force FOO
          539  +  forcedelete FOO
   540    540     catchcmd "test.db" ".read FOO"
   541    541   } {1 {Error: cannot open "FOO"}}
   542    542   do_test shell1-3.19.3 {
   543    543     # too many arguments
   544    544     catchcmd "test.db" ".read FOO BAD"
   545    545   } {1 {Error: unknown command or invalid arguments:  "read". Enter ".help" for help}}
   546    546   

Changes to test/shell2.test.

    38     38   #   shell2-1.*: Misc. test of various tickets and reported errors.
    39     39   #
    40     40   
    41     41   # Batch mode not creating databases.  
    42     42   # Reported on mailing list by Ken Zalewski.
    43     43   # Ticket [aeff892c57].
    44     44   do_test shell2-1.1.1 {
    45         -  file delete -force foo.db
           45  +  forcedelete foo.db
    46     46     set rc [ catchcmd "-batch foo.db" "CREATE TABLE t1(a);" ]
    47     47     set fexist [file exist foo.db]
    48     48     list $rc $fexist
    49     49   } {{0 {}} 1}
    50     50   
    51     51   # Shell silently ignores extra parameters.
    52     52   # Ticket [f5cb008a65].
................................................................................
    77     77   
    78     78   # Shell not echoing all commands with echo on.
    79     79   # Ticket [eb620916be].
    80     80   
    81     81   # Test with echo off
    82     82   # NB. whitespace is important
    83     83   do_test shell2-1.4.1 {
    84         -  file delete -force foo.db
           84  +  forcedelete foo.db
    85     85     catchcmd "foo.db" {CREATE TABLE foo(a);
    86     86   INSERT INTO foo(a) VALUES(1);
    87     87   SELECT * FROM foo;}
    88     88   } {0 1}
    89     89   
    90     90   # Test with echo on using command line option
    91     91   # NB. whitespace is important
    92     92   do_test shell2-1.4.2 {
    93         -  file delete -force foo.db
           93  +  forcedelete foo.db
    94     94     catchcmd "-echo foo.db" {CREATE TABLE foo(a);
    95     95   INSERT INTO foo(a) VALUES(1);
    96     96   SELECT * FROM foo;}
    97     97   } {0 {CREATE TABLE foo(a);
    98     98   INSERT INTO foo(a) VALUES(1);
    99     99   SELECT * FROM foo;
   100    100   1}}
   101    101   
   102    102   # Test with echo on using dot command
   103    103   # NB. whitespace is important
   104    104   do_test shell2-1.4.3 {
   105         -  file delete -force foo.db
          105  +  forcedelete foo.db
   106    106     catchcmd "foo.db" {.echo ON
   107    107   CREATE TABLE foo(a);
   108    108   INSERT INTO foo(a) VALUES(1);
   109    109   SELECT * FROM foo;}
   110    110   } {0 {CREATE TABLE foo(a);
   111    111   INSERT INTO foo(a) VALUES(1);
   112    112   SELECT * FROM foo;
   113    113   1}}
   114    114   
   115    115   # Test with echo on using dot command and 
   116    116   # turning off mid- processing.
   117    117   # NB. whitespace is important
   118    118   do_test shell2-1.4.4 {
   119         -  file delete -force foo.db
          119  +  forcedelete foo.db
   120    120     catchcmd "foo.db" {.echo ON
   121    121   CREATE TABLE foo(a);
   122    122   .echo OFF
   123    123   INSERT INTO foo(a) VALUES(1);
   124    124   SELECT * FROM foo;}
   125    125   } {0 {CREATE TABLE foo(a);
   126    126   .echo OFF
   127    127   1}}
   128    128   
   129    129   # Test with echo on using dot command and 
   130    130   # multiple commands per line.
   131    131   # NB. whitespace is important
   132    132   do_test shell2-1.4.5 {
   133         -  file delete -force foo.db
          133  +  forcedelete foo.db
   134    134     catchcmd "foo.db" {.echo ON
   135    135   CREATE TABLE foo1(a);
   136    136   INSERT INTO foo1(a) VALUES(1);
   137    137   CREATE TABLE foo2(b);
   138    138   INSERT INTO foo2(b) VALUES(1);
   139    139   SELECT * FROM foo1; SELECT * FROM foo2;
   140    140   INSERT INTO foo1(a) VALUES(2); INSERT INTO foo2(b) VALUES(2);
................................................................................
   157    157   1
   158    158   2}}
   159    159   
   160    160   # Test with echo on and headers on using dot command and 
   161    161   # multiple commands per line.
   162    162   # NB. whitespace is important
   163    163   do_test shell2-1.4.6 {
   164         -  file delete -force foo.db
          164  +  forcedelete foo.db
   165    165     catchcmd "foo.db" {.echo ON
   166    166   .headers ON
   167    167   CREATE TABLE foo1(a);
   168    168   INSERT INTO foo1(a) VALUES(1);
   169    169   CREATE TABLE foo2(b);
   170    170   INSERT INTO foo2(b) VALUES(1);
   171    171   SELECT * FROM foo1; SELECT * FROM foo2;

Changes to test/shell3.test.

    36     36   
    37     37   #----------------------------------------------------------------------------
    38     38   #   shell3-1.*: Basic tests for running SQL statments from command line.
    39     39   #
    40     40   
    41     41   # Run SQL statement from command line
    42     42   do_test shell3-1.1 {
    43         -  file delete -force foo.db
           43  +  forcedelete foo.db
    44     44     set rc [ catchcmd "foo.db \"CREATE TABLE t1(a);\"" ]
    45     45     set fexist [file exist foo.db]
    46     46     list $rc $fexist
    47     47   } {{0 {}} 1}
    48     48   do_test shell3-1.2 {
    49     49     catchcmd "foo.db" ".tables"
    50     50   } {0 t1}
................................................................................
    66     66   
    67     67   #----------------------------------------------------------------------------
    68     68   #   shell3-2.*: Basic tests for running SQL file from command line.
    69     69   #
    70     70   
    71     71   # Run SQL file from command line
    72     72   do_test shell3-2.1 {
    73         -  file delete -force foo.db
           73  +  forcedelete foo.db
    74     74     set rc [ catchcmd "foo.db" "CREATE TABLE t1(a);" ]
    75     75     set fexist [file exist foo.db]
    76     76     list $rc $fexist
    77     77   } {{0 {}} 1}
    78     78   do_test shell3-2.2 {
    79     79     catchcmd "foo.db" ".tables"
    80     80   } {0 t1}

Changes to test/shell5.test.

    28     28   }
    29     29   if {![file executable $CLI]} {
    30     30     finish_test
    31     31     return
    32     32   }
    33     33   db close
    34     34   forcedelete test.db test.db-journal test.db-wal
    35         -sqlite3 db test.db
    36     35   
    37     36   #----------------------------------------------------------------------------
    38     37   # Test cases shell5-1.*: Basic handling of the .import and .separator commands.
    39     38   #
    40     39   
    41     40   # .import FILE TABLE     Import data from FILE into TABLE
    42     41   do_test shell5-1.1.1 {
................................................................................
    77     76     set res [catchcmd "test.db" {.separator ,
    78     77   .show}]
    79     78     list [regexp {separator: \",\"} $res]
    80     79   } {1}
    81     80   
    82     81   # import file doesn't exist
    83     82   do_test shell5-1.4.1 {
    84         -  file delete -force FOO
           83  +  forcedelete FOO
    85     84     set res [catchcmd "test.db" {CREATE TABLE t1(a, b);
    86     85   .import FOO t1}]
    87     86   } {1 {Error: cannot open "FOO"}}
    88     87   
    89     88   # empty import file
    90     89   do_test shell5-1.4.2 {
    91         -  file delete -force shell5.csv
           90  +  forcedelete shell5.csv
    92     91     set in [open shell5.csv w]
    93     92     close $in
    94     93     set res [catchcmd "test.db" {.import shell5.csv t1
    95     94   SELECT COUNT(*) FROM t1;}]
    96     95   } {0 0}
    97     96   
    98     97   # import file with 1 row, 1 column (expecting 2 cols)
................................................................................
   227    226   .import shell5.csv t3
   228    227   SELECT COUNT(*) FROM t3;}]
   229    228   } [list 0 $rows]
   230    229   
   231    230   # Inport from a pipe.  (Unix only, as it requires "awk")
   232    231   if {$tcl_platform(platform)=="unix"} {
   233    232     do_test shell5-1.8 {
   234         -    file delete -force test.db
          233  +    forcedelete test.db
   235    234       catchcmd test.db {.mode csv
   236    235   .import "|awk 'END{print \"x,y\";for(i=1;i<=5;i++){print i \",this is \" i}}'" t1
   237    236   SELECT * FROM t1;}
   238    237     } {0 {1,"this is 1"
   239    238   2,"this is 2"
   240    239   3,"this is 3"
   241    240   4,"this is 4"
   242    241   5,"this is 5"}}
   243    242   }
   244    243   
   245    244   # Import columns containing quoted strings
   246    245   do_test shell5-1.9 {
   247    246     set out [open shell5.csv w]
          247  +  fconfigure $out -translation lf
   248    248     puts $out {1,"",11}
   249    249     puts $out {2,"x",22}
   250    250     puts $out {3,"""",33}
   251    251     puts $out {4,"hello",44}
   252    252     puts $out "5,55,\"\"\r"
   253    253     puts $out {6,66,"x"}
   254    254     puts $out {7,77,""""}
   255    255     puts $out {8,88,"hello"}
   256    256     puts $out {"",9,99}
   257    257     puts $out {"x",10,110}
   258    258     puts $out {"""",11,121}
   259    259     puts $out {"hello",12,132}
   260    260     close $out
   261         -  file delete -force test.db
          261  +  forcedelete test.db
   262    262     catchcmd test.db {.mode csv
   263    263       CREATE TABLE t1(a,b,c);
   264    264   .import shell5.csv t1
   265    265     }
   266    266     sqlite3 db test.db
   267    267     db eval {SELECT *, '|' FROM t1 ORDER BY rowid}
   268    268   } {1 {} 11 | 2 x 22 | 3 {"} 33 | 4 hello 44 | 5 55 {} | 6 66 x | 7 77 {"} | 8 88 hello | {} 9 99 | x 10 110 | {"} 11 121 | hello 12 132 |}
   269    269   db close
   270    270   
   271    271   finish_test