SQLite

Check-in [9cf371d85d]
Login

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

Overview
Comment:Fix capi3.test so that it works with production (as well as debugging ) builds. (CVS 1766)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9cf371d85d99235771f173572265c5e4dd5ab273
User & Date: danielk1977 2004-06-29 14:03:58.000
Context
2004-06-29
23:52
Run tests in UTF-16 mode. (CVS 1767) (check-in: 822bee3a4e user: danielk1977 tags: trunk)
14:03
Fix capi3.test so that it works with production (as well as debugging ) builds. (CVS 1766) (check-in: 9cf371d85d user: danielk1977 tags: trunk)
13:54
Fix TRACE7 in os_common.h. (CVS 1765) (check-in: 76e0b74961 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/capi3.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2003 January 29
#
# 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.  The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.16 2004/06/29 13:18:24 danielk1977 Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2003 January 29
#
# 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.  The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.17 2004/06/29 14:03:58 danielk1977 Exp $
#

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

# Return the UTF-16 representation of the supplied UTF-8 string $str.
# If $nt is true, append two 0x00 bytes as a nul terminator.
571
572
573
574
575
576
577

578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593

594
595
596
597
598
set test_number 1
foreach {code english} $code2english {
  do_test capi3-9.$test_number "sqlite3_test_errstr $code" $english
  incr test_number
}

# Test the error message when a "real" out of memory occurs.

set sqlite_malloc_fail 1
do_test capi3-10-1 {
  set ::DB [sqlite3 db test.db]
  sqlite_malloc_fail 1
  catchsql {
    select * from sqlite_master;
  }
} {1 {out of memory}}
do_test capi3-10-2 {
  sqlite3_errmsg $::DB
} {out of memory}
do_test capi3-10-3 {
  utf8 [sqlite3_errmsg16 $::DB]
} {out of memory}
db close
sqlite_malloc_fail 0


finish_test










>
















>





571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
set test_number 1
foreach {code english} $code2english {
  do_test capi3-9.$test_number "sqlite3_test_errstr $code" $english
  incr test_number
}

# Test the error message when a "real" out of memory occurs.
if {[info command sqlite_malloc_stat]!=""} {
set sqlite_malloc_fail 1
do_test capi3-10-1 {
  set ::DB [sqlite3 db test.db]
  sqlite_malloc_fail 1
  catchsql {
    select * from sqlite_master;
  }
} {1 {out of memory}}
do_test capi3-10-2 {
  sqlite3_errmsg $::DB
} {out of memory}
do_test capi3-10-3 {
  utf8 [sqlite3_errmsg16 $::DB]
} {out of memory}
db close
sqlite_malloc_fail 0
}

finish_test