Index: src/test_func.c ================================================================== --- src/test_func.c +++ src/test_func.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** Code for testing all sorts of SQLite interfaces. This code ** implements new SQL functions used by the test scripts. ** -** $Id: test_func.c,v 1.8 2008/07/11 21:02:54 drh Exp $ +** $Id: test_func.c,v 1.9 2008/07/31 01:47:11 shane Exp $ */ #include "sqlite3.h" #include "tcl.h" #include #include @@ -112,10 +112,11 @@ zVal[len+2] = 0; zVal++; memcpy(zVal, sqlite3_value_text(argv[0]), len); sqlite3_result_text(pCtx, zVal, -1, destructor); } +#ifndef SQLITE_OMIT_UTF16 static void test_destructor16( sqlite3_context *pCtx, int nArg, sqlite3_value **argv ){ @@ -134,10 +135,11 @@ zVal[len+2] = 0; zVal++; memcpy(zVal, sqlite3_value_text16(argv[0]), len); sqlite3_result_text16(pCtx, zVal, -1, destructor); } +#endif static void test_destructor_count( sqlite3_context *pCtx, int nArg, sqlite3_value **argv ){ @@ -270,11 +272,13 @@ unsigned char eTextRep; /* 1: UTF-16. 0: UTF-8 */ void (*xFunc)(sqlite3_context*,int,sqlite3_value **); } aFuncs[] = { { "randstr", 2, SQLITE_UTF8, randStr }, { "test_destructor", 1, SQLITE_UTF8, test_destructor}, +#ifndef SQLITE_OMIT_UTF16 { "test_destructor16", 1, SQLITE_UTF8, test_destructor16}, +#endif { "test_destructor_count", 0, SQLITE_UTF8, test_destructor_count}, { "test_auxdata", -1, SQLITE_UTF8, test_auxdata}, { "test_error", 1, SQLITE_UTF8, test_error}, { "test_error", 2, SQLITE_UTF8, test_error}, { "test_eval", 1, SQLITE_UTF8, test_eval}, Index: test/func.test ================================================================== --- test/func.test +++ test/func.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing built-in functions. # -# $Id: func.test,v 1.84 2008/07/16 18:20:09 drh Exp $ +# $Id: func.test,v 1.85 2008/07/31 01:47:11 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. @@ -453,15 +453,17 @@ execsql { SELECT test_destructor('hello world'), test_destructor_count(); } } {{hello world} 1} } else { - do_test func-12.1-utf16 { - execsql { - SELECT test_destructor16('hello world'), test_destructor_count(); + ifcapable {utf16} { + do_test func-12.1-utf16 { + execsql { + SELECT test_destructor16('hello world'), test_destructor_count(); + } + } {{hello world} 1} } - } {{hello world} 1} } do_test func-12.2 { execsql { SELECT test_destructor_count(); }