OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3499 } {1 2 A quoted string: 'Hi Y''all'} | 3499 } {1 2 A quoted string: 'Hi Y''all'} |
3500 do_test printf-4.2 { | 3500 do_test printf-4.2 { |
3501 sqlite3_mprintf_str {%d %d A NULL pointer in %%q: '%q'} 1 2 | 3501 sqlite3_mprintf_str {%d %d A NULL pointer in %%q: '%q'} 1 2 |
3502 } {1 2 A NULL pointer in %q: '(NULL)'} | 3502 } {1 2 A NULL pointer in %q: '(NULL)'} |
3503 do_test printf-4.3 { | 3503 do_test printf-4.3 { |
3504 sqlite3_mprintf_str {%d %d A quoted string: %Q} 1 2 {Hi Y'all} | 3504 sqlite3_mprintf_str {%d %d A quoted string: %Q} 1 2 {Hi Y'all} |
3505 } {1 2 A quoted string: 'Hi Y''all'} | 3505 } {1 2 A quoted string: 'Hi Y''all'} |
3506 do_test printf-4.4 { | 3506 do_test printf-4.4 { |
3507 sqlite3_mprintf_str {%d %d A NULL pointer in %%Q: %Q} 1 2 | 3507 sqlite3_mprintf_str {%d %d A NULL pointer in %%Q: %Q} 1 2 |
3508 } {1 2 A NULL pointer in %Q: NULL} | 3508 } {1 2 A NULL pointer in %Q: NULL} |
| 3509 do_test printf-4.5 { |
| 3510 sqlite3_mprintf_str {%d %d A quoted string: '%.10q'} 1 2 {Hi Y'all} |
| 3511 } {1 2 A quoted string: 'Hi Y''all'} |
| 3512 do_test printf-4.6 { |
| 3513 sqlite3_mprintf_str {%d %d A quoted string: '%.9q'} 1 2 {Hi Y'all} |
| 3514 } {1 2 A quoted string: 'Hi Y''all'} |
| 3515 do_test printf-4.7 { |
| 3516 sqlite3_mprintf_str {%d %d A quoted string: '%.8q'} 1 2 {Hi Y'all} |
| 3517 } {1 2 A quoted string: 'Hi Y''all'} |
| 3518 do_test printf-4.8 { |
| 3519 sqlite3_mprintf_str {%d %d A quoted string: '%.7q'} 1 2 {Hi Y'all} |
| 3520 } {1 2 A quoted string: 'Hi Y''al'} |
| 3521 do_test printf-4.9 { |
| 3522 sqlite3_mprintf_str {%d %d A quoted string: '%.6q'} 1 2 {Hi Y'all} |
| 3523 } {1 2 A quoted string: 'Hi Y''a'} |
| 3524 do_test printf-4.10 { |
| 3525 sqlite3_mprintf_str {%d %d A quoted string: '%.5q'} 1 2 {Hi Y'all} |
| 3526 } {1 2 A quoted string: 'Hi Y'''} |
| 3527 do_test printf-4.11 { |
| 3528 sqlite3_mprintf_str {%d %d A quoted string: '%.4q'} 1 2 {Hi Y'all} |
| 3529 } {1 2 A quoted string: 'Hi Y'} |
| 3530 do_test printf-4.12 { |
| 3531 sqlite3_mprintf_str {%d %d A quoted string: '%.3q'} 1 2 {Hi Y'all} |
| 3532 } {1 2 A quoted string: 'Hi '} |
| 3533 do_test printf-4.13 { |
| 3534 sqlite3_mprintf_str {%d %d A quoted string: '%.2q'} 1 2 {Hi Y'all} |
| 3535 } {1 2 A quoted string: 'Hi'} |
| 3536 do_test printf-4.14 { |
| 3537 sqlite3_mprintf_str {%d %d A quoted string: '%.1q'} 1 2 {Hi Y'all} |
| 3538 } {1 2 A quoted string: 'H'} |
| 3539 do_test printf-4.15 { |
| 3540 sqlite3_mprintf_str {%d %d A quoted string: '%.0q'} 1 2 {Hi Y'all} |
| 3541 } {1 2 A quoted string: ''} |
| 3542 do_test printf-4.16 { |
| 3543 sqlite3_mprintf_str {%d A quoted string: '%.*q'} 1 6 {Hi Y'all} |
| 3544 } {1 A quoted string: 'Hi Y''a'} |
| 3545 |
3509 | 3546 |
3510 do_test printf-5.1 { | 3547 do_test printf-5.1 { |
3511 set x [sqlite3_mprintf_str {%d %d %100000s} 0 0 {Hello}] | 3548 set x [sqlite3_mprintf_str {%d %d %100000s} 0 0 {Hello}] |
3512 string length $x | 3549 string length $x |
3513 } {344} | 3550 } {344} |
3514 do_test printf-5.2 { | 3551 do_test printf-5.2 { |
3515 sqlite3_mprintf_str {%d %d (%-10.10s) %} -9 -10 {HelloHelloHello} | 3552 sqlite3_mprintf_str {%d %d (%-10.10s) %} -9 -10 {HelloHelloHello} |
3516 } {-9 -10 (HelloHello) %} | 3553 } {-9 -10 (HelloHello) %} |
3517 | 3554 |
3518 do_test printf-6.1 { | 3555 do_test printf-6.1 { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3709 do_test printf-malloc-$::iRepeat.$nTestNum { | 3746 do_test printf-malloc-$::iRepeat.$nTestNum { |
3710 expr {($nFail>0 && $z eq "") || ($nFail==$nBenign && $z eq $zSuccess)} | 3747 expr {($nFail>0 && $z eq "") || ($nFail==$nBenign && $z eq $zSuccess)} |
3711 } {1} | 3748 } {1} |
3712 if {$nFail == 0} break | 3749 if {$nFail == 0} break |
3713 incr nTestNum | 3750 incr nTestNum |
3714 } | 3751 } |
3715 } | 3752 } |
3716 } | 3753 } |
3717 | 3754 |
3718 finish_test | 3755 finish_test |
OLD | NEW |