System.Data.SQLite

Check-in [d92e5e9396]
Login

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

Overview
Comment:More test constraints for Mono 4.2.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d92e5e93962ea68de84d4cf5e7081fe9f3039439
User & Date: mistachkin 2016-03-23 05:22:15.524
Context
2016-03-23
05:38
Fix compilation issues when the native library pre-loader is not enabled. check-in: fd918a4eef user: mistachkin tags: trunk
05:22
More test constraints for Mono 4.2. check-in: d92e5e9396 user: mistachkin tags: trunk
05:10
Initial work on getting the native library pre-loader to work on non-Windows (POSIX) platforms. check-in: 49bc443383 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/basic.eagle.
1112
1113
1114
1115
1116
1117
1118
1119

1120
1121
1122
1123
1124
1125
1126
  #       The basic problem here is that the Parse [and TryParse] methods of
  #       the DateTime structure seem to always return local time, even when
  #       string value clearly indicates otherwise (i.e. the trailing "Z",
  #       indicating UTC).
  #
  expr {round([object invoke System.Data.SQLite.SQLiteConvert ToUnixEpoch \
      "2012-01-01 12:00:00Z"])}
} -constraints {eagle command.object System.Data.SQLite} -result {1325390400}}


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

runTest {test data-1.21 {SQLiteConvert ToUnixEpoch (Local)} -body {
  #
  # NOTE: At first, the test result here may not seem correct; however, the
  #       same result can be seen by compiling and running the following C#







|
>







1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
  #       The basic problem here is that the Parse [and TryParse] methods of
  #       the DateTime structure seem to always return local time, even when
  #       string value clearly indicates otherwise (i.e. the trailing "Z",
  #       indicating UTC).
  #
  expr {round([object invoke System.Data.SQLite.SQLiteConvert ToUnixEpoch \
      "2012-01-01 12:00:00Z"])}
} -constraints {eagle command.object monoBug42 System.Data.SQLite} -result \
{1325390400}}

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

runTest {test data-1.21 {SQLiteConvert ToUnixEpoch (Local)} -body {
  #
  # NOTE: At first, the test result here may not seem correct; however, the
  #       same result can be seen by compiling and running the following C#
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
      [list param1 DateTime [set dateTime [object invoke DateTime Parse \
      "2000.02.29 13:59:58.1234567Z"]]]] [sql execute -execute reader \
      -format list $db "SELECT x FROM t1;"]
} -cleanup {
  cleanupDb $fileName

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

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

runTest {test data-1.54 {bind function to a connection} -setup {
  set fileName data-1.54.db
} -body {
  set id [object invoke Interpreter.GetActive NextId]







|
|







2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
      [list param1 DateTime [set dateTime [object invoke DateTime Parse \
      "2000.02.29 13:59:58.1234567Z"]]]] [sql execute -execute reader \
      -format list $db "SELECT x FROM t1;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain dateTime db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {1 630874007980000000}}

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

runTest {test data-1.54 {bind function to a connection} -setup {
  set fileName data-1.54.db
} -body {
  set id [object invoke Interpreter.GetActive NextId]
Changes to Tests/tkt-a7d04fb111.eagle.
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result \
{635598144000000000 635598144000000000 635598432000000000 True False False}}

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

runTest {test tkt-a7d04fb111-1.2 {Bind DateTime Local Ticks} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.2.db] "" Ticks Local \
      BindDateTimeWithKind







|
|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result \
{635598144000000000 635598144000000000 635598432000000000 True False False}}

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

runTest {test tkt-a7d04fb111-1.2 {Bind DateTime Local Ticks} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.2.db] "" Ticks Local \
      BindDateTimeWithKind
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result \
{635598144000000000 635597856000000000 635598144000000000 False True False}}

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

runTest {test tkt-a7d04fb111-1.3 {Bind DateTime Utc ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.3.db] "" ISO8601 Utc \
      BindDateTimeWithKind







|
|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result \
{635598144000000000 635597856000000000 635598144000000000 False True False}}

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

runTest {test tkt-a7d04fb111-1.3 {Bind DateTime Utc ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.3.db] "" ISO8601 Utc \
      BindDateTimeWithKind
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{2015-02-18 00:00:00Z} {2015-02-18 00:00:00Z}\
{2015-02-18 08:00:00Z} True False False}}

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

runTest {test tkt-a7d04fb111-1.4 {Bind DateTime Local ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.4.db] "" ISO8601 Local \
      BindDateTimeWithKind
} -body {







|
|
|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {{2015-02-18 00:00:00Z}\
{2015-02-18 00:00:00Z} {2015-02-18 08:00:00Z} True False False}}

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

runTest {test tkt-a7d04fb111-1.4 {Bind DateTime Local ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.4.db] "" ISO8601 Local \
      BindDateTimeWithKind
} -body {
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{2015-02-18 00:00:00} {2015-02-17 16:00:00}\
{2015-02-18 00:00:00} False True False}}

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

runTest {test tkt-a7d04fb111-1.5 {Bind DateTime Utc JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.5.db] "" JulianDay Utc \
      BindDateTimeWithKind
} -body {







|
|
|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {{2015-02-18 00:00:00}\
{2015-02-17 16:00:00} {2015-02-18 00:00:00} False True False}}

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

runTest {test tkt-a7d04fb111-1.5 {Bind DateTime Utc JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.5.db] "" JulianDay Utc \
      BindDateTimeWithKind
} -body {
194
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {2457071.5 2457071.5 2457071.83 True False False}}


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

runTest {test tkt-a7d04fb111-1.6 {Bind DateTime Local JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.6.db] "" JulianDay Local \
      BindDateTimeWithKind
} -body {







|
|
>







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {2457071.5 2457071.5 2457071.83\
True False False}}

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

runTest {test tkt-a7d04fb111-1.6 {Bind DateTime Local JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.6.db] "" JulianDay Local \
      BindDateTimeWithKind
} -body {
229
230
231
232
233
234
235
236
237

238
239
240
241
242
243
244
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {2457071.5 2457071.17 2457071.5 False True False}}


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

runTest {test tkt-a7d04fb111-1.7 {Bind DateTime Utc UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.7.db] "" UnixEpoch Utc \
      BindDateTimeWithKind
} -body {







|
|
>







230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {2457071.5 2457071.17 2457071.5\
False True False}}

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

runTest {test tkt-a7d04fb111-1.7 {Bind DateTime Utc UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.7.db] "" UnixEpoch Utc \
      BindDateTimeWithKind
} -body {
264
265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {1424217600 1424217600 1424246400 True False False}}


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

runTest {test tkt-a7d04fb111-1.8 {Bind DateTime Local UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.8.db] "" UnixEpoch Local \
      BindDateTimeWithKind
} -body {







|
|
>







266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {1424217600 1424217600\
1424246400 True False False}}

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

runTest {test tkt-a7d04fb111-1.8 {Bind DateTime Local UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.8.db] "" UnixEpoch Local \
      BindDateTimeWithKind
} -body {
299
300
301
302
303
304
305
306
307

308
309
310
311
312
313
314
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {1424217600 1424188800 1424217600 False True False}}


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

runTest {test tkt-a7d04fb111-1.9 {Bind DateTime Utc Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.9.db] "" InvariantCulture Utc \
      BindDateTimeWithKind
} -body {







|
|
>







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {1424217600 1424188800\
1424217600 False True False}}

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

runTest {test tkt-a7d04fb111-1.9 {Bind DateTime Utc Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.9.db] "" InvariantCulture Utc \
      BindDateTimeWithKind
} -body {
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {2015-02-18T00:00:00.0000000\
2015-02-18T00:00:00.0000000Z 2015-02-18T08:00:00.0000000Z False False False}}

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

runTest {test tkt-a7d04fb111-1.10 {Bind DateTime Local Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.10.db] "" InvariantCulture Local \
      BindDateTimeWithKind







|
|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {2015-02-18T00:00:00.0000000\
2015-02-18T00:00:00.0000000Z 2015-02-18T08:00:00.0000000Z False False False}}

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

runTest {test tkt-a7d04fb111-1.10 {Bind DateTime Local Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.10.db] "" InvariantCulture Local \
      BindDateTimeWithKind
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {2015-02-18T00:00:00.0000000\
2015-02-17T16:00:00.0000000-08:00 2015-02-18T00:00:00.0000000-08:00 False False\
False}}

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

unset -nocomplain rawDateTimeValue

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

runSQLiteTestEpilogue
runTestEpilogue







|
|











374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {2015-02-18T00:00:00.0000000\
2015-02-17T16:00:00.0000000-08:00 2015-02-18T00:00:00.0000000-08:00 False False\
False}}

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

unset -nocomplain rawDateTimeValue

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

runSQLiteTestEpilogue
runTestEpilogue