Permalink
Browse files

Removes the hard-provided RXAssertions files.

  • Loading branch information...
1 parent 84fcd6f commit 98352df2019d7a1d552fcbe804b40cd31a0a0361 @robrix committed Nov 28, 2011
Showing with 0 additions and 381 deletions.
  1. +0 −6 RXFutures.xcodeproj/project.pbxproj
  2. +0 −82 RXFuturesTests/RXAssertions.h
  3. +0 −293 RXFuturesTests/RXAssertions.m
@@ -15,7 +15,6 @@
D4FCDC541482F1C000EB9EF7 /* RXFuture.h in Headers */ = {isa = PBXBuildFile; fileRef = D4FCDC521482F1C000EB9EF7 /* RXFuture.h */; };
D4FCDC551482F1C000EB9EF7 /* RXFuture.m in Sources */ = {isa = PBXBuildFile; fileRef = D4FCDC531482F1C000EB9EF7 /* RXFuture.m */; };
D4FCDC581482F21500EB9EF7 /* RXFutureTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D4FCDC571482F21500EB9EF7 /* RXFutureTests.m */; };
- D4FCDC5B1482F25700EB9EF7 /* RXAssertions.m in Sources */ = {isa = PBXBuildFile; fileRef = D4FCDC5A1482F25700EB9EF7 /* RXAssertions.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -42,8 +41,6 @@
D4FCDC521482F1C000EB9EF7 /* RXFuture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RXFuture.h; sourceTree = "<group>"; };
D4FCDC531482F1C000EB9EF7 /* RXFuture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RXFuture.m; sourceTree = "<group>"; };
D4FCDC571482F21500EB9EF7 /* RXFutureTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RXFutureTests.m; sourceTree = "<group>"; };
- D4FCDC591482F25700EB9EF7 /* RXAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RXAssertions.h; sourceTree = "<group>"; };
- D4FCDC5A1482F25700EB9EF7 /* RXAssertions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RXAssertions.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -128,8 +125,6 @@
D4FCDC4114819D4100EB9EF7 /* RXFuturesTests */ = {
isa = PBXGroup;
children = (
- D4FCDC591482F25700EB9EF7 /* RXAssertions.h */,
- D4FCDC5A1482F25700EB9EF7 /* RXAssertions.m */,
D4FCDC571482F21500EB9EF7 /* RXFutureTests.m */,
D4FCDC4214819D4100EB9EF7 /* Supporting Files */,
);
@@ -263,7 +258,6 @@
buildActionMask = 2147483647;
files = (
D4FCDC581482F21500EB9EF7 /* RXFutureTests.m in Sources */,
- D4FCDC5B1482F25700EB9EF7 /* RXAssertions.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1,82 +0,0 @@
-// RXAssertions.h
-// Created by Rob Rix on 2009-08-20
-// Copyright 2009 Decimus Software, Inc.
-
-#import <SenTestingKit/SenTestingKit.h>
-
-// Assertion macros that don’t require you to describe the assertion. Perfect for use with intention-revealing code.
-
-// Don’t use this unless you’re writing your own assertions. The first argument is ignored, so the assertions can have optional messages appended to them without suffering a compiler error.
-#define RXOptionalMessageString(ignored, format, ...) [NSString stringWithFormat: (format), ## __VA_ARGS__]
-
-#define RXAssert(_expression, ...) do {\
- __typeof__(_expression) __condition = (_expression);\
- if(!__condition)\
- STFail(RXOptionalMessageString(, ## __VA_ARGS__, @"%s was unexpectedly false.", #_expression));\
-} while(0)
-#define RXAssertFalse(_expression, ...) do {\
- __typeof__(_expression) __condition = (_expression);\
- if(__condition)\
- STFail(RXOptionalMessageString(, ## __VA_ARGS__, @"%s was unexpectedly true.", #_expression));\
-} while(0)
-
-// casts the expected value to the type of the actual value. will fail (and rightly so) if you try crazy casts like struct to pointer.
-#define RXAssertEquals(_actual, _expected, ...) do {\
- __typeof__(_actual) __actual = (_actual), __expected = (__typeof__(__actual))(_expected);\
- if(![RXAssertionHelper compareValue: &__actual withValue: &__expected ofObjCType: @encode(__typeof__(__actual))]) {\
- STFail(@"%s has value %@, not expected value %@. %@", #_actual, [RXAssertionHelper descriptionForValue: &__actual ofObjCType: @encode(__typeof__(__actual))], [RXAssertionHelper descriptionForValue: &__expected ofObjCType: @encode(__typeof__(__actual))], RXOptionalMessageString(, ## __VA_ARGS__, @""));\
- }\
-} while(0)
-#define RXAssertNotEquals(_actual, _expected, ...) do {\
- __typeof__(_actual) __actual = (_actual), __expected = (__typeof__(__actual))(_expected);\
- if([RXAssertionHelper compareValue: &__actual withValue: &__expected ofObjCType: @encode(__typeof__(__actual))]) {\
- STFail(@"%s has unexpected value %@. %@", #_actual, [RXAssertionHelper descriptionForValue: &__actual ofObjCType: @encode(__typeof__(__actual))], RXOptionalMessageString(, ## __VA_ARGS__, @""));\
- }\
-} while(0)
-
-#define RXAssertNil(_thing, ...) do {\
- __typeof__(_thing) __thing = (_thing);\
- if(__thing != nil) STFail(RXOptionalMessageString(, ## __VA_ARGS__, @"%s was unexpectedly %@, not nil.", #_thing, __thing));\
-} while(0)
-#define RXAssertNotNil(_thing, ...) do {\
- if((_thing) == nil) STFail(RXOptionalMessageString(, ## __VA_ARGS__, @"%s was unexpectedly nil.", #_thing));\
-} while(0)
-
-
-//#ifdef __clang__
-#if 0
- // this is bad, as strict aliasing will break it, but clang doesn’t handle union casts correctly
- #define RXCast(x, toType) *(toType *)&(x)
-#else
- #define RXCast(x, toType) (((union{__typeof__(x) a; toType b;})x).b)
-#endif
-#define RXRound(value, place) (round((value) / (place)) * (place))
-
-
-typedef BOOL (*RXAssertionHelperComparisonFunction)(const void *aRef, const void *bRef);
-typedef NSString *(*RXAssertionHelperDescriptionFunction)(const void *ref);
-
-
-// making these functions available for registering Polymorph types
-BOOL RXAssertionHelperObjectComparison(const void *a, const void *b);
-NSString *RXAssertionHelperObjectDescription(const void *ref);
-
-BOOL RXAssertionHelperCFTypeRefComparison(const void *a, const void *b);
-NSString *RXAssertionHelperCFTypeRefDescription(const void *ref);
-
-
-@interface RXAssertionHelper : NSObject
-
-+(void)registerComparisonFunction:(RXAssertionHelperComparisonFunction)comparator forObjCType:(const char *)type;
-+(BOOL)compareValue:(const void *)aRef withValue:(const void *)bRef ofObjCType:(const char *)type;
-
-+(void)registerDescriptionFunction:(RXAssertionHelperDescriptionFunction)descriptor forObjCType:(const char *)type;
-+(NSString *)descriptionForValue:(const void *)ref ofObjCType:(const char *)type;
-
-+(double)floatingPointComparisonAccuracy;
-+(void)setFloatingPointComparisonAccuracy:(double)epsilon;
-
-// returns a nicely formatted name for the test case selector
-+(NSString *)humanReadableNameForTestCaseSelector:(SEL)selector;
-
-@end
Oops, something went wrong.

0 comments on commit 98352df

Please sign in to comment.