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

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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eb8927b3f3faf216741d1ba7a727612bc96b0829
User & Date: mistachkin 2015-01-15 19:01:14
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
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to testce/TestCases.cs.

   296    296         try { ManagedVirtualTable(cnn); frm.WriteLine("SUCCESS - ManagedVirtualTable"); passed++; }
   297    297         catch (Exception) { frm.WriteLine("FAIL - ManagedVirtualTable"); failed++; }
   298    298   
   299    299         total++;
   300    300         try { MultipleThreadStress(cnn); frm.WriteLine("SUCCESS - MultipleThreadStress"); passed++; }
   301    301         catch (Exception) { frm.WriteLine("FAIL - MultipleThreadStress"); failed++; }
   302    302   
          303  +      total++;
          304  +      try { SimpleRTree(cnn); frm.WriteLine("SUCCESS - SimpleRTree"); passed++; }
          305  +      catch (Exception) { frm.WriteLine("FAIL - SimpleRTree"); failed++; }
          306  +
   303    307         total++;
   304    308         try { DropTable(cnn); frm.WriteLine("SUCCESS - DropTable"); passed++; }
   305    309         catch (Exception) { frm.WriteLine("FAIL - DropTable"); failed++; }
   306    310   
   307    311         frm.WriteLine("\r\nTests Finished.");
   308    312   
   309    313         if (cnn2 != null)
................................................................................
   530    534           cmd.ExecuteNonQuery();
   531    535         }
   532    536       }
   533    537   
   534    538       internal void DropTable(DbConnection cnn)
   535    539       {
   536    540         string[] tables = {
   537         -        "TestCase", "keyinfotest", "datatypetest", "TestThreads"
          541  +        "TestCase", "keyinfotest", "datatypetest", "TestThreads", "TestRTree"
   538    542         };
   539    543         foreach (string table in tables)
   540    544         {
   541    545           using (DbCommand cmd = cnn.CreateCommand())
   542    546           {
   543    547             cmd.CommandText = String.Format("DROP TABLE {0};", table);
   544    548             cmd.ExecuteNonQuery();
................................................................................
  1195   1199                   catch
  1196   1200                   {
  1197   1201                       // do nothing.
  1198   1202                   }
  1199   1203               }
  1200   1204           }
  1201   1205       }
         1206  +
         1207  +    internal long SimpleRTree(DbConnection cnn)
         1208  +    {
         1209  +        using (DbCommand cmd = cnn.CreateCommand())
         1210  +        {
         1211  +            cmd.CommandText = "CREATE VIRTUAL TABLE TestRTree USING RTREE(id, minx, maxx, miny, maxy);";
         1212  +            cmd.ExecuteNonQuery();
         1213  +        }
         1214  +
         1215  +        using (DbCommand cmd = cnn.CreateCommand())
         1216  +        {
         1217  +            cmd.CommandText = "INSERT INTO TestRTree VALUES(1, 2, 8, 2, 8);";
         1218  +            cmd.ExecuteNonQuery();
         1219  +        }
         1220  +
         1221  +        long count;
         1222  +
         1223  +        using (DbCommand cmd = cnn.CreateCommand())
         1224  +        {
         1225  +            cmd.CommandText = "SELECT COUNT(*) FROM TestRTree;";
         1226  +            count = (long)cmd.ExecuteScalar();
         1227  +        }
         1228  +
         1229  +        return count;
         1230  +    }
  1202   1231     }
  1203   1232   }