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

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

Overview
Comment:Correct a couple tests due to time zone and DateTime parsing issues.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fb04defd96fb11d43d6fa1c1a81db58337610745
User & Date: mistachkin 2016-06-21 20:05:58
Context
2016-06-21
20:07
Update a test suite infrastructure procedure to account for a breaking change in Eagle beta 36. check-in: 77b9528eea user: mistachkin tags: trunk
20:05
Correct a couple tests due to time zone and DateTime parsing issues. check-in: fb04defd96 user: mistachkin tags: trunk
19:04
Make the 'speed-1.1' test result compatible with Windows 10. check-in: 8ae0e6da88 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/basic.eagle.

  1111   1111     #
  1112   1112     #       The basic problem here is that the Parse [and TryParse] methods of
  1113   1113     #       the DateTime structure seem to always return local time, even when
  1114   1114     #       string value clearly indicates otherwise (i.e. the trailing "Z",
  1115   1115     #       indicating UTC).
  1116   1116     #
  1117   1117     expr {round([object invoke System.Data.SQLite.SQLiteConvert ToUnixEpoch \
  1118         -      "2012-01-01 12:00:00Z"])}
         1118  +      [set dateTime [object invoke -create -alias DateTime ParseExact \
         1119  +      "2012-01-01 12:00:00Z" [getDateTimeFormat] null AdjustToUniversal]]])}
         1120  +} -cleanup {
         1121  +  unset -nocomplain dateTime
  1119   1122   } -constraints {eagle command.object monoBug42 System.Data.SQLite} -result \
  1120         -{1325390400}}
         1123  +{1325419200}}
  1121   1124   
  1122   1125   ###############################################################################
  1123   1126   
  1124   1127   runTest {test data-1.21 {SQLiteConvert ToUnixEpoch (Local)} -body {
  1125   1128     #
  1126   1129     # NOTE: At first, the test result here may not seem correct; however, the
  1127   1130     #       same result can be seen by compiling and running the following C#
................................................................................
  2498   2501   
  2499   2502   runTest {test data-1.53 {BindAllAsText w/DateTime} -setup {
  2500   2503     setupDb [set fileName data-1.53.db] "" Ticks Utc BindAllAsText
  2501   2504   } -body {
  2502   2505     sql execute $db "CREATE TABLE t1(x);"
  2503   2506   
  2504   2507     list [sql execute $db "INSERT INTO t1 (x) VALUES(?);" \
  2505         -      [list param1 DateTime [set dateTime [object invoke DateTime Parse \
  2506         -      "2000.02.29 13:59:58.1234567Z"]]]] [sql execute -execute reader \
  2507         -      -format list $db "SELECT x FROM t1;"]
         2508  +      [list param1 DateTime [set dateTime [object invoke -create \
         2509  +      DateTime ParseExact "2000-02-29 13:59:58.1234567Z" \
         2510  +      [getDateTimeFormat] null AdjustToUniversal]]]] [sql execute \
         2511  +      -execute reader -format list $db "SELECT x FROM t1;"]
  2508   2512   } -cleanup {
  2509   2513     cleanupDb $fileName
  2510   2514   
  2511   2515     unset -nocomplain dateTime db fileName
  2512   2516   } -constraints {eagle command.object monoBug28 monoBug42 command.sql\
  2513         -compile.DATA SQLite System.Data.SQLite} -result {1 630874007980000000}}
         2517  +compile.DATA SQLite System.Data.SQLite} -result {1 630874295981234567}}
  2514   2518   
  2515   2519   ###############################################################################
  2516   2520   
  2517   2521   runTest {test data-1.54 {bind function to a connection} -setup {
  2518   2522     set fileName data-1.54.db
  2519   2523   } -body {
  2520   2524     set id [object invoke Interpreter.GetActive NextId]