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

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

Overview
Comment:Add some procedures to the test suite infrastructure.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | customDataTypes
Files: files | file ages | folders
SHA1: d593d900ac364ea43a1b833f5caa4c0e15f95dda
User & Date: mistachkin 2016-06-19 08:22:04
Context
2016-06-19
20:17
Correction to the new test suite helper procedures. check-in: fd2ed795c1 user: mistachkin tags: customDataTypes
08:22
Add some procedures to the test suite infrastructure. check-in: d593d900ac user: mistachkin tags: customDataTypes
07:34
Fix typos in comments. check-in: 819975f2c9 user: mistachkin tags: customDataTypes
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to lib/System.Data.SQLite/common.eagle.

  1823   1823           #       System.Data.SQLite, and suitable for round-tripping with the
  1824   1824           #       DateTime class of the framework.  If this value is changed,
  1825   1825           #       various tests may fail.
  1826   1826           #
  1827   1827           return "yyyy-MM-dd HH:mm:ss.FFFFFFFK"
  1828   1828         }
  1829   1829       }
         1830  +
         1831  +    proc getProperties { object varName } {
         1832  +      upvar 1 $varName properties
         1833  +
         1834  +      set count 0
         1835  +      set names [object members -membertypes Property -nameonly $object]
         1836  +
         1837  +      foreach name $names {
         1838  +        if {[catch {
         1839  +          object invoke -objectflags +NoDispose $object $name
         1840  +        } value] == 0} then {
         1841  +          if {[isObjectHandle $value]} then {
         1842  +            set error null; object invoke -flags +NonPublic \
         1843  +                -marshalflags +NoHandle Interpreter.GetActive \
         1844  +                AddObjectReference Ok $value error
         1845  +
         1846  +            lappend properties(objects) [list $name $value]
         1847  +          } else {
         1848  +            lappend properties(values) [list $name $value]
         1849  +          }
         1850  +
         1851  +          incr count
         1852  +        } else {
         1853  +          lappend properties(errors) [list $name $::errorCode]
         1854  +        }
         1855  +      }
         1856  +
         1857  +      return $count
         1858  +    }
         1859  +
         1860  +    proc getAllProperties { object varName } {
         1861  +      upvar 1 $varName properties
         1862  +      set value $object
         1863  +
         1864  +      while {true} {
         1865  +        if {![info exists properties(seenObjects)] || \
         1866  +            $value ni $properties(seenObjects)} then {
         1867  +          getProperties $value properties
         1868  +          lappend properties(seenObjects) $value
         1869  +        }
         1870  +
         1871  +        if {![info exists properties(objects)]} then {
         1872  +          break
         1873  +        }
         1874  +
         1875  +        if {[llength $properties(objects)] == 0} then {
         1876  +          unset properties(objects); break
         1877  +        }
         1878  +
         1879  +        set value [lindex [lindex $properties(objects) 0] end]
         1880  +        set properties(objects) [lrange $properties(objects) 1 end]
         1881  +      }
         1882  +
         1883  +      if {[info exists properties(seenObjects)]} then {
         1884  +        foreach value $properties(seenObjects) {
         1885  +          catch {object dispose $value}
         1886  +        }
         1887  +
         1888  +        unset properties(seenObjects)
         1889  +      }
         1890  +    }
  1830   1891   
  1831   1892       proc enumerableToList { enumerable } {
  1832   1893         set result [list]
  1833   1894   
  1834   1895         if {[string length $enumerable] == 0 || $enumerable eq "null"} then {
  1835   1896           return $result
  1836   1897         }