System.Data.SQLite
Check-in [86b8dcc0ba]
Not logged in

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

Overview
Comment:Revise tests to more precisely demonstrate the fixed issues.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | newJulianDay
Files: files | file ages | folders
SHA1: 86b8dcc0ba818f22fa0c7d4feec012d7ca0e7699
User & Date: mistachkin 2014-11-01 18:36:53
Context
2014-11-01
18:44
Update version history docs. check-in: 8bc9e1d65d user: mistachkin tags: newJulianDay
18:36
Revise tests to more precisely demonstrate the fixed issues. check-in: 86b8dcc0ba user: mistachkin tags: newJulianDay
00:27
Add more tests. check-in: 5b924895c0 user: mistachkin tags: newJulianDay
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/tkt-3e783eecbe.eagle.

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

runTest {test tkt-3e783eecbe-1.1 {Julian Day w/o OLE Automation} -setup {
  set minDateTime [object invoke -create -alias DateTime MinValue]
  set maxDateTime [object invoke -create -alias DateTime MaxValue]

  set dateTimeValues [list $minDateTime 0099-12-31 0100-01-01 $maxDateTime]
} -body {
  set result [list]

  foreach dateTimeValue $dateTimeValues {
    if {$dateTimeValue ni [info objects]} then {
      set dateTimeValue [object invoke \
          -create DateTime Parse $dateTimeValue]

      set dateTimeValue [object invoke \
          -create -alias DateTime SpecifyKind $dateTimeValue Utc]
    }

    lappend result [list [$dateTimeValue ToString [getDateTimeFormat]] \
        [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
        ToJulianDay $dateTimeValue]]

  }








  set result
} -cleanup {
  unset -nocomplain result dateTimeValue dateTimeValues maxDateTime \
      minDateTime
} -constraints {eagle System.Data.SQLite} -result {{{0001-01-01 00:00:00}\
1721425.5} {{0099-12-31 00:00:00Z} 1757583.5} {{0100-01-01 00:00:00Z}\
1757584.5} {{9999-12-31 23:59:59.9999999} 5373484.49998843}}}

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

runTest {test tkt-3e783eecbe-1.2 {Julian Day w/o OLE Automation} -setup {
  set minDoubleValue [object invoke -create -alias Double MinValue]
  set maxDoubleValue [object invoke -create -alias Double MaxValue]

  set doubleValues [list \
      $minDoubleValue -1.0 0.0 1.0 1721425.5 2451910.5 2456962.0 \
      5373484.49998843 $maxDoubleValue]
} -body {
  set result [list]

  foreach doubleValue $doubleValues {
    if {$doubleValue ni [info objects]} then {
      set doubleValue [object invoke \
          -create -alias Double Parse $doubleValue]
    }


    set dateTimeValue [object invoke -create -alias \
        System.Data.SQLite.SQLiteConvert ToDateTime $doubleValue Utc]

    lappend result [list [$doubleValue ToString] [$dateTimeValue \
        ToString [getDateTimeFormat]]]

  }







  set result
} -cleanup {
  unset -nocomplain result dateTimeValue doubleValue doubleValues \

      maxDoubleValue minDoubleValue
} -constraints {eagle System.Data.SQLite} -result {{-1.79769313486232E+308\
{0001-01-01 00:00:00Z}} {-1 {0001-01-01 00:00:00Z}} {0 {0001-01-01 00:00:00Z}}\
{1 {0001-01-01 00:00:00Z}} {1721425.5 {0001-01-01 00:00:00Z}} {2451910.5\
{2001-01-01 00:00:00Z}} {2456962 {2014-10-31 12:00:00Z}} {5373484.49998843\
{9999-12-31 23:59:59Z}} {1.79769313486232E+308 {0001-01-01 00:00:00Z}}}}


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

runSQLiteTestEpilogue
runTestEpilogue







|






|
|


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

|
|
|
|
|











|







>
|
|

<
|
>
|
>
>
|
>
>
>
>
|

<
>
|
|
|
|
|
|
>





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

runTest {test tkt-3e783eecbe-1.1 {Julian Day w/o OLE Automation} -setup {
  set minDateTime [object invoke -create -alias DateTime MinValue]
  set maxDateTime [object invoke -create -alias DateTime MaxValue]

  set dateTimeValues [list $minDateTime 0099-12-31 0100-01-01 $maxDateTime]
} -body {
  set results [list]

  foreach dateTimeValue $dateTimeValues {
    if {$dateTimeValue ni [info objects]} then {
      set dateTimeValue [object invoke \
          -create DateTime Parse $dateTimeValue]

      set dateTimeValue [object invoke -create -alias \
          DateTime SpecifyKind $dateTimeValue Utc]
    }

    set code [catch {
      object invoke System.Data.SQLite.SQLiteConvert ToJulianDay \
          $dateTimeValue
    } result]

    if {$code != 0} then {
      regexp -- {---> (.*?)(?:\r|\n)} $result result result
    }

    lappend results [list [$dateTimeValue ToString [getDateTimeFormat]] \
        $code $result]
  }

  set results
} -cleanup {
  unset -nocomplain code result results dateTimeValue dateTimeValues \
      maxDateTime minDateTime
} -constraints {eagle System.Data.SQLite} -result {{{0001-01-01 00:00:00} 0\
1721425.5} {{0099-12-31 00:00:00Z} 0 1757583.5} {{0100-01-01 00:00:00Z} 0\
1757584.5} {{9999-12-31 23:59:59.9999999} 0 5373484.49998843}}}

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

runTest {test tkt-3e783eecbe-1.2 {Julian Day w/o OLE Automation} -setup {
  set minDoubleValue [object invoke -create -alias Double MinValue]
  set maxDoubleValue [object invoke -create -alias Double MaxValue]

  set doubleValues [list \
      $minDoubleValue -1.0 0.0 1.0 1721425.5 2451910.5 2456962.0 \
      5373484.49998843 $maxDoubleValue]
} -body {
  set results [list]

  foreach doubleValue $doubleValues {
    if {$doubleValue ni [info objects]} then {
      set doubleValue [object invoke \
          -create -alias Double Parse $doubleValue]
    }

    set code [catch {
      set dateTimeValue [object invoke -create -alias \
          System.Data.SQLite.SQLiteConvert ToDateTime $doubleValue Utc]


      $dateTimeValue ToString [getDateTimeFormat]
    } result]

    if {$code != 0} then {
      regexp -- {---> (.*?)(?:\r|\n)} $result result result
    }

    lappend results [list [$doubleValue ToString] $code $result]
  }

  set results
} -cleanup {

  unset -nocomplain code result results dateTimeValue doubleValue \
      doubleValues maxDoubleValue minDoubleValue
} -constraints {eagle System.Data.SQLite} -result {{-1.79769313486232E+308 0\
{0001-01-01 00:00:00Z}} {-1 0 {0001-01-01 00:00:00Z}} {0 0 {0001-01-01\
00:00:00Z}} {1 0 {0001-01-01 00:00:00Z}} {1721425.5 0 {0001-01-01 00:00:00Z}}\
{2451910.5 0 {2001-01-01 00:00:00Z}} {2456962 0 {2014-10-31 12:00:00Z}}\
{5373484.49998843 0 {9999-12-31 23:59:59Z}} {1.79769313486232E+308 0\
{0001-01-01 00:00:00Z}}}}

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

runSQLiteTestEpilogue
runTestEpilogue