diff options
author | jam.chenjun <jam.chenjun@gmail.com> | 2018-05-21 15:02:09 +0300 |
---|---|---|
committer | jam.chenjun <jam.chenjun@gmail.com> | 2018-05-21 15:02:09 +0300 |
commit | 06e97b996bc1a4d255650693f74196fa6185917a (patch) | |
tree | bed189b31aef8775f6f24332f07cb8f5c64c8d95 /Tests | |
parent | fa03304c6742ff135154a3060455bd68cd6e3ecb (diff) |
add unit test case for -[FMDatabase executeStatements:withResultBlock:], SELECT records with blob fields
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FMDatabaseTests.m | 14 |
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]; |