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

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

Overview
Comment:Add some test suite infrastructure routines useful for interactive testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bc40ad40912df7c4850400a13e29743847ed6285
User & Date: mistachkin 2014-08-02 07:22:29
Context
2014-08-02
17:33
Update documentation comments for the DefaultDbType and DefaultTypeName properties. check-in: f4af7db4f1 user: mistachkin tags: trunk
07:42
Merge updates from trunk. check-in: 398e29fcc6 user: mistachkin tags: designOptions
07:22
Add some test suite infrastructure routines useful for interactive testing. check-in: bc40ad4091 user: mistachkin tags: trunk
00:02
Make sure the 32-bit-only flagged executable assemblies are re-signed properly and use them for the 32-bit setup packages. check-in: 7a3c948114 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/common.eagle.

  1883   1883         #
  1884   1884         # NOTE: Add the database connection provided by our caller to the list
  1885   1885         #       of those known to the Eagle interpreter.
  1886   1886         #
  1887   1887         object invoke -flags +NonPublic Interpreter.GetActive.connections Add \
  1888   1888             $db $connection
  1889   1889       }
         1890  +
         1891  +    proc getRowsFromDataTable { dataTable } {
         1892  +      set rows [list]
         1893  +      set count [$dataTable Columns.Count]
         1894  +
         1895  +      for {set index 0} {$index < $count} {incr index} {
         1896  +        set dataColumn [$dataTable -alias Columns.get_Item $index]
         1897  +        set names($index) [$dataColumn ColumnName]
         1898  +      }
         1899  +
         1900  +      object foreach -alias dataRow [set dataRows [$dataTable Rows]] {
         1901  +        set row [list]
         1902  +
         1903  +        for {set index 0} {$index < $count} {incr index} {
         1904  +          set value [$dataRow -create -alias get_Item $index]
         1905  +
         1906  +          if {[string length $value] > 0 && \
         1907  +              ![object invoke Convert IsDBNull $value]} then {
         1908  +            lappend row [list $names($index) [$value ToString]]
         1909  +          } else {
         1910  +            lappend row [list $names($index)]
         1911  +          }
         1912  +        }
         1913  +
         1914  +        lappend rows $row
         1915  +      }
         1916  +
         1917  +      return $rows
         1918  +    }
         1919  +
         1920  +    proc dumpRowsFromDataTable { channel rows } {
         1921  +      set sequence 1
         1922  +
         1923  +      foreach row $rows {
         1924  +        tputs $channel [appendArgs \
         1925  +            [expr {$sequence > 1 ? "\n" : ""}] "---- ROW #" $sequence :\n]
         1926  +
         1927  +        foreach pair $row {
         1928  +          if {[llength $pair] >= 2} then {
         1929  +            tputs $channel [appendArgs \t \
         1930  +                [list [lindex $pair 0]] ": " [list [lindex $pair 1]] \n]
         1931  +          } elseif {[llength $pair] == 1} then {
         1932  +            tputs $channel [appendArgs \t \
         1933  +                [list [lindex $pair 0]] ": <null>\n"]
         1934  +          } else {
         1935  +            tputs $channel \t<empty>\n; # NOTE: No data?
         1936  +          }
         1937  +        }
         1938  +
         1939  +        incr sequence
         1940  +      }
         1941  +    }
  1890   1942   
  1891   1943       proc cleanupDb { fileName {varName db} {collect true} {qualify true}
  1892   1944                        {delete true} } {
  1893   1945         #
  1894   1946         # NOTE: Attempt to force all pending "garbage" objects to be collected,
  1895   1947         #       including SQLite statements and backup objects; this should allow
  1896   1948         #       the underlying database file to be deleted.