[sword-svn] r3264 - in trunk/bindings/objc: . LongRunningTests ObjCSword.xcodeproj src test
mdbergmann at crosswire.org
mdbergmann at crosswire.org
Mon Oct 6 07:18:20 MST 2014
Author: mdbergmann
Date: 2014-10-06 07:18:19 -0700 (Mon, 06 Oct 2014)
New Revision: 3264
Added:
trunk/bindings/objc/LongRunningTests/
trunk/bindings/objc/LongRunningTests/Info.plist
trunk/bindings/objc/test/SwordBibleTest.swift
trunk/bindings/objc/test/Tests-Bridging-Header.h
Modified:
trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj
trunk/bindings/objc/src/SwordBible.h
trunk/bindings/objc/src/SwordBible.mm
trunk/bindings/objc/src/SwordBibleBook.h
trunk/bindings/objc/src/SwordBibleBook.mm
trunk/bindings/objc/src/SwordBibleTextEntry.m
trunk/bindings/objc/src/SwordKey.mm
trunk/bindings/objc/src/SwordListKey.mm
trunk/bindings/objc/src/SwordModule.mm
trunk/bindings/objc/src/SwordVerseKey.mm
trunk/bindings/objc/test/SwordListKeyTest.m
trunk/bindings/objc/test/SwordModuleLongRunTest.h
trunk/bindings/objc/test/SwordModuleLongRunTest.mm
trunk/bindings/objc/test/SwordModuleTest.m
trunk/bindings/objc/test/Tests-Info.plist
Log:
some cleanups. more tests. still working on issue with module and chapter introductions.
Added: trunk/bindings/objc/LongRunningTests/Info.plist
===================================================================
--- trunk/bindings/objc/LongRunningTests/Info.plist (rev 0)
+++ trunk/bindings/objc/LongRunningTests/Info.plist 2014-10-06 14:18:19 UTC (rev 3264)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>de.mabe.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
Modified: trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj
===================================================================
--- trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj 2014-10-06 14:18:19 UTC (rev 3264)
@@ -1114,6 +1114,7 @@
A954ACDC13EEA5340094E3FE /* zutil.c in Sources */ = {isa = PBXBuildFile; fileRef = A954A8F813EE98B30094E3FE /* zutil.c */; };
A954ACDD13EEA6780094E3FE /* libsword.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A954ABC313EE9AB00094E3FE /* libsword.dylib */; };
A967FB5616806B16004ED73C /* teixhtml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9E9C5ED16806A2B00ECEB39 /* teixhtml.cpp */; };
+ A968BE4D19DFF832002C9B78 /* SwordBibleTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A968BE4C19DFF832002C9B78 /* SwordBibleTest.swift */; };
A96C2359176AFA3C008D714B /* remotetrans.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A96C2351176AF188008D714B /* remotetrans.cpp */; };
A96C235A176AFA3C008D714B /* osisenum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A96C2353176AF19C008D714B /* osisenum.cpp */; };
A96C235B176AFA3C008D714B /* osisglosses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A96C2354176AF19C008D714B /* osisglosses.cpp */; };
@@ -1331,11 +1332,6 @@
A9A7EEAF14D5D4C300B76B6A /* libsword.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A954ABC313EE9AB00094E3FE /* libsword.dylib */; };
A9A7EEBE14D5D64C00B76B6A /* osis2mod.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A975EDB111C7925C007C1532 /* osis2mod.cpp */; };
A9A7EEBF14D5D65900B76B6A /* libsword.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A954ABC313EE9AB00094E3FE /* libsword.dylib */; settings = {ATTRIBUTES = (Required, ); }; };
- A9BDFA631207F9870067ED5B /* ObjCSword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* ObjCSword.framework */; };
- A9BDFA661207F9870067ED5B /* SwordManagerTest.h in Headers */ = {isa = PBXBuildFile; fileRef = A964658011C663E200640FAC /* SwordManagerTest.h */; };
- A9BDFA671207F9870067ED5B /* SwordModuleTest.h in Headers */ = {isa = PBXBuildFile; fileRef = A918B8E211C6697400024D84 /* SwordModuleTest.h */; };
- A9BDFA7C1207FA2F0067ED5B /* SwordModuleLongRunTest.h in Headers */ = {isa = PBXBuildFile; fileRef = A9BDFA7A1207FA2F0067ED5B /* SwordModuleLongRunTest.h */; };
- A9BDFA7D1207FA2F0067ED5B /* SwordModuleLongRunTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9BDFA7B1207FA2F0067ED5B /* SwordModuleLongRunTest.mm */; };
A9BFB0A713EDF51100032679 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9BFB0A613EDF51100032679 /* Cocoa.framework */; };
A9BFB0BC13EDF5C900032679 /* SwordManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A964658111C663E200640FAC /* SwordManagerTest.m */; };
A9BFB0BD13EDF5C900032679 /* SwordModuleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A918B8E311C6697400024D84 /* SwordModuleTest.m */; };
@@ -1377,6 +1373,8 @@
A9D4360611C4FE97007AFE83 /* SwordModule+Index.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9D4360411C4FE97007AFE83 /* SwordModule+Index.mm */; };
A9D4382311C52947007AFE83 /* locales.d in Resources */ = {isa = PBXBuildFile; fileRef = A9D437CE11C52947007AFE83 /* locales.d */; };
A9D9FA0B13EEE5CF00EA9DEB /* libsword.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A954ABC313EE9AB00094E3FE /* libsword.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ A9EE8A9119E286E500CFFE6A /* ObjCSword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* ObjCSword.framework */; };
+ A9EE8A9719E2877500CFFE6A /* SwordModuleLongRunTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9BDFA7B1207FA2F0067ED5B /* SwordModuleLongRunTest.mm */; };
A9EF1416120595650078A27C /* SwordLocaleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A9EF1414120595650078A27C /* SwordLocaleManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
A9EF1417120595650078A27C /* SwordLocaleManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9EF1415120595650078A27C /* SwordLocaleManager.mm */; };
/* End PBXBuildFile section */
@@ -1403,13 +1401,6 @@
remoteGlobalIDString = A954ABC213EE9AB00094E3FE;
remoteInfo = sword;
};
- A9BDFA5C1207F9870067ED5B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
- remoteInfo = ObjCSword;
- };
A9BFB0BA13EDF5B600032679 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -1634,6 +1625,13 @@
remoteGlobalIDString = A9D271ED14D718F500DA8926;
remoteInfo = xml2gbs;
};
+ A9EE8A9219E286E500CFFE6A /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
+ remoteInfo = ObjCSword;
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -2876,6 +2874,8 @@
A954AC3613EE9FA10094E3FE /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = SDKs/MacOSX10.7.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };
A964658011C663E200640FAC /* SwordManagerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwordManagerTest.h; path = ../test/SwordManagerTest.h; sourceTree = "<group>"; };
A964658111C663E200640FAC /* SwordManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SwordManagerTest.m; path = ../test/SwordManagerTest.m; sourceTree = "<group>"; };
+ A968BE4B19DFF831002C9B78 /* Tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Bridging-Header.h"; sourceTree = "<group>"; };
+ A968BE4C19DFF832002C9B78 /* SwordBibleTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwordBibleTest.swift; sourceTree = "<group>"; };
A96C233E176AF139008D714B /* gzclose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzclose.c; sourceTree = "<group>"; };
A96C2340176AF139008D714B /* gzlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzlib.c; sourceTree = "<group>"; };
A96C2341176AF139008D714B /* gzread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzread.c; sourceTree = "<group>"; };
@@ -3107,7 +3107,6 @@
A9A7EEB414D5D61700B76B6A /* osis2mod */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = osis2mod; sourceTree = BUILT_PRODUCTS_DIR; };
A9B77D4319A3BB3B00F34557 /* liblzma.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblzma.dylib; path = usr/lib/liblzma.dylib; sourceTree = SDKROOT; };
A9B77D4519A3BB8000F34557 /* xzcomprs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xzcomprs.cpp; sourceTree = "<group>"; };
- A9BDFA6B1207F9870067ED5B /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
A9BDFA761207F9F00067ED5B /* SwordListKeyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwordListKeyTest.h; path = ../test/SwordListKeyTest.h; sourceTree = "<group>"; };
A9BDFA771207F9F00067ED5B /* SwordListKeyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SwordListKeyTest.m; path = ../test/SwordListKeyTest.m; sourceTree = "<group>"; };
A9BDFA7A1207FA2F0067ED5B /* SwordModuleLongRunTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwordModuleLongRunTest.h; path = ../test/SwordModuleLongRunTest.h; sourceTree = "<group>"; };
@@ -3139,6 +3138,8 @@
A9D4360411C4FE97007AFE83 /* SwordModule+Index.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "SwordModule+Index.mm"; path = "src/SwordModule+Index.mm"; sourceTree = "<group>"; };
A9D437CE11C52947007AFE83 /* locales.d */ = {isa = PBXFileReference; lastKnownFileType = folder; name = locales.d; path = ../../locales.d; sourceTree = SOURCE_ROOT; };
A9E9C5ED16806A2B00ECEB39 /* teixhtml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teixhtml.cpp; sourceTree = "<group>"; };
+ A9EE8A8B19E286E500CFFE6A /* LongRunningTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LongRunningTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ A9EE8A8E19E286E500CFFE6A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A9EF1414120595650078A27C /* SwordLocaleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwordLocaleManager.h; path = src/SwordLocaleManager.h; sourceTree = "<group>"; };
A9EF1415120595650078A27C /* SwordLocaleManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SwordLocaleManager.mm; path = src/SwordLocaleManager.mm; sourceTree = "<group>"; };
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
@@ -3181,14 +3182,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- A9BDFA611207F9870067ED5B /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- A9BDFA631207F9870067ED5B /* ObjCSword.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
A9BFB09E13EDF51000032679 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -3310,6 +3303,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ A9EE8A8819E286E500CFFE6A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A9EE8A9119E286E500CFFE6A /* ObjCSword.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -3319,7 +3320,6 @@
8DC2EF5B0486A6940098B216 /* ObjCSword.framework */,
A975EED911C792B9007C1532 /* mod2osis */,
A9921A1911FD9CA8002DAA72 /* libSword.dylib */,
- A9BDFA6B1207F9870067ED5B /* Tests.octest */,
A9BFB0A213EDF51000032679 /* Tests.xctest */,
A954ABC313EE9AB00094E3FE /* libsword.dylib */,
A9A7EEB414D5D61700B76B6A /* osis2mod */,
@@ -3337,6 +3337,7 @@
A9D271DD14D718C800DA8926 /* vs2osisref */,
A9D271EA14D718DF00DA8926 /* vs2osisreftxt */,
A9D271F714D718F500DA8926 /* xml2gbs */,
+ A9EE8A8B19E286E500CFFE6A /* LongRunningTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -3352,6 +3353,7 @@
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
A9BFB0AC13EDF51100032679 /* Tests */,
+ A9EE8A8C19E286E500CFFE6A /* LongRunningTests */,
A9BFB0A313EDF51000032679 /* Frameworks */,
034768DFFF38A50411DB9C8B /* Products */,
);
@@ -3380,12 +3382,12 @@
08FB77AEFE84172EC02AAC07 /* SwordWrapper */ = {
isa = PBXGroup;
children = (
- A929619616B1BA240094E5BE /* SwordBibleTextEntry.m */,
A929619716B1BA240094E5BE /* SwordKey.h */,
A929619816B1BA240094E5BE /* SwordKey.mm */,
A929619916B1BA240094E5BE /* SwordListKey.h */,
A929619A16B1BA240094E5BE /* SwordListKey.mm */,
A929619B16B1BA240094E5BE /* SwordVerseKey.h */,
+ A94EAC06117B28920018B06F /* SwordVerseKey.mm */,
A9EF1414120595650078A27C /* SwordLocaleManager.h */,
A9EF1415120595650078A27C /* SwordLocaleManager.mm */,
A94EABF9117B28920018B06F /* SwordManager.h */,
@@ -3411,7 +3413,7 @@
A94EABE7117B28920018B06F /* SwordBibleChapter.h */,
A94EABE8117B28920018B06F /* SwordBibleChapter.m */,
A94EABE9117B28920018B06F /* SwordBibleTextEntry.h */,
- A94EAC06117B28920018B06F /* SwordVerseKey.mm */,
+ A929619616B1BA240094E5BE /* SwordBibleTextEntry.m */,
A94EAC09117B28920018B06F /* VerseEnumerator.h */,
A94EAC0A117B28920018B06F /* VerseEnumerator.mm */,
A94EABF1117B28920018B06F /* SwordInstallSource.h */,
@@ -5322,15 +5324,33 @@
A964658111C663E200640FAC /* SwordManagerTest.m */,
A918B8E211C6697400024D84 /* SwordModuleTest.h */,
A918B8E311C6697400024D84 /* SwordModuleTest.m */,
- A9BDFA7A1207FA2F0067ED5B /* SwordModuleLongRunTest.h */,
- A9BDFA7B1207FA2F0067ED5B /* SwordModuleLongRunTest.mm */,
A9BDFA761207F9F00067ED5B /* SwordListKeyTest.h */,
A9BDFA771207F9F00067ED5B /* SwordListKeyTest.m */,
+ A968BE4C19DFF832002C9B78 /* SwordBibleTest.swift */,
+ A968BE4B19DFF831002C9B78 /* Tests-Bridging-Header.h */,
);
name = Tests;
path = test;
sourceTree = "<group>";
};
+ A9EE8A8C19E286E500CFFE6A /* LongRunningTests */ = {
+ isa = PBXGroup;
+ children = (
+ A9BDFA7A1207FA2F0067ED5B /* SwordModuleLongRunTest.h */,
+ A9BDFA7B1207FA2F0067ED5B /* SwordModuleLongRunTest.mm */,
+ A9EE8A8D19E286E500CFFE6A /* Supporting Files */,
+ );
+ path = LongRunningTests;
+ sourceTree = "<group>";
+ };
+ A9EE8A8D19E286E500CFFE6A /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ A9EE8A8E19E286E500CFFE6A /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -5884,16 +5904,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- A9BDFA651207F9870067ED5B /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- A9BDFA661207F9870067ED5B /* SwordManagerTest.h in Headers */,
- A9BDFA671207F9870067ED5B /* SwordModuleTest.h in Headers */,
- A9BDFA7C1207FA2F0067ED5B /* SwordModuleLongRunTest.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
@@ -5969,26 +5979,6 @@
productReference = A9A7EEB414D5D61700B76B6A /* osis2mod */;
productType = "com.apple.product-type.tool";
};
- A9BDFA5A1207F9870067ED5B /* LongRunningTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = A9BDFA681207F9870067ED5B /* Build configuration list for PBXNativeTarget "LongRunningTests" */;
- buildPhases = (
- A9BDFA5D1207F9870067ED5B /* Resources */,
- A9BDFA5E1207F9870067ED5B /* Sources */,
- A9BDFA611207F9870067ED5B /* Frameworks */,
- A9BDFA641207F9870067ED5B /* ShellScript */,
- A9BDFA651207F9870067ED5B /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- A9BDFA5B1207F9870067ED5B /* PBXTargetDependency */,
- );
- name = LongRunningTests;
- productName = Tests;
- productReference = A9BDFA6B1207F9870067ED5B /* Tests.octest */;
- productType = "com.apple.product-type.bundle.ocunit-test";
- };
A9BFB0A113EDF51000032679 /* Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = A9BFB0B713EDF51100032679 /* Build configuration list for PBXNativeTarget "Tests" */;
@@ -6246,6 +6236,24 @@
productReference = A9D271F714D718F500DA8926 /* xml2gbs */;
productType = "com.apple.product-type.tool";
};
+ A9EE8A8A19E286E500CFFE6A /* LongRunningTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = A9EE8A9419E286E500CFFE6A /* Build configuration list for PBXNativeTarget "LongRunningTests" */;
+ buildPhases = (
+ A9EE8A8719E286E500CFFE6A /* Sources */,
+ A9EE8A8819E286E500CFFE6A /* Frameworks */,
+ A9EE8A8919E286E500CFFE6A /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ A9EE8A9319E286E500CFFE6A /* PBXTargetDependency */,
+ );
+ name = LongRunningTests;
+ productName = LongRunningTests;
+ productReference = A9EE8A8B19E286E500CFFE6A /* LongRunningTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -6254,6 +6262,11 @@
attributes = {
LastTestingUpgradeCheck = 0610;
LastUpgradeCheck = 0610;
+ TargetAttributes = {
+ A9EE8A8A19E286E500CFFE6A = {
+ CreatedOnToolsVersion = 6.1;
+ };
+ };
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ObjCSword" */;
compatibilityVersion = "Xcode 3.2";
@@ -6273,8 +6286,8 @@
projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* ObjCSword */,
- A9BDFA5A1207F9870067ED5B /* LongRunningTests */,
A9BFB0A113EDF51000032679 /* Tests */,
+ A9EE8A8A19E286E500CFFE6A /* LongRunningTests */,
A954ABC213EE9AB00094E3FE /* sword */,
A9D2714414D717D800DA8926 /* imp2gbs */,
A9D2715114D717FD00DA8926 /* imp2ld */,
@@ -6308,14 +6321,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- A9BDFA5D1207F9870067ED5B /* Resources */ = {
+ A9BFB09F13EDF51000032679 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- A9BFB09F13EDF51000032679 /* Resources */ = {
+ A9EE8A8919E286E500CFFE6A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -6325,19 +6338,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- A9BDFA641207F9870067ED5B /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
- };
A9BFB0A013EDF51000032679 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -7138,18 +7138,11 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- A9BDFA5E1207F9870067ED5B /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- A9BDFA7D1207FA2F0067ED5B /* SwordModuleLongRunTest.mm in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
A9BFB09D13EDF51000032679 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ A968BE4D19DFF832002C9B78 /* SwordBibleTest.swift in Sources */,
A9BFB0BC13EDF5C900032679 /* SwordManagerTest.m in Sources */,
A9BFB0BD13EDF5C900032679 /* SwordModuleTest.m in Sources */,
A9BFB0BE13EDF5C900032679 /* SwordListKeyTest.m in Sources */,
@@ -7268,6 +7261,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ A9EE8A8719E286E500CFFE6A /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A9EE8A9719E2877500CFFE6A /* SwordModuleLongRunTest.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@@ -7286,11 +7287,6 @@
target = A954ABC213EE9AB00094E3FE /* sword */;
targetProxy = A9A7EEC014D5D66400B76B6A /* PBXContainerItemProxy */;
};
- A9BDFA5B1207F9870067ED5B /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8DC2EF4F0486A6940098B216 /* ObjCSword */;
- targetProxy = A9BDFA5C1207F9870067ED5B /* PBXContainerItemProxy */;
- };
A9BFB0BB13EDF5B600032679 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DC2EF4F0486A6940098B216 /* ObjCSword */;
@@ -7451,6 +7447,11 @@
target = A9D271ED14D718F500DA8926 /* xml2gbs */;
targetProxy = A9D2721E14D7194E00DA8926 /* PBXContainerItemProxy */;
};
+ A9EE8A9319E286E500CFFE6A /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 8DC2EF4F0486A6940098B216 /* ObjCSword */;
+ targetProxy = A9EE8A9219E286E500CFFE6A /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -7830,83 +7831,11 @@
};
name = Release;
};
- A9BDFA691207F9870067ED5B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ENABLE_OBJC_ARC = YES;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = NO;
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_ENABLE_OBJC_GC = unsupported;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h";
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- /Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
- "$(PROJECT_DIR)/../../include",
- );
- INFOPLIST_FILE = "test/Tests-Info.plist";
- INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
- LIBRARY_SEARCH_PATHS = "$(inherited)";
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = (
- "-framework",
- Cocoa,
- "-framework",
- SenTestingKit,
- );
- PRODUCT_NAME = Tests;
- SDKROOT = macosx;
- VALID_ARCHS = x86_64;
- WRAPPER_EXTENSION = octest;
- };
- name = Debug;
- };
- A9BDFA6A1207F9870067ED5B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ENABLE_OBJC_ARC = YES;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_ENABLE_OBJC_GC = unsupported;
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h";
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- /Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
- "$(PROJECT_DIR)/../../include",
- );
- INFOPLIST_FILE = "test/Tests-Info.plist";
- INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
- LIBRARY_SEARCH_PATHS = "$(inherited)";
- OTHER_LDFLAGS = (
- "-framework",
- Cocoa,
- "-framework",
- SenTestingKit,
- );
- PRODUCT_NAME = Tests;
- SDKROOT = macosx;
- VALID_ARCHS = x86_64;
- WRAPPER_EXTENSION = octest;
- ZERO_LINK = NO;
- };
- name = Release;
- };
A9BFB0B813EDF51100032679 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
@@ -7929,9 +7858,12 @@
/Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
INFOPLIST_FILE = "test/Tests-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.7;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
+ SWIFT_OBJC_BRIDGING_HEADER = "test/Tests-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VALID_ARCHS = x86_64;
};
name = Debug;
@@ -7940,6 +7872,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
@@ -7957,9 +7890,11 @@
/Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
INFOPLIST_FILE = "test/Tests-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.7;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
+ SWIFT_OBJC_BRIDGING_HEADER = "test/Tests-Bridging-Header.h";
VALID_ARCHS = x86_64;
};
name = Release;
@@ -9053,6 +8988,100 @@
};
name = Release;
};
+ A9EE8A9519E286E500CFFE6A /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "";
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "$(PROJECT_DIR)/../../include",
+ );
+ INFOPLIST_FILE = LongRunningTests/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ A9EE8A9619E286E500CFFE6A /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "";
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ /Users/mbergmann/Development/Apps/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
+ "$(PROJECT_DIR)/../../include",
+ );
+ INFOPLIST_FILE = LongRunningTests/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -9101,15 +9130,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- A9BDFA681207F9870067ED5B /* Build configuration list for PBXNativeTarget "LongRunningTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- A9BDFA691207F9870067ED5B /* Debug */,
- A9BDFA6A1207F9870067ED5B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
A9BFB0B713EDF51100032679 /* Build configuration list for PBXNativeTarget "Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -9254,6 +9274,14 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ A9EE8A9419E286E500CFFE6A /* Build configuration list for PBXNativeTarget "LongRunningTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ A9EE8A9519E286E500CFFE6A /* Debug */,
+ A9EE8A9619E286E500CFFE6A /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
Modified: trunk/bindings/objc/src/SwordBible.h
===================================================================
--- trunk/bindings/objc/src/SwordBible.h 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordBible.h 2014-10-06 14:18:19 UTC (rev 3264)
@@ -47,11 +47,12 @@
- (NSArray *)bookList;
- (NSString *)bookIntroductionFor:(SwordBibleBook *)aBook;
-- (NSString *)chapterIntroductionFor:(SwordBibleBook *)aBook chapter:(int)chapter;
+- (NSString *)chapterIntroductionIn:(SwordBibleBook *)aBook forChapter:(int)chapter;
- (NSString *)moduleIntroduction;
// some numbers
-- (SwordBibleBook *)bookForLocalizedName:(NSString *)bookName;
+- (SwordBibleBook *)bookWithNamePrefix:(NSString *)aPrefix;
+- (SwordBibleBook *)bookForName:(NSString *)bookName;
- (int)chaptersForBookName:(NSString *)bookName;
- (int)versesForChapter:(int)chapter bookName:(NSString *)bookName;
- (int)versesForBible;
Modified: trunk/bindings/objc/src/SwordBible.mm
===================================================================
--- trunk/bindings/objc/src/SwordBible.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordBible.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -78,14 +78,14 @@
//if abbr contains : or . then we are a verse so return a chapter
if([abbr rangeOfString:@":"].location != NSNotFound || [abbr rangeOfString:@"."].location != NSNotFound) {
- return [firstBits objectAtIndex:0];
+ return firstBits[0];
}
//otherwise return a book
firstBits = [first componentsSeparatedByString:@" "];
if([firstBits count] > 0) {
- return [firstBits objectAtIndex:0];
+ return firstBits[0];
}
return abbr;
@@ -124,8 +124,6 @@
#pragma mark - Bible information
- (void)buildBookList {
- [moduleLock lock];
-
sword::VersificationMgr *vmgr = sword::VersificationMgr::getSystemVersificationMgr();
const sword::VersificationMgr::System *system = vmgr->getVersificationSystem([[self versification] UTF8String]);
@@ -138,11 +136,9 @@
[bb setNumber:i+1];
NSString *bookName = [bb name];
- [buf setObject:bb forKey:bookName];
+ buf[bookName] = bb;
}
self.books = buf;
-
- [moduleLock unlock];
}
- (BOOL)containsBookNumber:(int)aBookNum {
@@ -180,7 +176,7 @@
int chapter = key->getChapterMax();
int verse = key->getVerseMax();
- SwordBibleBook *bb = [[self books] objectForKey:bookName];
+ SwordBibleBook *bb = [self books][bookName];
if(bb) {
if(chapter > 0 && chapter < [bb numberOfChapters]) {
if(verse > 0 && verse < [bb numberOfVersesForChapter:chapter]) {
@@ -208,32 +204,20 @@
}
- (int)chaptersForBookName:(NSString *)bookName {
- [moduleLock lock];
-
- int maxChapters;
- sword::VerseKey *key = (sword::VerseKey *)swModule->createKey();
- (*key) = [bookName UTF8String];
- maxChapters = key->getChapterMax();
- delete key;
-
- [moduleLock unlock];
-
- return maxChapters;
+ SwordBibleBook *book = [self bookForName:bookName];
+ if(book != nil) {
+ return [book numberOfChapters];
+ }
+ return -1;
}
-
- (int)versesForChapter:(int)chapter bookName:(NSString *)bookName {
int ret = -1;
- [moduleLock lock];
-
- SwordBibleBook *bb = [[self books] objectForKey:bookName];
+ SwordBibleBook *bb = [self books][bookName];
if(bb) {
ret = [bb numberOfVersesForChapter:chapter];
}
-
- [moduleLock unlock];
-
return ret;
}
@@ -252,74 +236,90 @@
return ret;
}
-- (SwordBibleBook *)bookForLocalizedName:(NSString *)bookName {
+- (SwordBibleBook *)bookForName:(NSString *)bookName {
for(SwordBibleBook *book in [[self books] allValues]) {
- if([[book localizedName] isEqualToString:bookName]) {
+ if([[book localizedName] isEqualToString:bookName] || [[book name] isEqualToString:bookName]) {
return book;
}
}
return nil;
}
+- (SwordBibleBook *)bookWithNamePrefix:(NSString *)aPrefix {
+ for(SwordBibleBook *book in [[self books] allValues]) {
+ if([[book localizedName] hasPrefix:aPrefix] || [[book name] hasPrefix:aPrefix]) {
+ return book;
+ }
+ }
+ return nil;
+}
+
- (NSString *)moduleIntroduction {
NSString *ret;
+ [moduleLock lock];
+
// save key
SwordVerseKey *save = (SwordVerseKey *)[self getKeyCopy];
SwordVerseKey *key = [SwordVerseKey verseKeyWithVersification:[self versification]];
[key setHeadings:YES];
- [key setPosition:0];
+ [key setTestament:0];
[self setSwordKey:key];
ret = [self renderedText];
// restore old key
[self setSwordKey:save];
+ [moduleLock unlock];
+
return ret;
}
- (NSString *)bookIntroductionFor:(SwordBibleBook *)aBook {
NSString *ret;
+ [moduleLock lock];
+
// save key
SwordVerseKey *save = (SwordVerseKey *)[self getKeyCopy];
SwordVerseKey *key = [SwordVerseKey verseKeyWithVersification:[self versification]];
[key setHeadings:YES];
- [key setAutoNormalize:NO];
- [key setTestament:[aBook testament]];
- [key setBook:[aBook numberInTestament]];
- [key setChapter:0];
- [key setVerse:0];
+ [key setTestament:(char) [aBook testament]];
+ [key setBook:(char) [aBook numberInTestament]];
[self setSwordKey:key];
ret = [self renderedText];
// restore old key
[self setSwordKey:save];
+ [moduleLock unlock];
+
return ret;
}
-- (NSString *)chapterIntroductionFor:(SwordBibleBook *)aBook chapter:(int)chapter {
+- (NSString *)chapterIntroductionIn:(SwordBibleBook *)aBook forChapter:(int)chapter {
NSString *ret;
-
+
+ [moduleLock lock];
+
// save key
SwordVerseKey *save = (SwordVerseKey *)[self getKeyCopy];
SwordVerseKey *key = [SwordVerseKey verseKeyWithVersification:[self versification]];
[key setHeadings:YES];
- [key setAutoNormalize:NO];
- [key setTestament:[aBook testament]];
- [key setBook:[aBook numberInTestament]];
+ [key setTestament:(char) [aBook testament]];
+ [key setBook:(char) [aBook numberInTestament]];
[key setChapter:chapter];
- [key setVerse:0];
[self setSwordKey:key];
ret = [self renderedText];
// restore old key
[self setSwordKey:save];
+ [moduleLock unlock];
+
return ret;
}
@@ -357,18 +357,18 @@
}
- (NSString *)versification {
- NSString *versification = [configEntries objectForKey:SWMOD_CONFENTRY_VERSIFICATION];
+ NSString *versification = configEntries[SWMOD_CONFENTRY_VERSIFICATION];
if(versification == nil) {
versification = [self configFileEntryForConfigKey:SWMOD_CONFENTRY_VERSIFICATION];
if(versification != nil) {
- [configEntries setObject:versification forKey:SWMOD_CONFENTRY_VERSIFICATION];
+ configEntries[SWMOD_CONFENTRY_VERSIFICATION] = versification;
}
}
// if still nil, use KJV versification
if(versification == nil) {
versification = @"KJV";
- [configEntries setObject:versification forKey:SWMOD_CONFENTRY_VERSIFICATION];
+ configEntries[SWMOD_CONFENTRY_VERSIFICATION] = versification;
}
return versification;
Modified: trunk/bindings/objc/src/SwordBibleBook.h
===================================================================
--- trunk/bindings/objc/src/SwordBibleBook.h 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordBibleBook.h 2014-10-06 14:18:19 UTC (rev 3264)
@@ -8,6 +8,8 @@
#import <Foundation/Foundation.h>
+ at class SwordBibleChapter;
+
#ifdef __cplusplus
#include <versificationmgr.h>
#include <versekey.h>
@@ -21,14 +23,14 @@
NSString *localizedName;
int number;
- char numberInTestament;
- char testament;
+ int numberInTestament;
+ int testament;
NSArray *chapters;
}
@property (readwrite) int number;
- at property (readwrite) char numberInTestament;
- at property (readwrite) char testament;
+ at property (readwrite) int numberInTestament;
+ at property (readwrite) int testament;
@property (strong, readwrite) NSString *localizedName;
@property (strong, readwrite) NSArray *chapters;
Modified: trunk/bindings/objc/src/SwordBibleBook.mm
===================================================================
--- trunk/bindings/objc/src/SwordBibleBook.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordBibleBook.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -37,8 +37,8 @@
swBook = aBook;
sword::VerseKey vk = sword::VerseKey(aBook->getOSISName());
- [self setTestament:vk.getTestamentMax()];
- [self setNumberInTestament:vk.getBookMax()];
+ [self setTestament:vk.getTestament()];
+ [self setNumberInTestament:vk.getBook()];
// get system localeMgr to be able to translate the english bookName
sword::LocaleMgr *lmgr = sword::LocaleMgr::getSystemLocaleMgr();
@@ -60,7 +60,7 @@
- (void)dealloc {
[self setChapters:nil];
-
+ [self setLocalizedName:nil];
}
- (NSString *)name {
@@ -108,7 +108,7 @@
/** we implement this for sorting */
- (NSComparisonResult)compare:(SwordBibleBook *)b {
- return [[NSNumber numberWithInt:number] compare:[NSNumber numberWithInt:[b number]]];
+ return [@(number) compare:@([b number])];
}
@end
Modified: trunk/bindings/objc/src/SwordBibleTextEntry.m
===================================================================
--- trunk/bindings/objc/src/SwordBibleTextEntry.m 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordBibleTextEntry.m 2014-10-06 14:18:19 UTC (rev 3264)
@@ -21,6 +21,7 @@
if(self) {
self.key = aKey;
self.text = aText;
+ self.preVerseHeading = @"";
}
return self;
}
Modified: trunk/bindings/objc/src/SwordKey.mm
===================================================================
--- trunk/bindings/objc/src/SwordKey.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordKey.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -41,10 +41,11 @@
if(copy) {
if(aSk) {
sk = aSk->clone();
- created = YES;
+ created = YES;
} else {
created = NO;
}
+ [self setPersist:YES];
} else {
sk = aSk;
created = NO;
Modified: trunk/bindings/objc/src/SwordListKey.mm
===================================================================
--- trunk/bindings/objc/src/SwordListKey.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordListKey.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -61,20 +61,15 @@
return (SwordListKey *) [super initWithSWKey:lk];
}
-
-
- (NSInteger)numberOfVerses {
NSInteger ret = 0;
-
if(sk) {
for(*sk = sword::TOP; !sk->popError(); *sk++) ret++;
}
-
return ret;
}
- (void)parse {
-
}
- (void)parseWithHeaders {
Modified: trunk/bindings/objc/src/SwordModule.mm
===================================================================
--- trunk/bindings/objc/src/SwordModule.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordModule.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -701,7 +701,7 @@
SwordModuleTextEntry *entry = [self textEntryForKey:[SwordKey swordKeyWithRef:aReference]
textType:textType];
if(entry) {
- ret = [NSArray arrayWithObject:entry];
+ ret = @[entry];
}
return ret;
Modified: trunk/bindings/objc/src/SwordVerseKey.mm
===================================================================
--- trunk/bindings/objc/src/SwordVerseKey.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/src/SwordVerseKey.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -64,14 +64,15 @@
self = [super initWithSWKey:vk];
if(self) {
created = YES;
+ [self setPersist:YES];
if(scheme) {
[self setVersification:scheme];
}
if(aRef) {
[self setKeyText:aRef];
- }
- }
+ }
+ }
return self;
}
Added: trunk/bindings/objc/test/SwordBibleTest.swift
===================================================================
--- trunk/bindings/objc/test/SwordBibleTest.swift (rev 0)
+++ trunk/bindings/objc/test/SwordBibleTest.swift 2014-10-06 14:18:19 UTC (rev 3264)
@@ -0,0 +1,28 @@
+//
+// SwordBibleTest.swift
+// ObjCSword
+//
+// Created by Manfred Bergmann on 04.10.14.
+//
+//
+
+import Foundation
+import XCTest
+
+class SwordBibleTest: XCTestCase {
+
+ var mgr: SwordManager?
+
+ override func setUp() {
+ super.setUp()
+
+ Configuration.configWithImpl(OSXConfiguration())
+ FilterProviderFactory().initWithImpl(DefaultFilterProvider())
+ mgr = SwordManager(path: Configuration.config().defaultModulePath())
+ }
+
+ func testGetBible() {
+ let bibleMod = mgr?.moduleWithName("GerNeUe")
+ XCTAssertNotNil(bibleMod);
+ }
+}
Modified: trunk/bindings/objc/test/SwordListKeyTest.m
===================================================================
--- trunk/bindings/objc/test/SwordListKeyTest.m 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/test/SwordListKeyTest.m 2014-10-06 14:18:19 UTC (rev 3264)
@@ -12,21 +12,21 @@
@implementation SwordListKeyTest
- (void)testContainsKey {
- SwordListKey *lk = [SwordListKey listKeyWithRef:@"Gen 1:1-5"];
+ SwordListKey *lk = [SwordListKey listKeyWithRef:@"Gen 1:1-5" v11n:@"KJV"];
SwordVerseKey *vk = [SwordVerseKey verseKeyWithRef:@"Gen 1:3"];
XCTAssertTrue([lk containsKey:vk], @"");
}
/*
- (void)testNumberOfVerses {
- SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20"];
- STAssertNotNil(lk, @"");
- STAssertTrue(([lk numberOfVerses] == 19), @"");
+ SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20" v11n:@"KJV"];
+ XCTAssertNotNil(lk, @"");
+ XCTAssertTrue(([lk numberOfVerses] == 19), @"");
}
*/
- (void)testVerseEnumeratorAllObjects {
- SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20"];
+ SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20" v11n:@"KJV"];
XCTAssertNotNil(lk, @"");
VerseEnumerator *ve = [lk verseEnumerator];
@@ -36,7 +36,7 @@
}
- (void)testVerseEnumeratorNextObject {
- SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20"];
+ SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen 1:2-20" v11n:@"KJV"];
XCTAssertNotNil(lk, @"");
VerseEnumerator *ve = [lk verseEnumerator];
Modified: trunk/bindings/objc/test/SwordModuleLongRunTest.h
===================================================================
--- trunk/bindings/objc/test/SwordModuleLongRunTest.h 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/test/SwordModuleLongRunTest.h 2014-10-06 14:18:19 UTC (rev 3264)
@@ -6,11 +6,11 @@
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
-#import <SenTestingKit/SenTestingKit.h>
+#import <XCTest/XCTest.h>
@class SwordModule;
- at interface SwordModuleTest : SenTestCase {
+ at interface SwordModuleLongRunTest : XCTestCase {
SwordModule *mod;
}
Modified: trunk/bindings/objc/test/SwordModuleLongRunTest.mm
===================================================================
--- trunk/bindings/objc/test/SwordModuleLongRunTest.mm 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/test/SwordModuleLongRunTest.mm 2014-10-06 14:18:19 UTC (rev 3264)
@@ -6,33 +6,20 @@
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
-#import "SwordModuleTest.h"
-#ifdef TARGET_IPHONE_SIMULATOR
-#import "SwordManager.h"
-#import "Configuration.h"
-#import "iOSConfiguration.h"
-#import "SwordModule.h"
-#import "SwordBibleTextEntry.h"
-#import "VerseEnumerator.h"
-#import "SwordListKey.h"
-#else
#import "ObjCSword/ObjCSword.h"
-#endif
+#import "SwordModuleLongRunTest.h"
+#import "SwordModule+Index.h"
- at implementation SwordModuleTest
+ at implementation SwordModuleLongRunTest
- (void)setUp {
-#ifdef TARGET_IPHONE_SIMULATOR
- [[Configuration config] setClass:[iOSConfiguration class]];
-#else
- [[Configuration config] setClass:[OSXConfiguration class]];
-#endif
- mod = [[SwordManager defaultManager] moduleWithName:@"GerNeUe"];
+ [Configuration configWithImpl:[[OSXConfiguration alloc] init]];
+ mod = [[SwordManager defaultManager] moduleWithName:@"GerNeUe"];
}
- (void)testCreateSearchIndex {
SwordModule *sm = [[SwordManager defaultManager] moduleWithName:@"GerSch"];
- STAssertNotNil(sm, @"Module is nil");
+ XCTAssertNotNil(sm, @"Module is nil");
NSLog(@"creating clucene search index...");
[sm createSearchIndex];
@@ -77,7 +64,7 @@
[com incKeyPosition];
count++;
}
- STAssertTrue((count == 1), @"");
+ XCTAssertTrue((count == 1), @"");
}
- (void)testCommentarySkipLinksNoPersist {
@@ -97,7 +84,7 @@
[lk increment];
count++;
}
- STAssertTrue((count == 1), @"");
+ XCTAssertTrue((count == 1), @"");
}
@end
Modified: trunk/bindings/objc/test/SwordModuleTest.m
===================================================================
--- trunk/bindings/objc/test/SwordModuleTest.m 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/test/SwordModuleTest.m 2014-10-06 14:18:19 UTC (rev 3264)
@@ -6,8 +6,8 @@
// Copyright 2010 Software by MABE. All rights reserved.
//
+#import "SwordModuleTest.h"
#import <ObjCSword/ObjCSword.h>
-#import "SwordModuleTest.h"
@class SwordModule, SwordManager;
@@ -29,6 +29,57 @@
mod = [mgr moduleWithName:@"GerNeUe"];
}
+
+- (void)testModuleIntroduction {
+ SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
+
+ NSString *modIntro = [bible moduleIntroduction];
+ NSLog(@"mod intro: %@", modIntro);
+ XCTAssertNotNil(modIntro);
+ XCTAssertEqual(@"Im Anfang schuf Gott Himmel und Erde.", modIntro);
+}
+
+- (void)testFirstBookATIntro {
+ SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
+
+ SwordBibleBook *book = [bible bookList][0];
+ NSString *intro = [bible bookIntroductionFor:book];
+ NSLog(@"testament: '%i', book '%@' intro: %@", [book testament], [book name], intro);
+ XCTAssertNotNil(intro);
+ XCTAssertTrue([intro hasPrefix:@" <!P><br />Das erste Buch der Bibel wird auch Genesis"]);
+}
+
+- (void)testFirstBookNTIntro {
+ SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
+
+ SwordBibleBook *book = [bible bookWithNamePrefix:@"Mat"];
+ NSString *intro = [bible bookIntroductionFor:book];
+ NSLog(@"testament: '%i', book '%@' intro: %@", [book testament], [book name], intro);
+ XCTAssertNotNil(intro);
+ XCTAssertTrue([intro hasPrefix:@" <!P><br />Um die Zeit der Apostelversammlung herum"]);
+}
+
+- (void)testFirstChapterIntroInGen {
+ SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
+
+ SwordBibleBook *book = [bible bookWithNamePrefix:@"Gen"];
+ NSString *intro = [bible chapterIntroductionIn:book forChapter:1];
+ NSLog(@"testament: '%i', book '%@', intro: %@", [book testament], [book name], intro);
+ XCTAssertNotNil(intro);
+ XCTAssertTrue([intro hasPrefix:@" <!P><br />Um die Zeit der Apostelversammlung herum"]);
+}
+
+- (void)testPreverseHeading {
+ SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
+
+ [mgr setGlobalOption:SW_OPTION_HEADINGS value:SW_ON];
+ SwordBibleTextEntry *text = (SwordBibleTextEntry *) [bible textEntryForKeyString:@"Numbers 1:47" textType:TextTypeRendered];
+ NSLog(@"Preverse text: %@", [text preVerseHeading]);
+ XCTAssertTrue([[text preVerseHeading] length] > 0);
+ XCTAssertTrue([[text preVerseHeading] isEqualToString:@"<title>Die Sonderstellung der Leviten</title>"]);
+ [mgr setGlobalOption:SW_OPTION_HEADINGS value:SW_OFF];
+}
+
- (void)testLoopRenderedVerses {
SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerSch"];
XCTAssertNotNil(bible, @"Module is nil");
@@ -47,16 +98,6 @@
XCTAssertTrue([[text text] length] > 0, @"");
}
-- (void)testCloneModule {
- SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerSch"];
- XCTAssertNotNil(bible, @"Module is nil");
-
- /*
- SwordBible *cloned = (SwordBible *)[bible clone];
- STAssertNotNil(cloned, @"Module is nil");
- */
-}
-
- (void)testLoopWithModulePos {
SwordListKey *lk = [SwordListKey listKeyWithRef:@"gen" v11n:[mod versification]];
[lk setPersist:YES];
@@ -166,8 +207,15 @@
NSLog(@"start position: %@", [vk keyText]);
[vk decrement];
NSLog(@"decrement position: %@", [vk keyText]);
+ XCTAssertTrue([vk chapter] == 1);
+ XCTAssertTrue([vk book] == 1);
+ XCTAssertTrue([vk verse] == 1);
+
[vk setVerse:[vk verse] + 3];
NSLog(@"verse + 3: %@", [vk keyText]);
+ XCTAssertTrue([vk chapter] == 1);
+ XCTAssertTrue([vk book] == 1);
+ XCTAssertTrue([vk verse] == 4);
}
@end
Added: trunk/bindings/objc/test/Tests-Bridging-Header.h
===================================================================
--- trunk/bindings/objc/test/Tests-Bridging-Header.h (rev 0)
+++ trunk/bindings/objc/test/Tests-Bridging-Header.h 2014-10-06 14:18:19 UTC (rev 3264)
@@ -0,0 +1,7 @@
+//
+// Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import <ObjCSword/ObjCSword.h>
+//#import <ObjCSword/Configuration.h>
+//#import <ObjCSword/SwordManager.h>
Modified: trunk/bindings/objc/test/Tests-Info.plist
===================================================================
--- trunk/bindings/objc/test/Tests-Info.plist 2014-10-04 09:45:59 UTC (rev 3263)
+++ trunk/bindings/objc/test/Tests-Info.plist 2014-10-06 14:18:19 UTC (rev 3264)
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>de.mabe.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
More information about the sword-cvs
mailing list