System.Data.SQLite

Check-in [0cd38620d4]
Login

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

Overview
Comment:Modify unit test infrastructure to support more options for the setupDb and cleanupDb helper procedures, namely skipping garbage collection and file deletion.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0cd38620d45aaad9929865a2b1a5d1a990913e7c
User & Date: mistachkin 2012-07-11 01:29:33.140
Context
2012-07-11
03:37
Update test prologue and epilogue to make sure they unset all variables used prior to using any of them. check-in: 9189c4f757 user: mistachkin tags: trunk
01:32
Initial draft of new stress test. check-in: 96ab455945 user: mistachkin tags: stress
01:29
Modify unit test infrastructure to support more options for the setupDb and cleanupDb helper procedures, namely skipping garbage collection and file deletion. check-in: 0cd38620d4 user: mistachkin tags: trunk
2012-07-04
22:09
Update Eagle in externals to the beta 24 release. check-in: bf0e36e840 user: mistachkin tags: trunk
Changes
Side-by-Side Diff Show Whitespace Changes Patch
Changes to Tests/common.eagle.
591
592
593
594
595
596
597
598

599
600
601
602
603

604

605
606
607
608
609
610
611
591
592
593
594
595
596
597

598
599
600
601
602
603
604

605
606
607
608
609
610
611
612







-
+





+
-
+







      #
      # NOTE: Open the database connection now, placing the opaque handle value
      #       into the variable specified by the caller.
      #
      set db [sql open -type SQLite [subst $connection]]
    }

    proc cleanupDb { fileName {varName db} } {
    proc cleanupDb { fileName {varName db} {collect true} {delete true} } {
      #
      # NOTE: Attempt to force all pending "garbage" objects to be collected,
      #       including SQLite statements and backup objects; this should allow
      #       the underlying database file to be deleted.
      #
      if {$collect && \
      if {[catch {object invoke GC GetTotalMemory true} error]} then {
          [catch {object invoke GC GetTotalMemory true} error]} then {
        tputs $channel [appendArgs \
            "==== WARNING: failed full garbage collection, error: " \
            \n\t $error \n]
      }

      #
      # NOTE: Refer to the specified variable (e.g. "db") in the context of the
638
639
640
641
642
643
644
645

646
647
648
649
650
651
652
639
640
641
642
643
644
645

646
647
648
649
650
651
652
653







-
+







      if {!$isMemory} then {
        set fileName [file join [getDatabaseDirectory] [file tail $fileName]]
      }

      #
      # NOTE: Check if the file still exists.
      #
      if {!$isMemory && [file exists $fileName]} then {
      if {!$isMemory && $delete && [file exists $fileName]} then {
        #
        # NOTE: Skip deleting database files if somebody sets the global
        #       variable to prevent it.
        #
        if {![info exists ::no(cleanupDb)]} then {
          #
          # NOTE: Attempt to delete the test database file now.
675
676
677
678
679
680
681
682

683
684
685
686
687

688

689
690
691
692
693
694
695
676
677
678
679
680
681
682

683
684
685
686
687
688
689

690
691
692
693
694
695
696
697







-
+





+
-
+







        #
        set code 0
      }

      return $code
    }

    proc cleanupFile { fileName {force false} } {
    proc cleanupFile { fileName {collect true} {force false} } {
      #
      # NOTE: Attempt to force all pending "garbage" objects to be collected,
      #       including SQLite statements and backup objects; this should allow
      #       the underlying database file to be deleted.
      #
      if {$collect && \
      if {[catch {object invoke GC GetTotalMemory true} error]} then {
          [catch {object invoke GC GetTotalMemory true} error]} then {
        tputs $channel [appendArgs \
            "==== WARNING: failed full garbage collection, error: " \
            \n\t $error \n]
      }

      #
      # NOTE: Check if the file still exists.