System.Data.SQLite
Artifact Content
Not logged in

Artifact b9ec3f0443834f934707cae6b2c2df628baad3c7:


###############################################################################
#
# tkt-aba4549801.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

package require Eagle
package require Eagle.Library
package require Eagle.Test

runTestPrologue

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

package require System.Data.SQLite.Test
runSQLiteTestPrologue

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

runTest {test tkt-aba4549801-1.1 {SQLiteConnection.Changed event} -setup {
  proc onChanged { sender e } {
    set list [list $sender]

    if {[string length $e] > 0} then {
      lappend list [$e EventType]
      lappend list [set o1 [$e -objectflags NoDispose Transaction]]
      lappend list [set o2 [$e -objectflags NoDispose Command]]
      lappend list [set o3 [$e -objectflags NoDispose DataReader]]
      lappend list [set o4 [$e -objectflags NoDispose CriticalHandle]]
    }

    lappend ::result $list
  }

  set callback onChanged
  object invoke System.Data.SQLite.SQLiteConnection add_Changed $callback

  setupDb [set fileName tkt-aba4549801-1.1.db]
} -body {
  sql execute $db "CREATE TABLE t1(x);"

  set transaction [sql transaction begin $db]

  sql execute -execute reader $db \
      "INSERT INTO t1(x) VALUES(1); SELECT x FROM t1;"

  sql transaction commit $transaction

  cleanupDb $fileName
  collectGarbage $test_channel

  set result
} -cleanup {
  object invoke System.Data.SQLite.SQLiteConnection remove_Changed $callback
  catch {object removecallback $callback}

  unset -nocomplain rows transaction result callback db fileName

  rename onChanged ""
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \
regexp -result {^\{System#Data#SQLite#SQLiteConnection#\d+ Opening \{\} \{\}\
\{\} \{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\}\
\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ ConnectionString \{\} \{\} \{\}\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteConnectionHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ Opened \{\} \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteStatementHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteStatementHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteStatementHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewTransaction\
System#Data#SQLite#SQLiteTransaction#\d+ \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteStatementHandle#\d+\} \{System#Object#\d+\
NewCriticalHandle \{\} \{\} \{\} System#Data#SQLite#SQLiteStatementHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ NewDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Object#\d+ NewCriticalHandle \{\} \{\} \{\}\
System#Data#SQLite#SQLiteStatementHandle#\d+\}\
\{System#Data#SQLite#SQLiteConnection#\d+ DisposingDataReader \{\}\
System#Data#SQLite#SQLiteCommand#\d+ System#Data#SQLite#SQLiteDataReader#\d+\
\{\}\} \{System#Data#SQLite#SQLiteConnection#\d+ DisposingCommand \{\}\
System#Data#SQLite#SQLiteCommand#\d+ \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ Closing \{\} \{\} \{\} \{\}\}\
\{System#Data#SQLite#SQLiteConnection#\d+ Closed \{\} \{\} \{\} \{\}\}$}}

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

runSQLiteTestEpilogue
runTestEpilogue