File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / sqlite3 / test / misc6.test
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:04:16 2012 UTC (12 years, 3 months ago) by misho
Branches: sqlite3, MAIN
CVS tags: v3_7_10, HEAD
sqlite3

# 2006 September 4
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests to make sure sqlite3_value_text()
# always returns a null-terminated string.
#
# $Id: misc6.test,v 1.1.1.1 2012/02/21 17:04:16 misho Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

do_test misc6-1.1 {
  set DB [sqlite3_connection_pointer db]
  sqlite3_create_function $DB
  set STMT [sqlite3_prepare $DB {SELECT hex8(?)} -1 DUMMY]
  set sqlite_static_bind_value {0123456789}
  set sqlite_static_bind_nbyte 5
  sqlite_bind $STMT 1 {} static-nbytes
  sqlite3_step $STMT
} SQLITE_ROW
do_test misc6-1.2 {
  sqlite3_column_text $STMT 0
} {3031323334}
ifcapable utf16 {
  do_test misc6-1.3 {
    sqlite3_finalize $STMT
    set STMT [sqlite3_prepare $DB {SELECT hex16(?)} -1 DUMMY]
    set sqlite_static_bind_value {0123456789}
    set sqlite_static_bind_nbyte 5
    sqlite_bind $STMT 1 {} static-nbytes
    sqlite3_step $STMT
  } SQLITE_ROW
  do_test misc6-1.4 {
    sqlite3_column_text $STMT 0
  } {00300031003200330034}
}
sqlite3_finalize $STMT

finish_test

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>