System.Data.SQLite

Check-in [78c6fc8c6a]
Login

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

Overview
Comment:More tweaks to unit tests and infrastructure.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 78c6fc8c6ad74c6dfcf453f958fb26db8b70a1c3
User & Date: mistachkin 2011-07-04 17:19:10.380
Context
2011-07-05
01:03
Update hashes for non-bundled downloads. check-in: 8dbc95c446 user: mistachkin tags: trunk
2011-07-04
17:19
More tweaks to unit tests and infrastructure. check-in: 78c6fc8c6a user: mistachkin tags: trunk
16:38
Update download page with new binaries and setups to fix [96a783d8a5]. check-in: 7fc4c39b87 user: mistachkin tags: trunk, release
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/basic.eagle.
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27
28
29
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]


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

runTest {test basic-1.1 {simple INSERT / SELECT} -setup {
  loadAssembly System.Data.SQLite.dll
  setupDb [set fileName basic-1.1.sqlite3]
} -body {
  set result [list]

  lappend result [sql execute -execute scalar $db \
      "SELECT sqlite_source_id();"]








>



|
<







11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]
loadAssembly System.Data.SQLite.dll

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

runTest {test basic-1.1 {SELECT scalar/reader, CREATE, INSERT} -setup {

  setupDb [set fileName basic-1.1.sqlite3]
} -body {
  set result [list]

  lappend result [sql execute -execute scalar $db \
      "SELECT sqlite_source_id();"]

37
38
39
40
41
42
43
44
45
46
47
48
49
50
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain name rows result db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA} -match regexp \
-result {^\{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [0-9a-f]{40}\} \{1 \{\{x 1\}\
\{y foo\} \{z 1234\}\}\} \{count 1\} \{names \{x y z\}\}$}}

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

runTestEpilogue







|
|
|




37
38
39
40
41
42
43
44
45
46
47
48
49
50
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain name rows result db fileName
} -constraints {eagle monoBug28 command.sql compile.DATA System.Data.SQLite} \
-match regexp -result {^\{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [0-9a-f]{40}\}\
\{1 \{\{x 1\} \{y foo\} \{z 1234\}\}\} \{count 1\} \{names \{x y z\}\}$}}

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

runTestEpilogue
Changes to Tests/common.eagle.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15








16
17
18
19
20
21
22
###############################################################################
#
# common.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

if {[isEagle]} then {
  proc loadAssembly { fileName } {
    object load -loadtype File \
        [file join [file dirname $::path] bin \
        [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] \
        $::test_configuration bin $fileName]








  }

  proc setupDb {fileName {varName db}} {
    set fileName [file join [getTemporaryPath] $fileName]
    catch {file delete $fileName}
    upvar 1 $varName db
    set db [sql open -type SQLite [subst {Data Source=${fileName}}]]











<
|


>
>
>
>
>
>
>
>







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
###############################################################################
#
# common.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

if {[isEagle]} then {
  proc loadAssembly { fileName } {

    set fileName [file join [file dirname $::path] bin \
        [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] \
        $::test_configuration bin $fileName]

    if {[catch {set assembly \
        [object load -loadtype File $fileName]}] == 0} then {
      #
      # NOTE: Now, add the necessary test constraint.
      #
      addConstraint [file rootname [file tail $fileName]]
    }
  }

  proc setupDb {fileName {varName db}} {
    set fileName [file join [getTemporaryPath] $fileName]
    catch {file delete $fileName}
    upvar 1 $varName db
    set db [sql open -type SQLite [subst {Data Source=${fileName}}]]
Changes to Tests/tkt-2c630bffa7.eagle.
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
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
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]


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

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

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

runTest {test tkt-2c630bffa7-1.1 {range of REAL type} -setup {
  loadAssembly System.Data.SQLite.dll
  setupDb [set fileName tkt-2c630bffa7-1.1.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t1(x INTEGER, y REAL);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t1 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t1 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName

} -constraints {eagle monoBug28 command.sql compile.DATA} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

runTest {test tkt-2c630bffa7-1.2 {range of FLOAT type} -setup {
  loadAssembly System.Data.SQLite.dll
  setupDb [set fileName tkt-2c630bffa7-1.2.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t2(x INTEGER, y FLOAT);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t2 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t2 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName

} -constraints {eagle monoBug28 command.sql compile.DATA} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

runTest {test tkt-2c630bffa7-1.3 {range of DOUBLE type} -setup {
  loadAssembly System.Data.SQLite.dll
  setupDb [set fileName tkt-2c630bffa7-1.3.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t3(x INTEGER, y DOUBLE);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t3 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t3 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName

} -constraints {eagle monoBug28 command.sql compile.DATA} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

unset -nocomplain y

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

runTestEpilogue







>








<















>
|





<















>
|





<















>
|









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
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
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]
loadAssembly System.Data.SQLite.dll

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

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

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

runTest {test tkt-2c630bffa7-1.1 {range of REAL type} -setup {

  setupDb [set fileName tkt-2c630bffa7-1.1.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t1(x INTEGER, y REAL);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t1 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t1 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA System.Data.SQLite} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

runTest {test tkt-2c630bffa7-1.2 {range of FLOAT type} -setup {

  setupDb [set fileName tkt-2c630bffa7-1.2.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t2(x INTEGER, y FLOAT);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t2 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t2 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA System.Data.SQLite} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

runTest {test tkt-2c630bffa7-1.3 {range of DOUBLE type} -setup {

  setupDb [set fileName tkt-2c630bffa7-1.3.sqlite3]
} -body {
  sql execute $db "CREATE TABLE t3(x INTEGER, y DOUBLE);"

  for {set x 0} {$x < [llength $y]} {incr x} {
    sql execute $db \
        "INSERT INTO t3 (x, y) VALUES($x, [lindex $y $x]);"
  }

  set result [sql execute -execute reader -format list $db \
    "SELECT x, y FROM t3 ORDER BY x;"]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain x result db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA System.Data.SQLite} -result \
{0 -1.79769E+308 1 -3.40282E+38 2 -1 3 0 4 1 5 3.40282E+38 6 1.79769E+308}}

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

unset -nocomplain y

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

runTestEpilogue