Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ccgus/fmdb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorjam.chenjun <jam.chenjun@gmail.com>2018-05-21 15:02:09 +0300
committerjam.chenjun <jam.chenjun@gmail.com>2018-05-21 15:02:09 +0300
commit06e97b996bc1a4d255650693f74196fa6185917a (patch)
treebed189b31aef8775f6f24332f07cb8f5c64c8d95 /Tests
parentfa03304c6742ff135154a3060455bd68cd6e3ecb (diff)
add unit test case for -[FMDatabase executeStatements:withResultBlock:], SELECT records with blob fields
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FMDatabaseTests.m14
1 files changed, 13 insertions, 1 deletions
diff --git a/Tests/FMDatabaseTests.m b/Tests/FMDatabaseTests.m
index 1f99332..448508e 100644
--- a/Tests/FMDatabaseTests.m
+++ b/Tests/FMDatabaseTests.m
@@ -1151,12 +1151,24 @@
XCTAssertEqual(count, 1, @"expected one record for dictionary %@", dictionary);
return 0;
}];
+
+ XCTAssertTrue(success, @"bulk select");
+
+ // select blob type records
+ [self.db executeUpdate:@"create table bulktest4 (id integer primary key autoincrement, b blob);"];
+ NSData *blobData = [[NSData alloc] initWithContentsOfFile:@"/bin/bash"];
+ [self.db executeUpdate:@"insert into bulktest4 (b) values (?)" values:@[blobData] error:nil];
+ sql = @"select * from bulktest4";
+ success = [self.db executeStatements:sql withResultBlock:^int(NSDictionary * _Nonnull resultsDictionary) {
+ return 0;
+ }];
XCTAssertTrue(success, @"bulk select");
sql = @"drop table bulktest1;"
"drop table bulktest2;"
- "drop table bulktest3;";
+ "drop table bulktest3;"
+ "drop table bulktest4";
success = [self.db executeStatements:sql];