os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/misc6.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/misc6.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,48 @@
     1.4 +# 2006 September 4
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.  In place of
     1.7 +# a legal notice, here is a blessing:
     1.8 +#
     1.9 +#    May you do good and not evil.
    1.10 +#    May you find forgiveness for yourself and forgive others.
    1.11 +#    May you share freely, never taking more than you give.
    1.12 +#
    1.13 +#***********************************************************************
    1.14 +# This file implements regression tests for SQLite library.
    1.15 +#
    1.16 +# This file implements tests to make sure sqlite3_value_text()
    1.17 +# always returns a null-terminated string.
    1.18 +#
    1.19 +# $Id: misc6.test,v 1.3 2007/04/23 23:56:32 drh Exp $
    1.20 +
    1.21 +set testdir [file dirname $argv0]
    1.22 +source $testdir/tester.tcl
    1.23 +
    1.24 +do_test misc6-1.1 {
    1.25 +  set DB [sqlite3_connection_pointer db]
    1.26 +  sqlite3_create_function $DB
    1.27 +  set STMT [sqlite3_prepare $DB {SELECT hex8(?)} -1 DUMMY]
    1.28 +  set sqlite_static_bind_value {0123456789}
    1.29 +  set sqlite_static_bind_nbyte 5
    1.30 +  sqlite_bind $STMT 1 {} static-nbytes
    1.31 +  sqlite3_step $STMT
    1.32 +} SQLITE_ROW
    1.33 +do_test misc6-1.2 {
    1.34 +  sqlite3_column_text $STMT 0
    1.35 +} {3031323334}
    1.36 +ifcapable utf16 {
    1.37 +  do_test misc6-1.3 {
    1.38 +    sqlite3_finalize $STMT
    1.39 +    set STMT [sqlite3_prepare $DB {SELECT hex16(?)} -1 DUMMY]
    1.40 +    set sqlite_static_bind_value {0123456789}
    1.41 +    set sqlite_static_bind_nbyte 5
    1.42 +    sqlite_bind $STMT 1 {} static-nbytes
    1.43 +    sqlite3_step $STMT
    1.44 +  } SQLITE_ROW
    1.45 +  do_test misc6-1.4 {
    1.46 +    sqlite3_column_text $STMT 0
    1.47 +  } {00300031003200330034}
    1.48 +}
    1.49 +sqlite3_finalize $STMT
    1.50 +
    1.51 +finish_test