/ Check-in [b8ee76bc]
Login

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

Overview
Comment:Added additional rounding tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b8ee76bc1fd355110149bd9135dd31a5724c2ac6
User & Date: shaneh 2010-02-16 22:00:36
Context
2010-02-16
22:06
Remove duplicated assignment in realloc. check-in: c419955d user: shaneh tags: trunk
22:00
Added additional rounding tests. check-in: b8ee76bc user: shaneh tags: trunk
12:18
Change a C++ style comment in os_unix.c to use normal C style commenting. check-in: 7a193309 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/func.test.

231
232
233
234
235
236
237














































































238
239
240
241
242
243
244
  } {real}
  do_test func-4.15 {
    execsql {SELECT typeof(round(5.1));}
  } {real}
  do_test func-4.16 {
    catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b}
  } {0 {-2.0 1.23 2.0}}














































































}

# Test the upper() and lower() functions
#
do_test func-5.1 {
  execsql {SELECT upper(t1) FROM tbl1}
} {THIS PROGRAM IS FREE SOFTWARE}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
  } {real}
  do_test func-4.15 {
    execsql {SELECT typeof(round(5.1));}
  } {real}
  do_test func-4.16 {
    catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b}
  } {0 {-2.0 1.23 2.0}}
  # Verify some values reported on the mailing list.
  # Some of these fail on MSVC builds with 64-bit
  # long doubles, but not on GCC builds with 80-bit
  # long doubles.
  for {set i 1} {$i<999} {incr i} {
    set x1 [expr 40222.0 + $i + 0.5]
    set x2 [expr 40223.0 + $i]
    do_test func-4.17.$i {
      execsql {SELECT round($x1);}
    } $x2
  }
  do_test func-4.18 {
    execsql {SELECT round(41051.5);}
  } {41052.0}
  do_test func-4.19 {
    execsql {SELECT round(41224.5);}
  } {41225.0}
  do_test func-4.20 {
    execsql {SELECT round(40223.4999999999);}
  } {40223.0}
  do_test func-4.21 {
    execsql {SELECT round(40224.4999999999);}
  } {40224.0}
  do_test func-4.22 {
    execsql {SELECT round(40225.4999999999);}
  } {40225.0}
  for {set i 1} {$i<10} {incr i} {
    do_test func-4.23.$i {
      execsql {SELECT round(40223.4999999999,$i);}
    } {40223.5}
    do_test func-4.24.$i {
      execsql {SELECT round(40224.4999999999,$i);}
    } {40224.5}
    do_test func-4.25.$i {
      execsql {SELECT round(40225.4999999999,$i);}
    } {40225.5}
  }
  for {set i 10} {$i<32} {incr i} {
    do_test func-4.26.$i {
      execsql {SELECT round(40223.4999999999,$i);}
    } {40223.4999999999}
    do_test func-4.27.$i {
      execsql {SELECT round(40224.4999999999,$i);}
    } {40224.4999999999}
    do_test func-4.28.$i {
      execsql {SELECT round(40225.4999999999,$i);}
    } {40225.4999999999}
  }
  do_test func-4.29 {
    execsql {SELECT round(1234567890.5);}
  } {1234567891.0}
  do_test func-4.30 {
    execsql {SELECT round(12345678901.5);}
  } {12345678902.0}
  do_test func-4.31 {
    execsql {SELECT round(123456789012.5);}
  } {123456789013.0}
  do_test func-4.32 {
    execsql {SELECT round(1234567890123.5);}
  } {1234567890124.0}
  do_test func-4.33 {
    execsql {SELECT round(12345678901234.5);}
  } {12345678901235.0}
  do_test func-4.34 {
    execsql {SELECT round(1234567890123.35,1);}
  } {1234567890123.4}
  do_test func-4.35 {
    execsql {SELECT round(1234567890123.445,2);}
  } {1234567890123.45}
  do_test func-4.36 {
    execsql {SELECT round(99999999999994.5);}
  } {99999999999995.0}
  do_test func-4.37 {
    execsql {SELECT round(9999999999999.55,1);}
  } {9999999999999.6}
  do_test func-4.38 {
    execsql {SELECT round(9999999999999.555,2);}
  } {9999999999999.56}
}

# Test the upper() and lower() functions
#
do_test func-5.1 {
  execsql {SELECT upper(t1) FROM tbl1}
} {THIS PROGRAM IS FREE SOFTWARE}