Native: fix objc_direct tests on platforms with 32-bit NSUInteger

On some platforms, `NSUInteger` is 32-bit, while the objc_direct tests
expected it to be represented as `ULong`. So the tests failed on those
platforms.
Fix the tests by replacing `NSUInteger` with `uint64_t`.
This commit is contained in:
Svyatoslav Scherbina
2023-03-29 13:29:08 +00:00
committed by Space Team
parent 2ace8ba9bd
commit 65d781758c
2 changed files with 9 additions and 9 deletions
@@ -6,21 +6,21 @@ __attribute__((objc_runtime_name("CC")))
__attribute__((swift_name("CC")))
@interface CallingConventions : NSObject
+ (NSUInteger)regular:(NSUInteger)arg;
- (NSUInteger)regular:(NSUInteger)arg;
+ (uint64_t)regular:(uint64_t)arg;
- (uint64_t)regular:(uint64_t)arg;
+ (NSUInteger)direct:(NSUInteger)arg __attribute__((objc_direct));
- (NSUInteger)direct:(NSUInteger)arg __attribute__((objc_direct));
+ (uint64_t)direct:(uint64_t)arg __attribute__((objc_direct));
- (uint64_t)direct:(uint64_t)arg __attribute__((objc_direct));
@end
@interface CallingConventions(Ext)
+ (NSUInteger)regularExt:(NSUInteger)arg;
- (NSUInteger)regularExt:(NSUInteger)arg;
+ (uint64_t)regularExt:(uint64_t)arg;
- (uint64_t)regularExt:(uint64_t)arg;
+ (NSUInteger)directExt:(NSUInteger)arg __attribute__((objc_direct));
- (NSUInteger)directExt:(NSUInteger)arg __attribute__((objc_direct));
+ (uint64_t)directExt:(uint64_t)arg __attribute__((objc_direct));
- (uint64_t)directExt:(uint64_t)arg __attribute__((objc_direct));
@end
@@ -1,6 +1,6 @@
#import "direct.h"
#define TEST_METHOD_IMPL(NAME) (NSUInteger)NAME:(NSUInteger)arg { return arg; }
#define TEST_METHOD_IMPL(NAME) (uint64_t)NAME:(uint64_t)arg { return arg; }
@implementation CallingConventions : NSObject