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

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

Overview
Comment:Add backup API test case for the callback returning false.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f49beb5b020289ade6c88f507c85e9829a93ee08
User & Date: mistachkin 2012-03-26 09:45:08
Context
2012-03-26
09:52
When compiled for the .NET Compact Framework, skip catching, logging, and re-throwing exceptions in the BackupDatabase method. check-in: a413c10b32 user: mistachkin tags: trunk
09:45
Add backup API test case for the callback returning false. check-in: f49beb5b02 user: mistachkin tags: trunk
09:18
Make all the dynamic test classes static, when possible. check-in: 3f6ed3b646 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to Tests/backup.eagle.

16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
..
40
41
42
43
44
45
46






47
48
49
50
51
52
53
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

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

set params(pages) [list -1 -1 0 0 1 1 1000 1000]

set params(callbacks) [list null "new SQLiteBackupCallback(BackupCallback)" \

                            null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)"]

set params(results) [list \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 0\$" \
................................................................................
    thrown by the target of an invocation\\. --->\
    System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\
    t1\\r\\n.*?" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 0\$" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 10283\$" \






    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} \\{\\}\$" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} \\{System\\.Data\\.SQLite\\.SQLiteConnection main\
    System\\.Data\\.SQLite\\.SQLiteConnection main 1000 9284 10284 False\
    System\\.Data\\.SQLite\\.SQLiteConnection main\
    System\\.Data\\.SQLite\\.SQLiteConnection main 1000 8284 10284 False\
................................................................................
          {
            results.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} ", source,
              sourceName, destination, destinationName, pages, remainingPages,
              totalPages, retry);

            count++;

            return true;
          }

          /////////////////////////////////////////////////////////////////////

          public static string BackupAndGetData(
            Interpreter interpreter,
            SQLiteConnection source
................................................................................
              source.BackupDatabase(destination, "main", "main", pages,
                ${callback}, 0);

              ReturnCode code;
              Result error = null;

              code = interpreter.SetVariableValue(
                VariableFlags.GlobalOnly, "callbackResults", (pages > 1) ?
                    results.ToString().Trim() : count.ToString(), null,
                ref error);

              if (code != ReturnCode.Ok)
                Utility.Complain(interpreter, code, error);

              using (SQLiteCommand command = new SQLiteCommand(







|


>







 







>
>
>
>
>
>







 







|







 







|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

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

set params(pages) [list -1 -1 0 0 1 1 2 2 1000 1000]

set params(callbacks) [list null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)" \
                            null "new SQLiteBackupCallback(BackupCallback)"]

set params(results) [list \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 0\$" \
................................................................................
    thrown by the target of an invocation\\. --->\
    System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\
    t1\\r\\n.*?" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 0\$" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 10283\$" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} 0\$" \
    "1 \\{System\\.Reflection\\.TargetInvocationException: Exception has been\
    thrown by the target of an invocation\\. --->\
    System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\
    t1\\r\\n.*?" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} \\{\\}\$" \
    "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\
    1048576 1048576 10\\} \\{System\\.Data\\.SQLite\\.SQLiteConnection main\
    System\\.Data\\.SQLite\\.SQLiteConnection main 1000 9284 10284 False\
    System\\.Data\\.SQLite\\.SQLiteConnection main\
    System\\.Data\\.SQLite\\.SQLiteConnection main 1000 8284 10284 False\
................................................................................
          {
            results.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} ", source,
              sourceName, destination, destinationName, pages, remainingPages,
              totalPages, retry);

            count++;

            return (pages != 2);
          }

          /////////////////////////////////////////////////////////////////////

          public static string BackupAndGetData(
            Interpreter interpreter,
            SQLiteConnection source
................................................................................
              source.BackupDatabase(destination, "main", "main", pages,
                ${callback}, 0);

              ReturnCode code;
              Result error = null;

              code = interpreter.SetVariableValue(
                VariableFlags.GlobalOnly, "callbackResults", (pages > 2) ?
                    results.ToString().Trim() : count.ToString(), null,
                ref error);

              if (code != ReturnCode.Ok)
                Utility.Complain(interpreter, code, error);

              using (SQLiteCommand command = new SQLiteCommand(