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
diff options
context:
space:
mode:
authorccgus <gus@flyingmeat.com>2014-01-07 22:27:38 +0400
committerccgus <gus@flyingmeat.com>2014-01-07 22:27:38 +0400
commit88ebd477b82705ddabad676d766a94720c917530 (patch)
tree932002123af1751ed43ec3809e3ac3e62a2d46ea
parent72abbca772247e05613316007e64c1e8eee1d19c (diff)
Might help to export the retry timeout interface for the tests! Also, new test to check @imoldmans' patches.
-rw-r--r--Tests/FMDatabaseTests.m21
-rw-r--r--fmdb.xcodeproj/project.pbxproj16
-rw-r--r--src/FMDatabase.h5
3 files changed, 37 insertions, 5 deletions
diff --git a/Tests/FMDatabaseTests.m b/Tests/FMDatabaseTests.m
index f3ef197..9918309 100644
--- a/Tests/FMDatabaseTests.m
+++ b/Tests/FMDatabaseTests.m
@@ -176,7 +176,7 @@
[self.db executeUpdate:@"create table t1 (a integer)"];
[self.db executeUpdate:@"insert into t1 values (?)", [NSNumber numberWithInt:5]];
- [self.db setBusyRetryTimeout:50];
+ [self.db setRetryTimeout:2];
FMDatabase *newDB = [FMDatabase databaseWithPath:self.databasePath];
[newDB open];
@@ -216,6 +216,25 @@
XCTAssertFalse([self.db hadError], @"Shouldn't have any errors");
}
+- (void)testBoolInsert
+{
+ [self.db executeUpdate:@"create table btest (aRowName integer)"];
+ [self.db executeUpdate:@"insert into btest (aRowName) values (?)", [NSNumber numberWithBool:12]];
+
+ XCTAssertFalse([self.db hadError], @"Shouldn't have any errors");
+
+ FMResultSet *rs = [self.db executeQuery:@"select * from btest"];
+ while ([rs next]) {
+
+ XCTAssertTrue([rs boolForColumnIndex:0], @"first column should be true.");
+ XCTAssertTrue([rs intForColumnIndex:0] == 1, @"first column should be equal to 1 - it was %d.", [rs intForColumnIndex:0]);
+ }
+
+ [rs close];
+ XCTAssertFalse([self.db hasOpenResultSets], @"Shouldn't have any open result sets");
+ XCTAssertFalse([self.db hadError], @"Shouldn't have any errors");
+}
+
- (void)testNamedParametersCount
{
XCTAssertTrue([self.db executeUpdate:@"create table namedparamcounttest (a text, b text, c integer, d double)"]);
diff --git a/fmdb.xcodeproj/project.pbxproj b/fmdb.xcodeproj/project.pbxproj
index 813465c..1224969 100644
--- a/fmdb.xcodeproj/project.pbxproj
+++ b/fmdb.xcodeproj/project.pbxproj
@@ -310,7 +310,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0460;
+ LastUpgradeCheck = 0500;
TargetAttributes = {
BF5D041518416BB2008C5AA9 = {
TestTargetID = EE4290EE12B42F870088BD94;
@@ -414,7 +414,6 @@
1DEB927508733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
@@ -434,7 +433,6 @@
1DEB927608733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
@@ -453,8 +451,9 @@
1DEB927908733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -465,22 +464,29 @@
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_PEDANTIC = YES;
GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
1DEB927A08733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
};
name = Release;
@@ -496,6 +502,7 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(DEVELOPER_FRAMEWORKS_DIR)",
@@ -536,6 +543,7 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
diff --git a/src/FMDatabase.h b/src/FMDatabase.h
index c538f58..6151389 100644
--- a/src/FMDatabase.h
+++ b/src/FMDatabase.h
@@ -691,6 +691,11 @@
- (NSError*)lastError;
+// description forthcoming
+- (void)setRetryTimeout:(NSTimeInterval)timeout;
+- (NSTimeInterval)retryTimeout;
+
+
#if SQLITE_VERSION_NUMBER >= 3007000
///------------------