Browse Source

Removed some tests from main.m (since I want to remove them all eventually in favor of the test suite), and fixed some warnings, and updated some logs.

August Mueller 11 năm trước cách đây
mục cha
commit
20878b003b
2 tập tin đã thay đổi với 4 bổ sung42 xóa
  1. 3 3
      src/fmdb/FMDatabase.m
  2. 1 39
      src/sample/main.m

+ 3 - 3
src/fmdb/FMDatabase.m

@@ -233,13 +233,13 @@ - (NSTimeInterval)maxBusyRetryTimeInterval {
 // we'll still implement the method so they don't get suprise crashes
 - (int)busyRetryTimeout {
     NSLog(@"%s:%d", __FUNCTION__, __LINE__);
-    NSLog(@"FMDB: busyRetryTimeout no longer works, please use retryTimeout");
+    NSLog(@"FMDB: busyRetryTimeout no longer works, please use maxBusyRetryTimeInterval");
     return -1;
 }
 
 - (void)setBusyRetryTimeout:(int)i {
     NSLog(@"%s:%d", __FUNCTION__, __LINE__);
-    NSLog(@"FMDB: setBusyRetryTimeout does nothing, please use setRetryTimeout:");
+    NSLog(@"FMDB: setBusyRetryTimeout does nothing, please use setMaxBusyRetryTimeInterval:");
 }
 
 #pragma mark Result set functions
@@ -1102,7 +1102,7 @@ int FMDBExecuteBulkSQLCallback(void *theBlockAsVoid, int columns, char **values,
     
     int (^execCallbackBlock)(NSDictionary *resultsDictionary) = (__bridge int (^)(NSDictionary *__strong))(theBlockAsVoid);
     
-    NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:columns];
+    NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:(NSUInteger)columns];
     
     for (NSInteger i = 0; i < columns; i++) {
         NSString *key = [NSString stringWithUTF8String:names[i]];

+ 1 - 39
src/sample/main.m

@@ -233,44 +233,6 @@ int main (int argc, const char * argv[]) {
     
 #endif
 
-    // -------------------------------------------------------------------------------
-    // executeBulkSQL tests.
-
-    {
-        NSString *sql = @"create table if not exists test1 (id integer primary key autoincrement, x text);"
-                         "create table if not exists test2 (id integer primary key autoincrement, y text);"
-                         "create table if not exists test3 (id integer primary key autoincrement, z text);"
-                         "insert into test1 (x) values ('XXX');"
-                         "insert into test2 (y) values ('YYY');"
-                         "insert into test3 (z) values ('ZZZ');";
-
-        FMDBQuickCheck([db executeBulkSQL:sql]);
-    }
-
-    {
-        NSString *sql = @"select count(*) as count from test1;"
-                         "select count(*) as count from test2;"
-                         "select count(*) as count from test3;";
-
-        FMDBQuickCheck([db executeBulkSQL:sql block:^int(NSDictionary *dictionary) {
-            NSInteger count = [dictionary[@"count"] integerValue];
-            if (count == 0) {
-                NSLog(@"executeBulkSQL: error: was expecting non-zero number of records; dictionary = %@", dictionary);
-            } else {
-                NSLog(@"executeBulkSQL: everything ok: dictionary = %@", dictionary);
-            }
-            return 0;
-        }]);
-    }
-
-    {
-        NSString *sql = @"drop table test1;"
-                         "drop table test2;"
-                         "drop table test3;";
-
-        FMDBQuickCheck([db executeBulkSQL:sql]);
-    }
-
 
     {
         // -------------------------------------------------------------------------------
@@ -383,7 +345,7 @@ int main (int argc, const char * argv[]) {
     
     // test the busy rety timeout schtuff.
     
-    [db setBusyTimeout:5];
+    [db setMaxBusyRetryTimeInterval:5];
     
     FMDatabase *newDb = [FMDatabase databaseWithPath:dbPath];
     [newDb open];