On 7/24/15, Viktor Jancik <vjancik at redhat.com> wrote:
> What about these tests?
>
> do_test printf-1.17.1 {
>   sqlite3_mprintf_int {abd: %2147483647d %2147483647x %2147483647o} 1 1 1
> } {}
> do_test printf-1.17.2 {
>   sqlite3_mprintf_int {abd: %*d %x} 2147483647 1 1
> } {}
> do_test printf-1.17.3 {
>   sqlite3_mprintf_int {abd: %*d %x} -2147483648 1 1
> } {abd: 1 1}
> do_test printf-2.1.2.10 {
>   sqlite3_mprintf_double {abc: %*.*f}  2000000000 1000000000 1.0e-20
> } {abc: }
> do_test printf-3.7 {
>   sqlite3_mprintf_str {%d A String: (%*s)} 1 2147483647 {This is the
> string}
> } []
> do_test printf-3.8 {
>   sqlite3_mprintf_str {%d A String: (%*s)} 1 -2147483648 {This is the
> string}
> } {1 A String: (This is the string)}
> do_test printf-3.9 {
>   sqlite3_mprintf_str {%d A String: (%.*s)} 1 -2147483648 {This is the
> string}
> } {1 A String: (This is the string)}
> do_test printf-13.7 {
>   sqlite3_mprintf_hexdouble %2147483648.10000f 4693b8b5b5056e17
> } {/100000000000000000000000000000000.00/}
>
> Why are 1.17.3, 3.8, 3.9, 13.7 not getting shot down, while the rest are?
>

The behavior with oversized precisions and widths is arbitrary.  I
think the point of the tests is to show that there are no memory
errors or assertion faults.
-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to