System.Data.SQLite

Check-in [2a2aa7392c]
Login

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

Overview
Comment:Add test for ticket [2c630bffa7] and some unit-testing infrastructure.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2a2aa7392c481eda73af87d1467dac976ebb98f3
User & Date: mistachkin 2011-07-04 10:47:02.975
References
2011-07-07
04:35 Ticket [2c630bffa7] type conversion status still Closed with 2 other changes artifact: a64876c415 user: mistachkin
04:35 Ticket [b0a5990f48] C# Datatype Double range not fully supported status still Closed with 2 other changes artifact: 16857a2223 user: mistachkin
2011-07-05
07:50 Closed ticket [b0a5990f48]. artifact: 91e20abcc7 user: mistachkin
07:49 Closed ticket [2c630bffa7]: type conversion plus 2 other changes artifact: 80027e38ec user: mistachkin
Context
2011-07-04
15:59
Add pre-beta16 Eagle binaries to externals for unit testing. More changes to new unit testing infrastructure. check-in: 9b6983ebf8 user: mistachkin tags: trunk
10:47
Add test for ticket [2c630bffa7] and some unit-testing infrastructure. check-in: 2a2aa7392c user: mistachkin tags: trunk
05:18
Reorganize the downloads page to make it easier to pick the download by platform and framework. check-in: ac836ab5b8 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/basic.eagle.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package require EagleLibrary
package require EagleTest

runTestPrologue

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

set test_configuration Release

object load -loadtype File [file join [file dirname $path] bin \
    $test_configuration bin System.Data.SQLite.dll]

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

runTest {test basic-1.1 {simple INSERT / SELECT} -setup {
  set fileName [file join [getTemporaryPath] test.sqlite3]
  set connection [sql open -type SQLite [subst {Data Source=${fileName}}]]
} -body {







<
|
<
<







10
11
12
13
14
15
16

17


18
19
20
21
22
23
24
package require EagleLibrary
package require EagleTest

runTestPrologue

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


source [file join $path common.eagle]



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

runTest {test basic-1.1 {simple INSERT / SELECT} -setup {
  set fileName [file join [getTemporaryPath] test.sqlite3]
  set connection [sql open -type SQLite [subst {Data Source=${fileName}}]]
} -body {
Added Tests/common.eagle.




























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
###############################################################################
#
# common.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

if {[isEagle]} then {
  object load -loadtype File [file join [file dirname $path] bin \
      [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] \
      $test_configuration bin System.Data.SQLite.dll]
}
Added Tests/tkt-2c630bffa7.eagle.






















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
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
53
54
55
56
57
58
59
###############################################################################
#
# tkt-2c630bffa7.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

package require EagleLibrary
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]

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

runTest {test tkt-2c630bffa7-1.1 {floating point type ranges} -setup {
  set fileName [file join [getTemporaryPath] tkt-2c630bffa7-1.1.sqlite3]
  set connection [sql open -type SQLite [subst {Data Source=${fileName}}]]
} -body {
  sql execute $connection "CREATE TABLE t1(x INTEGER, y REAL);"
  sql execute $connection "CREATE TABLE t2(x INTEGER, y FLOAT);"
  sql execute $connection "CREATE TABLE t3(x INTEGER, y DOUBLE);"

  set y [list -1.79769e308 -3.40282e038 -1 0 1 3.40282e038 1.79769e308]

  set result [list]

  foreach t [list t1 t2 t3] {
    for {set x 0} {$x < [llength $y]} {incr x} {
      sql execute $connection \
          "INSERT INTO $t (x, y) VALUES($x, [lindex $y $x]);"
    }

    sql execute -execute reader $connection \
      "SELECT x, y FROM $t ORDER BY x;"

    for {set x 1} {$x <= [llength $y]} {incr x} {
      lappend result [getRowColumnValue rows $x y]
    }
  }

  set result
} -cleanup {
  catch {sql close $connection}
  catch {file delete $fileName}
  unset -nocomplain x y t result rows connection fileName
} -constraints {eagle monoBug28 command.sql compile.DATA} -result \
{-1.79769E+308 -3.40282E+38 -1 0 1 3.40282E+38 1.79769E+308 -1.79769E+308\
-3.40282E+38 -1 0 1 3.40282E+38 1.79769E+308 -1.79769E+308 -3.40282E+38 -1 0 1\
3.40282E+38 1.79769E+308}}

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

runTestEpilogue