Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop including af-enums.h in Darwin unit tests. #32044

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions src/darwin/Framework/CHIPTests/MTRBackwardsCompatTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#import "MTRTestResetCommissioneeHelper.h"
#import "MTRTestStorage.h"

#import <app/util/af-enums.h>

#import <math.h> // For INFINITY

// system dependencies
Expand Down Expand Up @@ -203,34 +201,34 @@ - (void)test000_SetUp
// tests.
}

#define CHECK_RETURN_TYPE(sig, type) \
do { \
XCTAssertNotNil(sig); \
XCTAssertTrue(strcmp([sig methodReturnType], @encode(type)) == 0); \
#define CHECK_RETURN_TYPE(sig, type) \
do { \
XCTAssertNotNil(sig); \
XCTAssertTrue(strcmp([sig methodReturnType], @encode(type)) == 0); \
} while (0)

/**
* Arguments 0 and 1 are the implicit self and _cmd arguments; the real arguments begin at index 2.
*/
#define CHECK_ARGUMENT(sig, index, type) \
do { \
XCTAssertTrue(strcmp([sig getArgumentTypeAtIndex:(index) + 2], @encode(type)) == 0); \
#define CHECK_ARGUMENT(sig, index, type) \
do { \
XCTAssertTrue(strcmp([sig getArgumentTypeAtIndex:(index) + 2], @encode(type)) == 0); \
} while (0)

#define CHECK_READONLY_PROPERTY(instance, propName, type) \
do { \
NSMethodSignature * signature = [instance methodSignatureForSelector:@selector(propName)]; \
CHECK_RETURN_TYPE(signature, type); \
/* Check that getting the property directly compiles too */ \
(void) instance.propName; \
#define CHECK_READONLY_PROPERTY(instance, propName, type) \
do { \
NSMethodSignature * signature = [instance methodSignatureForSelector:@selector(propName)]; \
CHECK_RETURN_TYPE(signature, type); \
/* Check that getting the property directly compiles too */ \
(void) instance.propName; \
} while (0)

#define CHECK_PROPERTY(instance, propName, setterName, type) \
do { \
CHECK_READONLY_PROPERTY(instance, propName, type); \
NSMethodSignature * signature = [instance methodSignatureForSelector:@selector(setterName:)]; \
CHECK_RETURN_TYPE(signature, void); \
CHECK_ARGUMENT(signature, 0, type); \
#define CHECK_PROPERTY(instance, propName, setterName, type) \
do { \
CHECK_READONLY_PROPERTY(instance, propName, type); \
NSMethodSignature * signature = [instance methodSignatureForSelector:@selector(setterName:)]; \
CHECK_RETURN_TYPE(signature, void); \
CHECK_ARGUMENT(signature, 0, type); \
} while (0)

/**
Expand Down
Loading
Loading