SQLite

Check-in [6ef34e9d31]
Login

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

Overview
Comment:Changes to test scripts to support running on symbian. (CVS 5714)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6ef34e9d3118965781c69011deaede1ebbb19b12
User & Date: danielk1977 2008-09-17 16:14:10.000
Context
2008-09-17
20:06
Speed improvements for in-memory databases by omitting flag clearing on pages where it is impossible for the flag to be set and by avoiding assert()s on non-debugging builds. Ticket #3384. (CVS 5715) (check-in: a7fd9e622b user: drh tags: trunk)
16:14
Changes to test scripts to support running on symbian. (CVS 5714) (check-in: 6ef34e9d31 user: danielk1977 tags: trunk)
11:02
Add a type identifier to argument sz to sqlite3PageMalloc() in pcache.c. Ticket #3383. (CVS 5713) (check-in: 94fde77b9a user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/nan.test.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46






















































47
48
49
50
51
52
53
54
55
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
# Make sure IEEE floating point NaN values are handled properly.
# SQLite should always convert NaN into NULL.
#
# Also verify that the decimal to IEEE754 binary conversion routines
# correctly generate 0.0, +Inf, and -Inf as appropriate for numbers
# out of range.
#
# $Id: nan.test,v 1.3 2008/05/11 11:07:07 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl


do_test nan-1.1 {
  db eval {
    PRAGMA auto_vacuum=OFF;
    PRAGMA page_size=1024;
    CREATE TABLE t1(x FLOAT);
  }
  set ::STMT [sqlite3_prepare db "INSERT INTO t1 VALUES(?)" -1 TAIL]
  sqlite3_bind_double $::STMT 1 NaN
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null}

do_test nan-1.2 {
  sqlite3_bind_double $::STMT 1 +Inf
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null inf real}
do_test nan-1.3 {






















































  sqlite3_bind_double $::STMT 1 -Inf
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null inf real -inf real}
do_test nan-1.4 {
  sqlite3_bind_double $::STMT 1 -NaN
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null inf real -inf real {} null}
do_test nan-1.5 {
  sqlite3_bind_double $::STMT 1 NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null inf real -inf real {} null {} null}
do_test nan-1.5 {
  sqlite3_bind_double $::STMT 1 -NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null inf real -inf real {} null {} null {} null}
do_test nan-1.6 {
  db eval {
    UPDATE t1 SET x=x-x;
    SELECT x, typeof(x) FROM t1;
  }
} {{} null {} null {} null {} null {} null {} null}

do_test nan-2.1 {
  db eval {
    DELETE FROM T1;
  }







|





<
|











>
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|
|
|



|
|
|



|
|
|



|
|
|


|







14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Make sure IEEE floating point NaN values are handled properly.
# SQLite should always convert NaN into NULL.
#
# Also verify that the decimal to IEEE754 binary conversion routines
# correctly generate 0.0, +Inf, and -Inf as appropriate for numbers
# out of range.
#
# $Id: nan.test,v 1.4 2008/09/17 16:14:10 danielk1977 Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl


do_test nan-1.1.1 {
  db eval {
    PRAGMA auto_vacuum=OFF;
    PRAGMA page_size=1024;
    CREATE TABLE t1(x FLOAT);
  }
  set ::STMT [sqlite3_prepare db "INSERT INTO t1 VALUES(?)" -1 TAIL]
  sqlite3_bind_double $::STMT 1 NaN
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT x, typeof(x) FROM t1}
} {{} null}
if {$tcl_platform(platform) != "symbian"} {
  do_test nan-1.1.2 {
    sqlite3_bind_double $::STMT 1 +Inf
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real}
  do_test nan-1.1.3 {
    sqlite3_bind_double $::STMT 1 -Inf
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real}
  do_test nan-1.1.4 {
    sqlite3_bind_double $::STMT 1 -NaN
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null}
  do_test nan-1.1.5 {
    sqlite3_bind_double $::STMT 1 NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null}
  do_test nan-1.1.5 {
    sqlite3_bind_double $::STMT 1 -NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null {} null}
  do_test nan-1.1.6 {
    db eval {
      UPDATE t1 SET x=x-x;
      SELECT x, typeof(x) FROM t1;
    }
  } {{} null {} null {} null {} null {} null {} null}
}

# The following block of tests, nan-1.2.*, are the same as the nan-1.1.*
# tests above, except that the SELECT queries used to validate data 
# convert floating point values to text internally before returning them
# to Tcl. This allows the tests to be run on platforms where Tcl has
# problems converting "inf" and "-inf" from floating point to text format.
# It also tests the internal float->text conversion routines a bit.
#
do_test nan-1.2.1 {
  db eval {
    DELETE FROM T1;
  }
  sqlite3_bind_double $::STMT 1 NaN
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null}
do_test nan-1.2.2 {
  sqlite3_bind_double $::STMT 1 +Inf
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real}
do_test nan-1.2.3 {
  sqlite3_bind_double $::STMT 1 -Inf
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real}
do_test nan-1.2.4 {
  sqlite3_bind_double $::STMT 1 -NaN
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null}
do_test nan-1.2.5 {
  sqlite3_bind_double $::STMT 1 NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null}
do_test nan-1.2.5 {
  sqlite3_bind_double $::STMT 1 -NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null {} null}
do_test nan-1.2.6 {
  db eval {
    UPDATE t1 SET x=x-x;
    SELECT CAST(x AS text), typeof(x) FROM t1;
  }
} {{} null {} null {} null {} null {} null {} null}

do_test nan-2.1 {
  db eval {
    DELETE FROM T1;
  }
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

























181
182
183
184
185
186
187
} {1e+307 real}
do_test nan-4.2 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES([string repeat 9 308].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1e+308 real}
do_test nan-4.3 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES([string repeat 9 309].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {inf real}
do_test nan-4.4 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 307].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+307 real}
do_test nan-4.5 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 308].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+308 real}
do_test nan-4.6 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 309].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-inf real}
do_test nan-4.7 {
  db eval {DELETE FROM t1}
  set big -[string repeat 0 10000][string repeat 9 308].[string repeat 0 10000]
  db eval "INSERT INTO t1 VALUES($big)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+308 real}
do_test nan-4.8 {
  db eval {DELETE FROM t1}
  set big [string repeat 0 10000][string repeat 9 308].[string repeat 0 10000]
  db eval "INSERT INTO t1 VALUES($big)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1e+308 real}



























do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1234.5 real}
do_test nan-4.11 {







<
<
<
<
<




|




|
<
<
<
<
<





|






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







196
197
198
199
200
201
202





203
204
205
206
207
208
209
210
211
212





213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
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
} {1e+307 real}
do_test nan-4.2 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES([string repeat 9 308].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1e+308 real}
do_test nan-4.3 {





  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 307].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+307 real}
do_test nan-4.4 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 308].0)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+308 real}
do_test nan-4.5 {





  db eval {DELETE FROM t1}
  set big -[string repeat 0 10000][string repeat 9 308].[string repeat 0 10000]
  db eval "INSERT INTO t1 VALUES($big)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1e+308 real}
do_test nan-4.6 {
  db eval {DELETE FROM t1}
  set big [string repeat 0 10000][string repeat 9 308].[string repeat 0 10000]
  db eval "INSERT INTO t1 VALUES($big)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1e+308 real}

if {$tcl_platform(platform) != "symbian"} {
  # Do not run these tests on Symbian, as the Tcl port doesn't like to
  # convert from floating point value "-inf" to a string.
  #
  do_test nan-4.7 {
    db eval {DELETE FROM t1}
    db eval "INSERT INTO t1 VALUES([string repeat 9 309].0)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {inf real}
  do_test nan-4.8 {
    db eval {DELETE FROM t1}
    db eval "INSERT INTO t1 VALUES(-[string repeat 9 309].0)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {-inf real}
}
do_test nan-4.9 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES([string repeat 9 309].0)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {Inf real}
do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 309].0)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {-Inf real}

do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1234.5 real}
do_test nan-4.11 {
Changes to test/trigger8.test.
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23









24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests to make sure abusively large triggers
# (triggers with 100s or 1000s of statements) work.
#


set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable {!trigger} {
  finish_test
  return
}











do_test trigger8-1.1 {
  execsql {
    CREATE TABLE t1(x);
    CREATE TABLE t2(y);
  }
  set sql "CREATE TRIGGER r10000 AFTER INSERT ON t1 BEGIN\n"
  for {set i 0} {$i<10000} {incr i} {
    append sql "  INSERT INTO t2 VALUES($i);\n"
  }
  append sql "END;"
  execsql $sql
  execsql {
    INSERT INTO t1 VALUES(5);
    SELECT count(*) FROM t2;
  }
} {10000}

finish_test







>








>
>
>
>
>
>
>
>
>






|
|








|


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests to make sure abusively large triggers
# (triggers with 100s or 1000s of statements) work.
#
# $Id: trigger8.test,v 1.2 2008/09/17 16:14:10 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable {!trigger} {
  finish_test
  return
}

# Set variable $nStatement to the number of statements to include in the
# body of the trigger. On a workstation with virtually unlimited memory, 
# use 10000. But on symbian, which allows each application at most a 32MB
# heap, use 1000.
#
set nStatement 10000
if {$tcl_platform(platform) == "symbian"} {
  set nStatement 1000
}

do_test trigger8-1.1 {
  execsql {
    CREATE TABLE t1(x);
    CREATE TABLE t2(y);
  }
  set sql "CREATE TRIGGER r${nStatement} AFTER INSERT ON t1 BEGIN\n"
  for {set i 0} {$i<$nStatement} {incr i} {
    append sql "  INSERT INTO t2 VALUES($i);\n"
  }
  append sql "END;"
  execsql $sql
  execsql {
    INSERT INTO t1 VALUES(5);
    SELECT count(*) FROM t2;
  }
} $nStatement

finish_test