From a6f77c9c914254de9e6867a8a69731ef0b62a281 Mon Sep 17 00:00:00 2001 From: August Mueller Date: Tue, 2 Aug 2011 21:52:11 -0700 Subject: [PATCH] Quick little test. --- src/fmdb.m | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/fmdb.m b/src/fmdb.m index 13e19c12..73c155e8 100644 --- a/src/fmdb.m +++ b/src/fmdb.m @@ -872,6 +872,39 @@ int main (int argc, const char * argv[]) { } + { + + [dbPool inDatabase:^(FMDatabase *db) { + [db executeUpdate:@"create table likefoo (foo text)"]; + [db executeUpdate:@"insert into likefoo values ('hi')"]; + [db executeUpdate:@"insert into likefoo values ('hello')"]; + [db executeUpdate:@"insert into likefoo values ('not')"]; + + int count = 0; + FMResultSet *rsl = [db executeQuery:@"select * from likefoo where foo like 'h%'"]; + while ([rsl next]) { + count++; + } + + FMDBQuickCheck(count == 2); + + count = 0; + rsl = [db executeQuery:@"select * from likefoo where foo like ?", @"h%"]; + while ([rsl next]) { + count++; + } + + FMDBQuickCheck(count == 2); + + }]; + + + } + + + + + NSLog(@"That was version %@ of sqlite", [FMDatabase sqliteLibVersion]); [pool release];