SQLite

Check-in [6f2629c783]
Login

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

Overview
Comment:Test coverage improvements in printf.c. (CVS 5360)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6f2629c78327bb6cbb15d1f9900a1ef58f2d37dd
User & Date: drh 2008-07-08 02:24:03.000
Context
2008-07-08
03:04
change to use sqlite_uint64 for MSVC compile; (CVS 5361) (check-in: 369118ca2e user: shane tags: trunk)
02:24
Test coverage improvements in printf.c. (CVS 5360) (check-in: 6f2629c783 user: drh tags: trunk)
02:12
Add tests to verify correct behavior when mutex initialization fails. (CVS 5359) (check-in: 65875005ac user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/printf.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2001 September 15
#
# 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 file is testing the sqlite_*_printf() interface.
#
# $Id: printf.test,v 1.28 2008/02/01 01:19:54 drh Exp $

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


do_test printf-1.1.1 {
  sqlite3_mprintf_int {abc: %d %x %o :xyz}\













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2001 September 15
#
# 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 file is testing the sqlite_*_printf() interface.
#
# $Id: printf.test,v 1.29 2008/07/08 02:24:03 drh Exp $

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


do_test printf-1.1.1 {
  sqlite3_mprintf_int {abc: %d %x %o :xyz}\
3608
3609
3610
3611
3612
3613
3614










3615
3616
3617
3618
3619
3620
3621
} {abc-}
do_test printf-14.2 {
  sqlite3_mprintf_n_test {xyzzy}
} 5
do_test printf-14.3 {
  sqlite3_mprintf_str {abc-%T-123} 0 0 {not used}
} {abc-}











do_test printf-15.1 {
  sqlite3_snprintf_int 5 {12345} 0
} {1234}
do_test printf-15.2 {
  sqlite3_snprintf_int 5 {} 0
} {}







>
>
>
>
>
>
>
>
>
>







3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
} {abc-}
do_test printf-14.2 {
  sqlite3_mprintf_n_test {xyzzy}
} 5
do_test printf-14.3 {
  sqlite3_mprintf_str {abc-%T-123} 0 0 {not used}
} {abc-}
do_test printf-14.4 {
  sqlite3_mprintf_str {abc-%#} 0 0 {not used}
} {abc-}

for {set i 2} {$i<200} {incr i} {
  set res [string repeat { } [expr {$i-1}]]x
  do_test printf-14.10.$i "
    sqlite3_mprintf_str {%*.*s} $i 500 x
  " $res
}

do_test printf-15.1 {
  sqlite3_snprintf_int 5 {12345} 0
} {1234}
do_test printf-15.2 {
  sqlite3_snprintf_int 5 {} 0
} {}