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 Unified Diffs Show Whitespace Changes Patch

Changes to Tests/common.eagle.

1883
1884
1885
1886
1887
1888
1889




















































1890
1891
1892
1893
1894
1895
1896
      #
      # NOTE: Add the database connection provided by our caller to the list
      #       of those known to the Eagle interpreter.
      #
      object invoke -flags +NonPublic Interpreter.GetActive.connections Add \
          $db $connection
    }




















































 
    proc cleanupDb { fileName {varName db} {collect true} {qualify true}
                     {delete true} } {
      #
      # NOTE: Attempt to force all pending "garbage" objects to be collected,
      #       including SQLite statements and backup objects; this should allow
      #       the underlying database file to be deleted.







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







1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
      #
      # NOTE: Add the database connection provided by our caller to the list
      #       of those known to the Eagle interpreter.
      #
      object invoke -flags +NonPublic Interpreter.GetActive.connections Add \
          $db $connection
    }
 
    proc getRowsFromDataTable { dataTable } {
      set rows [list]
      set count [$dataTable Columns.Count]

      for {set index 0} {$index < $count} {incr index} {
        set dataColumn [$dataTable -alias Columns.get_Item $index]
        set names($index) [$dataColumn ColumnName]
      }

      object foreach -alias dataRow [set dataRows [$dataTable Rows]] {
        set row [list]

        for {set index 0} {$index < $count} {incr index} {
          set value [$dataRow -create -alias get_Item $index]

          if {[string length $value] > 0 && \
              ![object invoke Convert IsDBNull $value]} then {
            lappend row [list $names($index) [$value ToString]]
          } else {
            lappend row [list $names($index)]
          }
        }

        lappend rows $row
      }

      return $rows
    }
 
    proc dumpRowsFromDataTable { channel rows } {
      set sequence 1

      foreach row $rows {
        tputs $channel [appendArgs \
            [expr {$sequence > 1 ? "\n" : ""}] "---- ROW #" $sequence :\n]

        foreach pair $row {
          if {[llength $pair] >= 2} then {
            tputs $channel [appendArgs \t \
                [list [lindex $pair 0]] ": " [list [lindex $pair 1]] \n]
          } elseif {[llength $pair] == 1} then {
            tputs $channel [appendArgs \t \
                [list [lindex $pair 0]] ": <null>\n"]
          } else {
            tputs $channel \t<empty>\n; # NOTE: No data?
          }
        }

        incr sequence
      }
    }
 
    proc cleanupDb { fileName {varName db} {collect true} {qualify true}
                     {delete true} } {
      #
      # NOTE: Attempt to force all pending "garbage" objects to be collected,
      #       including SQLite statements and backup objects; this should allow
      #       the underlying database file to be deleted.