System.Data.SQLite

Check-in [c2d56cbccf]
Login

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

Overview
Comment:Initial work on tests for ticket [0e48e80333].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tkt-0e48e80333
Files: files | file ages | folders
SHA1: c2d56cbccf1c12d6c62ce69b700eec371d6d2a5e
User & Date: mistachkin 2017-11-14 08:47:20.340
Context
2017-11-14
16:17
Add and enhance tests for ticket [0e48e80333]. Updates to test suite infrastructure. Closed-Leaf check-in: dbf44d7cf2 user: mistachkin tags: tkt-0e48e80333
08:47
Initial work on tests for ticket [0e48e80333]. check-in: c2d56cbccf user: mistachkin tags: tkt-0e48e80333
2017-11-09
08:37
Add another error message to the UnhookNativeCallbacks method. check-in: df1cca89d1 user: mistachkin tags: tkt-0e48e80333
Changes
Unified Diff Ignore Whitespace Patch
Changes to Setup/data/verify.lst.
830
831
832
833
834
835
836

837
838
839
840
841
842
843
  Tests/stress.eagle
  Tests/template/
  Tests/template/empty.eagle
  Tests/thread.eagle
  Tests/tkt-00f86f9739.eagle
  Tests/tkt-0a32885109.eagle
  Tests/tkt-0d5b1ef362.eagle

  Tests/tkt-0ed01c447c.eagle
  Tests/tkt-17045010df.eagle
  Tests/tkt-1c456ae75f.eagle
  Tests/tkt-1f7bfff467.eagle
  Tests/tkt-201128cc88.eagle
  Tests/tkt-2556655d1b.eagle
  Tests/tkt-2abbf2c244.eagle







>







830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
  Tests/stress.eagle
  Tests/template/
  Tests/template/empty.eagle
  Tests/thread.eagle
  Tests/tkt-00f86f9739.eagle
  Tests/tkt-0a32885109.eagle
  Tests/tkt-0d5b1ef362.eagle
  Tests/tkt-0e48e80333.eagle
  Tests/tkt-0ed01c447c.eagle
  Tests/tkt-17045010df.eagle
  Tests/tkt-1c456ae75f.eagle
  Tests/tkt-1f7bfff467.eagle
  Tests/tkt-201128cc88.eagle
  Tests/tkt-2556655d1b.eagle
  Tests/tkt-2abbf2c244.eagle
Added Tests/tkt-0e48e80333.eagle.










































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
###############################################################################
#
# tkt-0e48e80333.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-0e48e80333-1.1 {unhook delegates on pooled close} -setup {
  moveEagleShellMdaConfig false
  saveMdaConfigEnvironment
} -body {
  set configFileName [file join \
      [getBinaryDirectory] EagleShell.exe.mda.config]

  writeFile $configFileName [string trim {
    <?xml version="1.0" encoding="UTF-8" ?>
    <mdaConfig xmlns="http://schemas.microsoft.com/CLR/2004/10/mda">
      <assistants>
        <callbackOnCollectedDelegate listSize="50" />
      </assistants>
    </mdaConfig>
  }]

  set scriptFileName [file tempname]

  writeFile $scriptFileName [string trim {
    package require Eagle
    package require Eagle.Library
    package require Eagle.Test
    package require System.Data.SQLite.Test

    proc traceCallback { sender e } {
      lappend ::result [$e Statement]
      lappend ::result [$sender IsReadOnly null]
    }

    object load System.Data.SQLite
    set ::test_channel stdout

    setupDb [set fileName tkt-0e48e80333-1.1.db]
    sql execute $db {CREATE TABLE t1(x);}
    cleanupDb $fileName db true false false

    set ::result ""

    set count 10

    set sql [string trim { \
      INSERT INTO t1 (x) VALUES(1); \
    }]

    for {set i 0} {$i < $count} {incr i} {
      setupDb $fileName \
          "" "" "" "" "Pooling=True;" false false

      set connection [getDbConnection]
      $connection add_Trace traceCallback

      sql execute $db $sql

      freeDbConnection
      cleanupDb $fileName db true false false
    }

    if {$::result eq [lrepeat $count $sql False]} then {
      exit Success
    } else {
      exit Failure
    }
  }]

  set env(COMPLUS_MDA) 1; # enable MDA config file.

  set code [catch {
    execTestShell [list \
        -eventflags Wait -success Success -stdout output] \
        -preInitialize [appendArgs \" "set no(logFileName) 1" \"] \
        -preInitialize [appendArgs \" "set no(sqliteFiles) 1" \"] \
        -file [appendArgs \" $scriptFileName \"] \
        -logFile [appendArgs \" [getTestLog] \"]
  } error]

  tlog "---- BEGIN STDOUT OUTPUT\n"
  tlog $output
  tlog "\n---- END STDOUT OUTPUT\n"

  set code
} -cleanup {
  catch {file delete $scriptFileName}
  catch {file delete $configFileName}

  unset -nocomplain code output error scriptFileName configFileName

  restoreMdaConfigEnvironment
  moveEagleShellMdaConfig true
} -constraints {eagle dotNet testExec command.object monoBug28 command.sql\
compile.DATA SQLite System.Data.SQLite} -result {0}}

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

runSQLiteTestEpilogue
runTestEpilogue
Changes to lib/System.Data.SQLite/common.eagle.
1196
1197
1198
1199
1200
1201
1202





















































1203
1204
1205
1206
1207
1208
1209
            tputs $::test_channel [appendArgs \
                "---- skipped moving \"" $fileName(1) \
                "\", it does not exist\n"]
          }
        }
      }
    }






















































    proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
      #
      # NOTE: This procedure returns a test setup script fragment suitable for
      #       evaluation by an interpreter created in an isolated application
      #       domain.  The script fragment being returned will be surrounded by
      #       the prefix and suffix "script fragments" specified by our caller,







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







1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
            tputs $::test_channel [appendArgs \
                "---- skipped moving \"" $fileName(1) \
                "\", it does not exist\n"]
          }
        }
      }
    }

    proc moveEagleShellMdaConfig { {restore false} {verbose true} } {
      set directory [getBinaryDirectory]

      if {[string length $directory] == 0} then {
        if {$verbose} then {
          tputs $::test_channel [appendArgs \
              "---- skipped moving \"EagleShell.exe.mda.config\", " \
              "no binary directory\n"]
        }

        return
      }

      set fileName(1) [file normalize \
          [file join $directory EagleShell.exe.mda.config]]

      set fileName(2) [appendArgs $fileName(1) .moved]

      if {$restore} then {
        if {[file exists $fileName(2)]} then {
          file rename $fileName(2) $fileName(1)

          if {$verbose} then {
            tputs $::test_channel [appendArgs \
                "---- moved \"" $fileName(2) "\" to \"" \
                $fileName(1) \"\n]
          }
        } else {
          if {$verbose} then {
            tputs $::test_channel [appendArgs \
                "---- skipped moving \"" $fileName(2) \
                "\", it does not exist\n"]
          }
        }
      } else {
        if {[file exists $fileName(1)]} then {
          file rename $fileName(1) $fileName(2)

          if {$verbose} then {
            tputs $::test_channel [appendArgs \
                "---- moved \"" $fileName(1) "\" to \"" \
                $fileName(2) \"\n]
          }
        } else {
          if {$verbose} then {
            tputs $::test_channel [appendArgs \
                "---- skipped moving \"" $fileName(1) \
                "\", it does not exist\n"]
          }
        }
      }
    }

    proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
      #
      # NOTE: This procedure returns a test setup script fragment suitable for
      #       evaluation by an interpreter created in an isolated application
      #       domain.  The script fragment being returned will be surrounded by
      #       the prefix and suffix "script fragments" specified by our caller,
2929
2930
2931
2932
2933
2934
2935












2936
2937
2938
2939
2940
2941
2942
      # NOTE: This is self-cleaning.  If no saved environment variables now
      #       exist, remove the array.
      #
      if {[array size savedEnv] == 0} then {
        unset -nocomplain savedEnv
      }
    }













    proc saveGetSettingValueEnvironment {} {
      upvar 1 savedEnv savedEnv

      saveEnvironmentVariables [list \
          No_Expand No_SQLiteGetSettingValue No_SQLiteXmlConfigFile] \
          savedEnv







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







2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
      # NOTE: This is self-cleaning.  If no saved environment variables now
      #       exist, remove the array.
      #
      if {[array size savedEnv] == 0} then {
        unset -nocomplain savedEnv
      }
    }

    proc saveMdaConfigEnvironment {} {
      upvar 1 savedEnv savedEnv

      saveEnvironmentVariables [list COMPLUS_MDA] savedEnv
    }

    proc restoreMdaConfigEnvironment {} {
      upvar 1 savedEnv savedEnv

      restoreEnvironmentVariables [list COMPLUS_MDA] savedEnv
    }

    proc saveGetSettingValueEnvironment {} {
      upvar 1 savedEnv savedEnv

      saveEnvironmentVariables [list \
          No_Expand No_SQLiteGetSettingValue No_SQLiteXmlConfigFile] \
          savedEnv