System.Data.SQLite

Check-in [eb8927b3f3]
Login

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

Overview
Comment:Add test case for R-Tree to the .NET Compact Framework test harness.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eb8927b3f3faf216741d1ba7a727612bc96b0829
User & Date: mistachkin 2015-01-15 19:01:14.421
Context
2015-01-15
19:29
Enhance the R-Tree test from the previous check-in. check-in: b14c166f11 user: mistachkin tags: trunk
19:01
Add test case for R-Tree to the .NET Compact Framework test harness. check-in: eb8927b3f3 user: mistachkin tags: trunk
2015-01-14
21:30
Update SQLite core library to the latest 3.8.8 release candidate. check-in: b1d5152664 user: mistachkin tags: trunk
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to testce/TestCases.cs.
296
297
298
299
300
301
302




303
304
305
306
307
308
309
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313







+
+
+
+







      try { ManagedVirtualTable(cnn); frm.WriteLine("SUCCESS - ManagedVirtualTable"); passed++; }
      catch (Exception) { frm.WriteLine("FAIL - ManagedVirtualTable"); failed++; }

      total++;
      try { MultipleThreadStress(cnn); frm.WriteLine("SUCCESS - MultipleThreadStress"); passed++; }
      catch (Exception) { frm.WriteLine("FAIL - MultipleThreadStress"); failed++; }

      total++;
      try { SimpleRTree(cnn); frm.WriteLine("SUCCESS - SimpleRTree"); passed++; }
      catch (Exception) { frm.WriteLine("FAIL - SimpleRTree"); failed++; }

      total++;
      try { DropTable(cnn); frm.WriteLine("SUCCESS - DropTable"); passed++; }
      catch (Exception) { frm.WriteLine("FAIL - DropTable"); failed++; }

      frm.WriteLine("\r\nTests Finished.");

      if (cnn2 != null)
530
531
532
533
534
535
536
537

538
539
540
541
542
543
544
534
535
536
537
538
539
540

541
542
543
544
545
546
547
548







-
+







        cmd.ExecuteNonQuery();
      }
    }

    internal void DropTable(DbConnection cnn)
    {
      string[] tables = {
        "TestCase", "keyinfotest", "datatypetest", "TestThreads"
        "TestCase", "keyinfotest", "datatypetest", "TestThreads", "TestRTree"
      };
      foreach (string table in tables)
      {
        using (DbCommand cmd = cnn.CreateCommand())
        {
          cmd.CommandText = String.Format("DROP TABLE {0};", table);
          cmd.ExecuteNonQuery();
1195
1196
1197
1198
1199
1200
1201
1202
1203



























1199
1200
1201
1202
1203
1204
1205


1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232







-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
                catch
                {
                    // do nothing.
                }
            }
        }
    }
  }
}

    internal long SimpleRTree(DbConnection cnn)
    {
        using (DbCommand cmd = cnn.CreateCommand())
        {
            cmd.CommandText = "CREATE VIRTUAL TABLE TestRTree USING RTREE(id, minx, maxx, miny, maxy);";
            cmd.ExecuteNonQuery();
        }

        using (DbCommand cmd = cnn.CreateCommand())
        {
            cmd.CommandText = "INSERT INTO TestRTree VALUES(1, 2, 8, 2, 8);";
            cmd.ExecuteNonQuery();
        }

        long count;

        using (DbCommand cmd = cnn.CreateCommand())
        {
            cmd.CommandText = "SELECT COUNT(*) FROM TestRTree;";
            count = (long)cmd.ExecuteScalar();
        }

        return count;
    }
  }
}