/ Check-in [6c51bad0]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Adjust a couple of test scripts so that they work with OMIT_UTF16 builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6c51bad0a306558d2725463b5675c3799fabcb9d
User & Date: dan 2011-07-04 06:52:15
Context
2011-07-06
09:36
Expose the value of compile time symbol SQLITE_MAX_DEFAULT_PAGE_SIZE to test scripts. check-in: 33573663 user: dan tags: trunk
2011-07-04
06:52
Adjust a couple of test scripts so that they work with OMIT_UTF16 builds. check-in: 6c51bad0 user: dan tags: trunk
2011-07-02
19:12
Add a testcase macro to ensure testing a boundary case in DISTINCT processing. check-in: ff9fc722 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to test/func3.test.

13
14
15
16
17
18
19

20
21
22
23
24
25
26
..
31
32
33
34
35
36
37

38
39
40
41
42
43
44
# with functions created using sqlite3_create_function_v2() is 
# correctly invoked.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl



do_test func3-1.1 {
  set destroyed 0
  proc destroy {} { set ::destroyed 1 }
  sqlite3_create_function_v2 db f2 -1 any -func f2 -destroy destroy
  set destroyed
} 0
do_test func3-1.2 {
................................................................................
  sqlite3_create_function_v2 db f2 -1 utf16le -func f2
  set destroyed
} 0
do_test func3-1.4 {
  sqlite3_create_function_v2 db f2 -1 utf16be -func f2
  set destroyed
} 1


do_test func3-2.1 {
  set destroyed 0
  proc destroy {} { set ::destroyed 1 }
  sqlite3_create_function_v2 db f3 -1 utf8 -func f3 -destroy destroy
  set destroyed
} 0







>







 







>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# with functions created using sqlite3_create_function_v2() is 
# correctly invoked.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl


ifcapable utf16 {
  do_test func3-1.1 {
    set destroyed 0
    proc destroy {} { set ::destroyed 1 }
    sqlite3_create_function_v2 db f2 -1 any -func f2 -destroy destroy
    set destroyed
  } 0
  do_test func3-1.2 {
................................................................................
    sqlite3_create_function_v2 db f2 -1 utf16le -func f2
    set destroyed
  } 0
  do_test func3-1.4 {
    sqlite3_create_function_v2 db f2 -1 utf16be -func f2
    set destroyed
  } 1
}

do_test func3-2.1 {
  set destroyed 0
  proc destroy {} { set ::destroyed 1 }
  sqlite3_create_function_v2 db f3 -1 utf8 -func f3 -destroy destroy
  set destroyed
} 0

Changes to test/sqllimits1.test.

315
316
317
318
319
320
321

322
323
324
325

326
327
328
329

330
331
332
333

334
335
336
337
338
339
340
} {SQLITE_TOOBIG}
do_test sqllimits1-5.14.4 {
  set np1 [expr {$SQLITE_LIMIT_LENGTH + 1}]
  set ::str1 [string repeat A $np1]
  catch {sqlite3_bind_text $::STMT 1 $::str1 -1} res
  set res
} {SQLITE_TOOBIG}

do_test sqllimits1-5.14.5 {
  catch {sqlite3_bind_text16 $::STMT 1 $::str1 -1} res
  set res
} {SQLITE_TOOBIG}

do_test sqllimits1-5.14.6 {
  catch {sqlite3_bind_text $::STMT 1 $::str1 $np1} res
  set res
} {SQLITE_TOOBIG}

do_test sqllimits1-5.14.7 {
  catch {sqlite3_bind_text16 $::STMT 1 $::str1 $np1} res
  set res
} {SQLITE_TOOBIG}

do_test sqllimits1-5.14.8 {
  set n [expr {$np1-1}]
  catch {sqlite3_bind_text $::STMT 1 $::str1 $n} res
  set res
} {}
do_test sqllimits1-5.14.9 {
  catch {sqlite3_bind_text16 $::STMT 1 $::str1 $n} res







>




>




>




>







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
} {SQLITE_TOOBIG}
do_test sqllimits1-5.14.4 {
  set np1 [expr {$SQLITE_LIMIT_LENGTH + 1}]
  set ::str1 [string repeat A $np1]
  catch {sqlite3_bind_text $::STMT 1 $::str1 -1} res
  set res
} {SQLITE_TOOBIG}
ifcapable utf16 {
  do_test sqllimits1-5.14.5 {
    catch {sqlite3_bind_text16 $::STMT 1 $::str1 -1} res
    set res
  } {SQLITE_TOOBIG}
}
do_test sqllimits1-5.14.6 {
  catch {sqlite3_bind_text $::STMT 1 $::str1 $np1} res
  set res
} {SQLITE_TOOBIG}
ifcapable utf16 {
  do_test sqllimits1-5.14.7 {
    catch {sqlite3_bind_text16 $::STMT 1 $::str1 $np1} res
    set res
  } {SQLITE_TOOBIG}
}
do_test sqllimits1-5.14.8 {
  set n [expr {$np1-1}]
  catch {sqlite3_bind_text $::STMT 1 $::str1 $n} res
  set res
} {}
do_test sqllimits1-5.14.9 {
  catch {sqlite3_bind_text16 $::STMT 1 $::str1 $n} res