/ Check-in [2d5cec53]
Login

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

Overview
Comment:Omit calls to test_destructor16() if SQLITE_OMIT_UTF16 defined. (CVS 5508)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d5cec53c2f31875d198d81ac4fd54e7066ea0ff
User & Date: shane 2008-07-31 01:47:11
Context
2008-07-31
02:05
Omit calls to test_get_table_printf() if SQLITE_OMIT_GET_TABLE defined. (CVS 5509) check-in: 524a4075 user: shane tags: trunk
01:47
Omit calls to test_destructor16() if SQLITE_OMIT_UTF16 defined. (CVS 5508) check-in: 2d5cec53 user: shane tags: trunk
01:43
Fixed comment to use right function names for sqlite3VdbeSerialPut() and sqlite3VdbeSerialGet(). (CVS 5507) check-in: 820c37ec user: shane 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.8 2008/07/11 21:02:54 drh Exp $
           15  +** $Id: test_func.c,v 1.9 2008/07/31 01:47:11 shane 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   
................................................................................
   110    110     }
   111    111     zVal[len+1] = 0;
   112    112     zVal[len+2] = 0;
   113    113     zVal++;
   114    114     memcpy(zVal, sqlite3_value_text(argv[0]), len);
   115    115     sqlite3_result_text(pCtx, zVal, -1, destructor);
   116    116   }
          117  +#ifndef SQLITE_OMIT_UTF16
   117    118   static void test_destructor16(
   118    119     sqlite3_context *pCtx, 
   119    120     int nArg,
   120    121     sqlite3_value **argv
   121    122   ){
   122    123     char *zVal;
   123    124     int len;
................................................................................
   132    133     }
   133    134     zVal[len+1] = 0;
   134    135     zVal[len+2] = 0;
   135    136     zVal++;
   136    137     memcpy(zVal, sqlite3_value_text16(argv[0]), len);
   137    138     sqlite3_result_text16(pCtx, zVal, -1, destructor);
   138    139   }
          140  +#endif
   139    141   static void test_destructor_count(
   140    142     sqlite3_context *pCtx, 
   141    143     int nArg,
   142    144     sqlite3_value **argv
   143    145   ){
   144    146     sqlite3_result_int(pCtx, test_destructor_count_var);
   145    147   }
................................................................................
   268    270        char *zName;
   269    271        signed char nArg;
   270    272        unsigned char eTextRep; /* 1: UTF-16.  0: UTF-8 */
   271    273        void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
   272    274     } aFuncs[] = {
   273    275       { "randstr",               2, SQLITE_UTF8, randStr    },
   274    276       { "test_destructor",       1, SQLITE_UTF8, test_destructor},
          277  +#ifndef SQLITE_OMIT_UTF16
   275    278       { "test_destructor16",     1, SQLITE_UTF8, test_destructor16},
          279  +#endif
   276    280       { "test_destructor_count", 0, SQLITE_UTF8, test_destructor_count},
   277    281       { "test_auxdata",         -1, SQLITE_UTF8, test_auxdata},
   278    282       { "test_error",            1, SQLITE_UTF8, test_error},
   279    283       { "test_error",            2, SQLITE_UTF8, test_error},
   280    284       { "test_eval",             1, SQLITE_UTF8, test_eval},
   281    285       { "test_isolation",        2, SQLITE_UTF8, test_isolation},
   282    286     };

Changes to test/func.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 file is testing built-in functions.
    13     13   #
    14         -# $Id: func.test,v 1.84 2008/07/16 18:20:09 drh Exp $
           14  +# $Id: func.test,v 1.85 2008/07/31 01:47:11 shane Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Create a table to work with.
    20     20   #
    21     21   do_test func-0.0 {
................................................................................
   451    451   if {[db eval {PRAGMA encoding}]=="UTF-8"} {
   452    452     do_test func-12.1-utf8 {
   453    453       execsql {
   454    454         SELECT test_destructor('hello world'), test_destructor_count();
   455    455       }
   456    456     } {{hello world} 1}
   457    457   } else {
   458         -  do_test func-12.1-utf16 {
   459         -    execsql {
   460         -      SELECT test_destructor16('hello world'), test_destructor_count();
          458  +    ifcapable {utf16} {
          459  +      do_test func-12.1-utf16 {
          460  +        execsql {
          461  +          SELECT test_destructor16('hello world'), test_destructor_count();
          462  +        }
          463  +      } {{hello world} 1}
   461    464       }
   462         -  } {{hello world} 1}
   463    465   }
   464    466   do_test func-12.2 {
   465    467     execsql {
   466    468       SELECT test_destructor_count();
   467    469     }
   468    470   } {0}
   469    471   do_test func-12.3 {