SQLite4
Check-in [ed79d6f7fa]
Not logged in

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

Overview
Comment:Add tests for sqlite4_num_sub with inf and nan.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ed79d6f7fa8bbbc1188c8e2035f2f8818d496ffd
User & Date: peterreid 2013-07-06 23:14:35
Context
2013-07-18
00:58
Fix a typo in the "key format" documentation. check-in: 4beefed2c9 user: drh tags: trunk
2013-07-16
20:01
Updates to use the next-generation-query-planner from the SQLite3 project. This branch is largely broken. check-in: bc9c9f73c5 user: dan tags: nextgen-query-planner
2013-07-06
23:14
Add tests for sqlite4_num_sub with inf and nan. check-in: ed79d6f7fa user: peterreid tags: trunk
23:07
Change some repetitive num tests into loops. check-in: abaf3f1abd user: peterreid tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/num.test.

56
57
58
59
60
61
62
63
64
65











66
67
68
69
70
71
72
73
74
75
76
  sqlite4_num_isinf [sqlite4_num_from_text inf 3]
} {true}

do_test num-3.1.1 {
  sqlite4_num_to_text [sqlite4_num_add 5 7]
} {12}

foreach {tn a b sum} {
  1   9       3       6
  2   5       12      -7











} {
  do_test num-4.1.$tn {
   sqlite4_num_to_text [sqlite4_num_sub $a $b] 
  } $sum
}
do_test num-4.2.1 {
  sqlite4_num_compare [sqlite4_num_sub 1 1] [sqlite4_num_sub -1 -1]
} {equal}


foreach {tn a b product} {







|


>
>
>
>
>
>
>
>
>
>
>



|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  sqlite4_num_isinf [sqlite4_num_from_text inf 3]
} {true}

do_test num-3.1.1 {
  sqlite4_num_to_text [sqlite4_num_add 5 7]
} {12}

foreach {tn a b difference} {
  1   9       3       6
  2   5       12      -7
  3   -9      -10     1
  4   -2      4       -6
  5   -48     -48     0
  6   NaN     4       NaN
  7   95      NaN     NaN
  8   NaN     inf     NaN
  9   inf     inf     NaN
  10  -inf    -inf    NaN
  11  inf     -inf    inf
  12  -inf    955     -inf
  13  -inf    inf     -inf
} {
  do_test num-4.1.$tn {
   sqlite4_num_to_text [sqlite4_num_sub $a $b] 
  } $difference
}
do_test num-4.2.1 {
  sqlite4_num_compare [sqlite4_num_sub 1 1] [sqlite4_num_sub -1 -1]
} {equal}


foreach {tn a b product} {