System.Data.SQLite
Check-in [b0d4efd98b]
Not logged in

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

Overview
Comment:Add proper test constraint handling for the 'wal.db' and 'nonWal.db' test data files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0d4efd98b4a351d543cd31c89aa2bedae7f5289
User & Date: mistachkin 2014-07-19 06:27:21
Context
2014-07-19
06:40
Move the 'setup' data files to their own directory. check-in: 38406dba38 user: mistachkin tags: trunk
06:27
Add proper test constraint handling for the 'wal.db' and 'nonWal.db' test data files. check-in: b0d4efd98b user: mistachkin tags: trunk
06:16
Update Eagle script library in externals to the latest trunk code. Move the test data files into their own sub-directory. check-in: ed5dcaba0f user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/tkt-448d663d11.eagle.

16
17
18
19
20
21
22




















23
24
25
26
27
28
29
..
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
..
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
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
...
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
257
258
...
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
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################





















runTest {test tkt-448d663d11-1.1 {missing journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.1.db]
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.2 {missing journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.2.db
  file copy -force [file join [getSQLiteTestDataPath] wal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName "" "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.3 {missing journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.3.db
  file copy -force [file join [getSQLiteTestDataPath] nonWal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName "" "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.4 {'Default' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.4.db] Default
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.5 {'Default' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.5.db
  file copy -force [file join [getSQLiteTestDataPath] wal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Default "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.6 {'Default' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.6.db
  file copy -force [file join [getSQLiteTestDataPath] nonWal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Default "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.7 {'Delete' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.7.db] Delete
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.8 {'Delete' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.8.db
  file copy -force [file join [getSQLiteTestDataPath] wal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Delete "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.9 {'Delete' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.9.db
  file copy -force [file join [getSQLiteTestDataPath] nonWal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Delete "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.10 {'Persist' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.10.db] Persist
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.15 {'Wal' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.15.db
  file copy -force [file join [getSQLiteTestDataPath] nonWal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Wal "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.16 {'Wal' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.16.db
  file copy -force [file join [getSQLiteTestDataPath] wal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Wal "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.17 {'Bad' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.17.db] Bad
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.18 {'Bad' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.18.db
  file copy -force [file join [getSQLiteTestDataPath] nonWal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Bad "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.19 {'Bad' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.19.db
  file copy -force [file join [getSQLiteTestDataPath] wal.db] \
      [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Bad "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}




###############################################################################

runSQLiteTestEpilogue
runTestEpilogue







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







 







<
|






|
|
<





<
|






|
|
<







 







<
|






|
|
<





<
|






|
|
<







 







<
|






|
|
<





<
|






|
|
<







 







<
|






|
|
<





<
|






|
|
<







 







<
|






|
|
<





<
|






|
|
|
>
>
>





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
..
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
..
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
...
133
134
135
136
137
138
139

140
141
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
...
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
257
258
259
260
261
262
...
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
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

#
# NOTE: Setup the variables that refer to the various data files required by
#       the tests in this file.
#
set walDbFile [file nativename [file join [getSQLiteTestDataPath] wal.db]]
set nonWalDbFile [file nativename [file join [getSQLiteTestDataPath] nonWal.db]]

#
# NOTE: Setup the test constraints specific to the tests in this file.
#
if {![haveConstraint [appendArgs file_ [file tail $walDbFile]]]} then {
  checkForFile $test_channel $walDbFile
}

if {![haveConstraint [appendArgs file_ [file tail $nonWalDbFile]]]} then {
  checkForFile $test_channel $nonWalDbFile
}

###############################################################################

runTest {test tkt-448d663d11-1.1 {missing journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.1.db]
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.2 {missing journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.2.db

  file copy -force $walDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName "" "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_wal.db} -result {wal}}


###############################################################################

runTest {test tkt-448d663d11-1.3 {missing journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.3.db

  file copy -force $nonWalDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName "" "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_nonWal.db} -result {delete}}


###############################################################################

runTest {test tkt-448d663d11-1.4 {'Default' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.4.db] Default
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.5 {'Default' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.5.db

  file copy -force $walDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Default "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_wal.db} -result {wal}}


###############################################################################

runTest {test tkt-448d663d11-1.6 {'Default' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.6.db

  file copy -force $nonWalDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Default "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_nonWal.db} -result {delete}}


###############################################################################

runTest {test tkt-448d663d11-1.7 {'Delete' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.7.db] Delete
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.8 {'Delete' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.8.db

  file copy -force $walDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Delete "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_wal.db} -result {delete}}


###############################################################################

runTest {test tkt-448d663d11-1.9 {'Delete' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.9.db

  file copy -force $nonWalDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Delete "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_nonWal.db} -result {delete}}


###############################################################################

runTest {test tkt-448d663d11-1.10 {'Persist' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.10.db] Persist
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{wal}}

###############################################################################

runTest {test tkt-448d663d11-1.15 {'Wal' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.15.db

  file copy -force $nonWalDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Wal "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_nonWal.db} -result {wal}}


###############################################################################

runTest {test tkt-448d663d11-1.16 {'Wal' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.16.db

  file copy -force $walDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Wal "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_wal.db} -result {wal}}


###############################################################################

runTest {test tkt-448d663d11-1.17 {'Bad' journal mode, new db} -body {
  setupDb [set fileName tkt-448d663d11-1.17.db] Bad
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
................................................................................
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{delete}}

###############################################################################

runTest {test tkt-448d663d11-1.18 {'Bad' journal mode, non-WAL db} -body {
  set fileName tkt-448d663d11-1.18.db

  file copy -force $nonWalDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Bad "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_nonWal.db} -result {delete}}


###############################################################################

runTest {test tkt-448d663d11-1.19 {'Bad' journal mode, WAL db} -body {
  set fileName tkt-448d663d11-1.19.db

  file copy -force $walDbFile [file join [getDatabaseDirectory] $fileName]
  setupDb $fileName Bad "" "" "" "" true false
  sql execute -execute scalar $db "PRAGMA journal_mode;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite file_wal.db} -result {wal}}

###############################################################################

unset -nocomplain nonWalDbFile walDbFile

###############################################################################

runSQLiteTestEpilogue
runTestEpilogue