System.Data.SQLite

Check-in [b14c166f11]
Login

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

Overview
Comment:Enhance the R-Tree test from the previous check-in.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b14c166f11c4677d8ddb441a3328984553d6d13c
User & Date: mistachkin 2015-01-15 19:29:02.369
Context
2015-01-16
15:51
Update SQLite core library to the 3.8.8 release. check-in: 0fe2fc38b9 user: mistachkin tags: trunk
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
Changes
Unified Diff Ignore Whitespace Patch
Changes to testce/TestCases.cs.
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
                {
                    // 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;



    }
  }
}







|













<
<



>
|
>


>
>
>
|
>
>
>



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
1233
1234
1235
1236
1237
1238
                {
                    // do nothing.
                }
            }
        }
    }

    internal void 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();
        }



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

            if ((long)cmd.ExecuteScalar() != 1)
                throw new Exception("COUNT(*) without WHERE should return one row");
        }

        using (DbCommand cmd = cnn.CreateCommand())
        {
            cmd.CommandText = "SELECT COUNT(*) FROM TestRTree WHERE minx > 1 AND maxx < 9 AND miny < 3 AND maxy > 7;";

            if ((long)cmd.ExecuteScalar() != 1)
                throw new Exception("COUNT(*) with WHERE should return one row");
        }
    }
  }
}