/ Check-in [7f3fc7f2]
Login

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

Overview
Comment:Changes to test code (only) to allow veryquick.test to run with OMIT_UTF16 builsd. Ticket #3985. (CVS 6919)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7f3fc7f20f6dc205eedbe445e35f5071f1c01185
User & Date: danielk1977 2009-07-22 07:27:57
Context
2009-07-22
13:19
Add a NEVER() macro around a pager.c conditional that must always be false in the current implementation. (CVS 6920) check-in: 1e510d7f user: drh tags: trunk
07:27
Changes to test code (only) to allow veryquick.test to run with OMIT_UTF16 builsd. Ticket #3985. (CVS 6919) check-in: 7f3fc7f2 user: danielk1977 tags: trunk
02:02
Remove an ALWAYS() from a condition that can in fact be false under very obscure circumstances. (CVS 6918) check-in: 38083228 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_func.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces.  This code
    13     13   ** implements new SQL functions used by the test scripts.
    14     14   **
    15         -** $Id: test_func.c,v 1.15 2009/05/07 13:43:49 drh Exp $
           15  +** $Id: test_func.c,v 1.16 2009/07/22 07:27:57 danielk1977 Exp $
    16     16   */
    17     17   #include "sqlite3.h"
    18     18   #include "tcl.h"
    19     19   #include <stdlib.h>
    20     20   #include <string.h>
    21     21   #include <assert.h>
    22     22   
................................................................................
   152    152   ** API function.
   153    153   */
   154    154   void sqlite3BeginBenignMalloc(void);
   155    155   void sqlite3EndBenignMalloc(void);
   156    156   static void test_agg_errmsg16_step(sqlite3_context *a, int b,sqlite3_value **c){
   157    157   }
   158    158   static void test_agg_errmsg16_final(sqlite3_context *ctx){
          159  +#ifndef SQLITE_OMIT_UTF16
   159    160     const void *z;
   160    161     sqlite3 * db = sqlite3_context_db_handle(ctx);
   161    162     sqlite3_aggregate_context(ctx, 2048);
   162    163     sqlite3BeginBenignMalloc();
   163    164     z = sqlite3_errmsg16(db);
   164    165     sqlite3EndBenignMalloc();
   165    166     sqlite3_result_text16(ctx, z, -1, SQLITE_TRANSIENT);
          167  +#endif
   166    168   }
   167    169   
   168    170   /*
   169    171   ** Routines for testing the sqlite3_get_auxdata() and sqlite3_set_auxdata()
   170    172   ** interface.
   171    173   **
   172    174   ** The test_auxdata() SQL function attempts to register each of its arguments

Changes to test/bind.test.

     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   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script testing the sqlite_bind API.
    13     13   #
    14         -# $Id: bind.test,v 1.47 2009/02/20 03:55:05 drh Exp $
           14  +# $Id: bind.test,v 1.48 2009/07/22 07:27:57 danielk1977 Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   proc sqlite_step {stmt N VALS COLS} {
    21     21     upvar VALS vals
................................................................................
   287    287     sqlite3_bind_text $VM 2 hello\000there\000 11
   288    288     sqlite3_bind_text $VM 3 hello\000there\000 -1
   289    289     sqlite_step $VM N VALUES COLNAMES
   290    290     sqlite3_reset $VM
   291    291     execsql {SELECT * FROM t1}
   292    292   } {hello hello hello}
   293    293   set enc [db eval {PRAGMA encoding}]
   294         -if {$enc=="UTF-8"} {
          294  +if {$enc=="UTF-8" || $enc==""} {
   295    295     do_test bind-6.5 {
   296    296       execsql {SELECT  hex(a), hex(b), hex(c) FROM t1}
   297    297     } {68656C6C6F00746865726500 68656C6C6F007468657265 68656C6C6F}
   298    298   } elseif {$enc=="UTF-16le"} {
   299    299     do_test bind-6.5 {
   300    300       execsql {SELECT  hex(a), hex(b), hex(c) FROM t1}
   301    301     } {680065006C006C006F000000740068006500720065000000 680065006C006C006F00000074006800650072006500 680065006C006C006F00}

Changes to test/capi3c.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  
    12     12   #
    13     13   # This is a copy of the capi3.test file that has been adapted to
    14     14   # test the new sqlite3_prepare_v2 interface.
    15     15   #
    16         -# $Id: capi3c.test,v 1.22 2008/11/05 16:37:35 drh Exp $
           16  +# $Id: capi3c.test,v 1.23 2009/07/22 07:27:57 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   # Return the UTF-16 representation of the supplied UTF-8 string $str.
    23     23   # If $nt is true, append two 0x00 bytes as a nul terminator.
................................................................................
  1288   1288   sqlite3_finalize $STMT
  1289   1289   
  1290   1290   # For a multi-column result set where the same table column is repeated
  1291   1291   # in multiple columns of the output, verify that doing a UTF-8 to UTF-16
  1292   1292   # conversion (or vice versa) on one column does not change the value of
  1293   1293   # the second.
  1294   1294   #
  1295         -do_test capi3c-23.1 {
  1296         -  set STMT [sqlite3_prepare_v2 db {SELECT b,b,b,b FROM t1} -1 TAIL]
  1297         -  sqlite3_step $STMT
  1298         -} {SQLITE_ROW}
  1299         -do_test capi3c-23.2 {
  1300         -  sqlite3_column_text16 $STMT 0
  1301         -  sqlite3_column_text $STMT 1
  1302         -} {one}
  1303         -do_test capi3c-23.3 {
  1304         -  sqlite3_column_text16 $STMT 2
  1305         -  sqlite3_column_text $STMT 3
  1306         -} {one}
  1307         -sqlite3_finalize $STMT
  1308         -do_test capi3c-23.4 {
  1309         -  set STMT [sqlite3_prepare_v2 db {SELECT b||'x',b,b,b FROM t1} -1 TAIL]
  1310         -  sqlite3_step $STMT
  1311         -} {SQLITE_ROW}
  1312         -do_test capi3c-23.5 {
  1313         -  sqlite3_column_text16 $STMT 0
  1314         -  sqlite3_column_text $STMT 1
  1315         -} {one}
  1316         -do_test capi3c-23.6 {
  1317         -  sqlite3_column_text16 $STMT 2
  1318         -  sqlite3_column_text $STMT 3
  1319         -} {one}
  1320         -sqlite3_finalize $STMT
         1295  +ifcapable utf16 {
         1296  +  do_test capi3c-23.1 {
         1297  +    set STMT [sqlite3_prepare_v2 db {SELECT b,b,b,b FROM t1} -1 TAIL]
         1298  +    sqlite3_step $STMT
         1299  +  } {SQLITE_ROW}
         1300  +  do_test capi3c-23.2 {
         1301  +    sqlite3_column_text16 $STMT 0
         1302  +    sqlite3_column_text $STMT 1
         1303  +  } {one}
         1304  +  do_test capi3c-23.3 {
         1305  +    sqlite3_column_text16 $STMT 2
         1306  +    sqlite3_column_text $STMT 3
         1307  +  } {one}
         1308  +  sqlite3_finalize $STMT
         1309  +  do_test capi3c-23.4 {
         1310  +    set STMT [sqlite3_prepare_v2 db {SELECT b||'x',b,b,b FROM t1} -1 TAIL]
         1311  +    sqlite3_step $STMT
         1312  +  } {SQLITE_ROW}
         1313  +  do_test capi3c-23.5 {
         1314  +    sqlite3_column_text16 $STMT 0
         1315  +    sqlite3_column_text $STMT 1
         1316  +  } {one}
         1317  +  do_test capi3c-23.6 {
         1318  +    sqlite3_column_text16 $STMT 2
         1319  +    sqlite3_column_text $STMT 3
         1320  +  } {one}
         1321  +  sqlite3_finalize $STMT
         1322  +}
  1321   1323   
  1322   1324   finish_test