System.Data.SQLite
Check-in [433ac1911c]
Not logged in

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

Overview
Comment:Vastly simplify the existing test for ticket [aba4549801].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 433ac1911c20f2656ed29fa0ec79d63bb73897d8
User & Date: mistachkin 2016-10-13 22:55:35
Context
2016-10-14
00:18
Improvements to the test suite infrastructure. Fix intermittent failures of the test for ticket [aba4549801]. check-in: 54a9280a9d user: mistachkin tags: trunk
2016-10-13
22:55
Vastly simplify the existing test for ticket [aba4549801]. check-in: 433ac1911c user: mistachkin tags: trunk
20:57
Fix ambiguous method overload selection issue in the 'getDateTimeTicks' test suite helper procedure. check-in: 8db28182d3 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/tkt-aba4549801.eagle.

    18     18   package require System.Data.SQLite.Test
    19     19   runSQLiteTestPrologue
    20     20   
    21     21   ###############################################################################
    22     22   
    23     23   runTest {test tkt-aba4549801-1.1 {SQLiteConnection.Changed event} -setup {
    24     24     proc onChanged { sender e } {
    25         -    set list [list $sender]
           25  +    set list [list]
           26  +
           27  +    if {[isObjectHandle $sender] && \
           28  +        [regexp -- $::patterns(connection) $sender]} then {
           29  +      lappend list 1
           30  +    } else {
           31  +      lappend list $sender
           32  +    }
    26     33   
    27     34       if {[string length $e] > 0} then {
    28     35         lappend list [$e EventType]
    29         -      lappend list [set o1 [$e -objectflags NoDispose Transaction]]
    30         -      lappend list [set o2 [$e -objectflags NoDispose Command]]
    31         -      lappend list [set o3 [$e -objectflags NoDispose DataReader]]
    32         -      lappend list [set o4 [$e -objectflags NoDispose CriticalHandle]]
           36  +
           37  +      set o1 [$e -objectflags NoDispose Transaction]
           38  +
           39  +      if {[isObjectHandle $o1] && \
           40  +          [regexp -- $::patterns(transaction) $o1]} then {
           41  +        lappend list 1
           42  +      } else {
           43  +        lappend list $o1
           44  +      }
           45  +
           46  +      set o2 [$e -objectflags NoDispose Command]
           47  +
           48  +      if {[isObjectHandle $o2] && \
           49  +          [regexp -- $::patterns(command) $o2]} then {
           50  +        lappend list 1
           51  +      } else {
           52  +        lappend list $o2
           53  +      }
           54  +
           55  +      set o3 [$e -objectflags NoDispose DataReader]
           56  +
           57  +      if {[isObjectHandle $o3] && \
           58  +          [regexp -- $::patterns(dataReader) $o3]} then {
           59  +        lappend list 1
           60  +      } else {
           61  +        lappend list $o3
           62  +      }
           63  +
           64  +      set o4 [$e -objectflags NoDispose CriticalHandle]
           65  +
           66  +      if {[isObjectHandle $o4] && \
           67  +          ([regexp -- $::patterns(handle1) $o4] || \
           68  +           [regexp -- $::patterns(handle2) $o4])} then {
           69  +        lappend list 1
           70  +      } else {
           71  +        lappend list $o4
           72  +      }
    33     73       }
    34     74   
    35     75       lappend ::result $list
    36     76     }
    37     77   
           78  +  set patterns(connection) {^System#Data#SQLite#SQLiteConnection#\d+$}
           79  +  set patterns(transaction) {^System#Data#SQLite#SQLiteTransaction#\d+$}
           80  +  set patterns(command) {^System#Data#SQLite#SQLiteCommand#\d+$}
           81  +  set patterns(dataReader) {^System#Data#SQLite#SQLiteDataReader#\d+$}
           82  +  set patterns(handle1) {^System#Data#SQLite#SQLiteConnectionHandle#\d+$}
           83  +  set patterns(handle2) {^System#Data#SQLite#SQLiteStatementHandle#\d+$}
           84  +
    38     85     set callback onChanged
    39     86     object invoke System.Data.SQLite.SQLiteConnection add_Changed $callback
    40     87   
    41     88     setupDb [set fileName tkt-aba4549801-1.1.db]
    42     89   } -body {
    43     90     sql execute $db "CREATE TABLE t1(x);"
    44     91   
................................................................................
    53    100     collectGarbage $test_channel
    54    101   
    55    102     set result
    56    103   } -cleanup {
    57    104     object invoke System.Data.SQLite.SQLiteConnection remove_Changed $callback
    58    105     catch {object removecallback $callback}
    59    106   
    60         -  unset -nocomplain rows transaction result callback db fileName
          107  +  unset -nocomplain rows transaction result callback patterns db fileName
    61    108   
    62    109     rename onChanged ""
    63    110   } -constraints {eagle command.object monoBug28 monoBug211 command.sql\
    64         -compile.DATA SQLite System.Data.SQLite} -match regexp -result \
    65         -{^\{System#Data#SQLite#SQLiteConnection#\d+ Opening \{\} \{\} \{\} \{\}\}\
    66         -\{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\} \{\}\}\
    67         -\{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}\
    68         -\{System#Data#SQLite#SQLiteConnection#\d+ ConnectionString \{\} \{\} \{\}\
    69         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
    70         -System#Data#SQLite#SQLiteConnectionHandle#\d+\}\
    71         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
    72         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
    73         -\{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
    74         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
    75         -\{System#Data#SQLite#SQLiteConnection#\d+ Opened \{\} \{\} \{\} \{\}\}\
    76         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
    77         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
    78         -\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
    79         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    80         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
    81         -System#Data#SQLite#SQLiteStatementHandle#\d+\}\
    82         -\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
    83         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    84         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ ClosingDataReader \{\}\
    85         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    86         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
    87         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
    88         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
    89         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
    90         -\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
    91         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    92         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
    93         -System#Data#SQLite#SQLiteStatementHandle#\d+\}\
    94         -\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
    95         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    96         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ ClosingDataReader \{\}\
    97         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
    98         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
    99         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   100         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
   101         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   102         -\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
   103         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   104         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
   105         -System#Data#SQLite#SQLiteStatementHandle#\d+\}\
   106         -\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
   107         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   108         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ ClosingDataReader \{\}\
   109         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   110         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
   111         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   112         -\{System#Data#SQLite#SQLiteConnection#\d+ NewTransaction\
   113         -System#Data#SQLite#SQLiteTransaction#\d+ \{\} \{\} \{\}\}\
   114         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
   115         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   116         -\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
   117         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   118         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
   119         -System#Data#SQLite#SQLiteStatementHandle#\d+\} \{\{\} NewCriticalHandle \{\}\
   120         -\{\} \{\} System#Data#SQLite#SQLiteStatementHandle#\d+\}\
   121         -\{System#Data#SQLite#SQLiteConnection#\d+ ClosingDataReader \{\}\
   122         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   123         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
   124         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   125         -\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
   126         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   127         -\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
   128         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   129         -\{\}\} \{\{\} NewCriticalHandle \{\} \{\} \{\}\
   130         -System#Data#SQLite#SQLiteStatementHandle#\d+\}\
   131         -\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
   132         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   133         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ ClosingDataReader \{\}\
   134         -System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
   135         -\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
   136         -System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
   137         -\{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\} \{\}\}\
   138         -\{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}\
   139         -\{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\} \{\}\}\
   140         -\{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}$}}
          111  +compile.DATA SQLite System.Data.SQLite} -result {{1 Opening {} {} {} {}} {1\
          112  +Closing {} {} {} {}} {1 Closed {} {} {} {}} {1 ConnectionString {} {} {} {}}\
          113  +{{} NewCriticalHandle {} {} {} 1} {1 NewCommand {} 1 {} {}} {1 DisposingCommand\
          114  +{} 1 {} {}} {1 Opened {} {} {} {}} {1 NewCommand {} 1 {} {}} {1 NewDataReader\
          115  +{} 1 1 {}} {{} NewCriticalHandle {} {} {} 1} {1 DisposingDataReader {} 1 1 {}}\
          116  +{1 ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewCommand\
          117  +{} 1 {} {}} {1 NewDataReader {} 1 1 {}} {{} NewCriticalHandle {} {} {} 1} {1\
          118  +DisposingDataReader {} 1 1 {}} {1 ClosingDataReader {} 1 1 {}} {1\
          119  +DisposingCommand {} 1 {} {}} {1 NewCommand {} 1 {} {}} {1 NewDataReader {} 1 1\
          120  +{}} {{} NewCriticalHandle {} {} {} 1} {1 DisposingDataReader {} 1 1 {}} {1\
          121  +ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewTransaction\
          122  +1 {} {} {}} {1 NewCommand {} 1 {} {}} {1 NewDataReader {} 1 1 {}} {{}\
          123  +NewCriticalHandle {} {} {} 1} {{} NewCriticalHandle {} {} {} 1} {1\
          124  +ClosingDataReader {} 1 1 {}} {1 DisposingCommand {} 1 {} {}} {1 NewCommand {} 1\
          125  +{} {}} {1 NewDataReader {} 1 1 {}} {{} NewCriticalHandle {} {} {} 1} {1\
          126  +DisposingDataReader {} 1 1 {}} {1 ClosingDataReader {} 1 1 {}} {1\
          127  +DisposingCommand {} 1 {} {}} {1 Closing {} {} {} {}} {1 Closed {} {} {} {}} {1\
          128  +Closing {} {} {} {}} {1 Closed {} {} {} {}}}}
   141    129   
   142    130   ###############################################################################
   143    131   
   144    132   runSQLiteTestEpilogue
   145    133   runTestEpilogue