Skip to content

Commit

Permalink
Merge pull request #1783 from mobiware/development
Browse files Browse the repository at this point in the history
Fix #1782
  • Loading branch information
blakewatters committed May 20, 2014
2 parents 10a3967 + 83bb54a commit 1e8ae15
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Code/ObjectMapping/RKHTTPUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#import <Foundation/Foundation.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
HTTP methods for requests
*/
Expand Down Expand Up @@ -150,3 +154,7 @@ NSString *RKPathAndQueryStringFromURLRelativeToURL(NSURL *URL, NSURL *baseURL);
* @return An index set of the status codes with optional response bodies
*/
NSIndexSet *RKStatusCodesOfResponsesWithOptionalBodies(void);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions Code/ObjectMapping/RKObjectUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#import <Foundation/Foundation.h>

#ifdef __cplusplus
extern "C" {
#endif

///----------------
/// @name Functions
///----------------
Expand Down Expand Up @@ -103,3 +107,7 @@ Class RKKeyValueCodingClassFromPropertyAttributes(const char *attr);
@return The class name for the property type encoded in the given attribute string or `@"NULL"` if the property does not have an object type (the declared property is for a primitive type).
*/
NSString *RKPropertyTypeFromAttributeString(NSString *attributeString);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions Code/Support/RKDictionaryUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
// limitations under the License.
//

#ifdef __cplusplus
extern "C" {
#endif

#import <Foundation/Foundation.h>

/**
Expand All @@ -36,3 +40,7 @@ NSDictionary *RKDictionaryByMergingDictionaryWithDictionary(NSDictionary *dict1,
@return A new `NSDictionary` wherein any percent escape sequences in the key and values have been replaced with their literal values.
*/
NSDictionary *RKDictionaryByReplacingPercentEscapesInEntriesFromDictionary(NSDictionary *dictionary);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions Code/Support/RKMIMETypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
// limitations under the License.
//

#ifdef __cplusplus
extern "C" {
#endif

/**
MIME Type Constants
*/
Expand All @@ -42,3 +46,7 @@ extern NSString * const RKMIMETypeTextXML;
@return `YES` if the given MIME Type matches any identifier in the set, else `NO`.
*/
BOOL RKMIMETypeInSet(NSString *MIMEType, NSSet *MIMETypes);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions Code/Support/RKPathUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#import <Foundation/Foundation.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
Returns the path to the Application Data directory for the executing application. On iOS, this is a sandboxed path specific for the executing application. On OS X, this is an application specific path under `NSApplicationSupportDirectory` (i.e. ~/Application Support).
Expand Down Expand Up @@ -52,3 +56,7 @@ NSString *RKMIMETypeFromPathExtension(NSString *path);
@param path The path to the item that is to be excluded from backup.
*/
void RKSetExcludeFromBackupAttributeForItemAtPath(NSString *path);

#ifdef __cplusplus
}
#endif
2 changes: 2 additions & 0 deletions RestKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@
73D3907714CA1AE60093E3D6 /* child.json in Resources */ = {isa = PBXBuildFile; fileRef = 73D3907314CA1A4A0093E3D6 /* child.json */; };
73D3907914CA1DD40093E3D6 /* channels.xml in Resources */ = {isa = PBXBuildFile; fileRef = 73D3907814CA1D710093E3D6 /* channels.xml */; };
73D3907A14CA1DD50093E3D6 /* channels.xml in Resources */ = {isa = PBXBuildFile; fileRef = 73D3907814CA1D710093E3D6 /* channels.xml */; };
7AF2905218DF249C009AEB94 /* RKObjectiveCppTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2501405215366000004E0466 /* RKObjectiveCppTest.mm */; };
7F9CBC6174004E31AEC35813 /* libPods-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86EC453810D648768BF62304 /* libPods-osx.a */; };
BE05BDD11782109F00F7C9C9 /* RKRouteTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BE05BDCF1782109F00F7C9C9 /* RKRouteTest.m */; };
BE05BDD2178214AA00F7C9C9 /* RKRouteTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BE05BDCF1782109F00F7C9C9 /* RKRouteTest.m */; };
Expand Down Expand Up @@ -2518,6 +2519,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7AF2905218DF249C009AEB94 /* RKObjectiveCppTest.mm in Sources */,
251610611456F2330060A5C5 /* RKManagedObjectStoreTest.m in Sources */,
251610A31456F2330060A5C5 /* Data Model.xcdatamodel in Sources */,
251610A51456F2330060A5C5 /* RKCat.m in Sources */,
Expand Down
30 changes: 30 additions & 0 deletions Tests/Logic/Support/RKObjectiveCppTest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
//

#import "RKTestEnvironment.h"
#import "RKHTTPUtilities.h"
#import "RKObjectUtilities.h"
#import "RKMIMETypes.h"
#import "RKPathUtilities.h"
#import "RKDictionaryUtilities.h"

@interface RKObjectiveCppTest : RKTestCase

Expand All @@ -19,4 +24,29 @@ - (void)testCompiles
// Nothing to do.
}

- (void)testCompilesWithHTTPUtilities {
NSIndexSet *codes = RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful);
expect(codes).notTo.beNil();
}

- (void)testCompilesWithObjectUtilities {
BOOL eq = RKClassIsCollection([NSArray class]);
expect(eq).to.equal(YES);
}

- (void)testCompilesWithMIMETypes {
BOOL match = RKMIMETypeInSet(@"text/plain", [NSSet set]);
expect(match).to.equal(NO);
}

- (void)testCompilesWithPathUtilities {
NSString *path = RKApplicationDataDirectory();
expect(path).notTo.beNil();
}

- (void)testCompilesWithDictionaryUtilities {
NSDictionary *dict = RKDictionaryByMergingDictionaryWithDictionary([NSDictionary dictionary], [NSDictionary dictionary]);
expect(dict).notTo.beNil();
}

@end

0 comments on commit 1e8ae15

Please sign in to comment.