System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation

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

Overview
Comment:Improve serialization test (i.e. 'data-1.116') that was added by the previous check-in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 52a66097eeaf9eda5576796bf89c0e4ebf74ed11
User & Date: mistachkin 2024-07-04 00:16:01
Context
2024-07-04
01:18
Further improvements to the 'data-1.116' test. check-in: a38b0f5f53 user: mistachkin tags: trunk
00:16
Improve serialization test (i.e. 'data-1.116') that was added by the previous check-in. check-in: 52a66097ee user: mistachkin tags: trunk
2024-07-03
23:13
Add the Serialize and Deserialize methods to the SQLiteConnection class. check-in: 502ca25961 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/basic.eagle.

6107
6108
6109
6110
6111
6112
6113












6114








6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126










6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143












6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155



6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
    SELECT hex(sha3_query('SELECT x FROM t2 ORDER BY rowId;'));
  }]

  set hash(before,3) [sql execute -execute scalar $db {
    SELECT hex(sha3_query('SELECT x FROM t3 ORDER BY rowId;'));
  }]













  set data [$connection -create -alias Serialize null]









  setupDb [set fileName(2) :memory:] \
      "" "" "" "" "" false false false true memDb

  set memConnection [getDbConnection memDb]

  $memConnection EnableExtensions true

  $memConnection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_shathree_init

  $memConnection Deserialize null $data false











  set hash(after,0) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t0 ORDER BY rowId;'));
  }]

  set hash(after,1) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t1 ORDER BY rowId;'));
  }]

  set hash(after,2) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t2 ORDER BY rowId;'));
  }]

  set hash(after,3) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t3 ORDER BY rowId;'));
  }]













  list [expr {
    $hash(before,0) eq $hash(after,0) ? True : \
        [appendArgs $hash(before,0) " versus " $hash(after,0)]
  }] [expr {
    $hash(before,1) eq $hash(after,1) ? True : \
        [appendArgs $hash(before,1) " versus " $hash(after,1)]
  }] [expr {
    $hash(before,2) eq $hash(after,2) ? True : \
        [appendArgs $hash(before,2) " versus " $hash(after,2)]
  }] [expr {
    $hash(before,3) eq $hash(after,3) ? True : \
        [appendArgs $hash(before,3) " versus " $hash(after,3)]



  }]
} -cleanup {
  freeDbConnection memConnection
  freeDbConnection

  unset -nocomplain connection memConnection

  cleanupDb $fileName(2) memDb
  cleanupDb $fileName(1)

  unset -nocomplain data hash
  unset -nocomplain db memDb fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
defineConstant.System.Data.SQLite.INTEROP_SHA3_EXTENSION System.Data.SQLite\
SQLiteInterop} -result {True True True True}}

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

reportSQLiteResources $test_channel

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

runSQLiteTestExtraEpilogue
runSQLiteTestFilesEpilogue
runSQLiteTestEpilogue
runTestEpilogue







>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>











|
>
>
>
>
>
>
>
>
>
>

















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












>
>
>










|



|











6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
    SELECT hex(sha3_query('SELECT x FROM t2 ORDER BY rowId;'));
  }]

  set hash(before,3) [sql execute -execute scalar $db {
    SELECT hex(sha3_query('SELECT x FROM t3 ORDER BY rowId;'));
  }]

  tputs $test_channel [appendArgs \
      "---- before hash #0 is " $hash(before,0) \n]

  tputs $test_channel [appendArgs \
      "---- before hash #1 is " $hash(before,1) \n]

  tputs $test_channel [appendArgs \
      "---- before hash #2 is " $hash(before,2) \n]

  tputs $test_channel [appendArgs \
      "---- before hash #3 is " $hash(before,3) \n]

  set data(db) [$connection -create -alias Serialize null]
  set error null

  set hash(before,data) [string toupper \
      [object invoke Utility ToHexadecimalString \
      [object invoke Utility HashBytes SHA512 $data(db) error]]]

  tputs $test_channel [appendArgs \
      "---- before data hash is " $hash(before,data) \n]

  setupDb [set fileName(2) :memory:] \
      "" "" "" "" "" false false false true memDb

  set memConnection [getDbConnection memDb]

  $memConnection EnableExtensions true

  $memConnection LoadExtension \
      [getCoreExtensionBinaryFileName null] sqlite3_shathree_init

  $memConnection Deserialize null $data(db) true

  set data(memDb) [$memConnection -create -alias Serialize null]
  set error null

  set hash(after,data) [string toupper \
      [object invoke Utility ToHexadecimalString \
      [object invoke Utility HashBytes SHA512 $data(memDb) error]]]

  tputs $test_channel [appendArgs \
      "---- after data hash is " $hash(after,data) \n]

  set hash(after,0) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t0 ORDER BY rowId;'));
  }]

  set hash(after,1) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t1 ORDER BY rowId;'));
  }]

  set hash(after,2) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t2 ORDER BY rowId;'));
  }]

  set hash(after,3) [sql execute -execute scalar $memDb {
    SELECT hex(sha3_query('SELECT x FROM t3 ORDER BY rowId;'));
  }]

  tputs $test_channel [appendArgs \
      "---- after hash #0 is " $hash(after,0) \n]

  tputs $test_channel [appendArgs \
      "---- after hash #1 is " $hash(after,1) \n]

  tputs $test_channel [appendArgs \
      "---- after hash #2 is " $hash(after,2) \n]

  tputs $test_channel [appendArgs \
      "---- after hash #3 is " $hash(after,3) \n]

  list [expr {
    $hash(before,0) eq $hash(after,0) ? True : \
        [appendArgs $hash(before,0) " versus " $hash(after,0)]
  }] [expr {
    $hash(before,1) eq $hash(after,1) ? True : \
        [appendArgs $hash(before,1) " versus " $hash(after,1)]
  }] [expr {
    $hash(before,2) eq $hash(after,2) ? True : \
        [appendArgs $hash(before,2) " versus " $hash(after,2)]
  }] [expr {
    $hash(before,3) eq $hash(after,3) ? True : \
        [appendArgs $hash(before,3) " versus " $hash(after,3)]
  }] [expr {
    $hash(before,data) eq $hash(after,data) ? True : \
        [appendArgs $hash(before,data) " versus " $hash(after,data)]
  }]
} -cleanup {
  freeDbConnection memConnection
  freeDbConnection

  unset -nocomplain connection memConnection

  cleanupDb $fileName(2) memDb
  cleanupDb $fileName(1)

  unset -nocomplain data hash error
  unset -nocomplain db memDb fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
defineConstant.System.Data.SQLite.INTEROP_SHA3_EXTENSION System.Data.SQLite\
SQLiteInterop} -result {True True True True True}}

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

reportSQLiteResources $test_channel

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

runSQLiteTestExtraEpilogue
runSQLiteTestFilesEpilogue
runSQLiteTestEpilogue
runTestEpilogue