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

OCMVerify with CMTime argument fails on m1 mac. #526

Open
bheinzelman opened this issue Sep 21, 2022 · 2 comments
Open

OCMVerify with CMTime argument fails on m1 mac. #526

bheinzelman opened this issue Sep 21, 2022 · 2 comments
Labels
M1 Requires Apple silicon to address

Comments

@bheinzelman
Copy link

I have several tests in my codebase that use OCMVerify to verify that methods were called that take CMTime as arguments. This seems to work on Intel mac, but not m1. Here is minimal example of a test that does not work:

@interface TestClassB: NSObject

- (void)printCMTime:(CMTime)time;

@end


@implementation TestClassB

- (void)printCMTime:(CMTime)time {
    NSLog(@"Time = %.2f", CMTimeGetSeconds(time));
}

@end


@interface TestClass: NSObject

@property (nonatomic) TestClassB *b;

- (void)someFuncThatTakesCMTime:(CMTime)time;

@end

@implementation TestClass

- (instancetype)init {
    self = [super init];
    _b = [[TestClassB alloc] init];
    return self;
}

- (void)someFuncThatTakesCMTime:(CMTime)time {
    [_b printCMTime:time];
}

@end

@interface CMTimeTest : XCTestCase
@end

@implementation CMTimeTest

- (void)testCMTime {
    id mockB = OCMClassMock(TestClassB.class);

    TestClass *t = [[TestClass alloc] init];
    t.b = mockB;

    [t someFuncThatTakesCMTime:kCMTimeZero];

    OCMVerify([mockB printCMTime:kCMTimeZero]);
}

@end
@erikdoe
Copy link
Owner

erikdoe commented Sep 25, 2022

Thank you for reporting this problem and for including a failing test. Unfortunately, I currently don't have access to a Mac with an M1 processor, which means I can't reproduce the problem. Can you describe what happens when you run this on an M1 Mac?

@bheinzelman
Copy link
Author

bheinzelman commented Oct 11, 2022

Hello @erikdoe, it fails with the following error: : error: -[CMTimeTest testCMTime] : OCClassMockObject(TestClassB): Method printCMTime:({length = 24, bytes = 0x000000000000000001000000010000000000000000000000}) was not invoked; but was expected at least once. On this line: OCMVerify([mockB printCMTime:kCMTimeZero]);

@erikdoe erikdoe added the M1 Requires Apple silicon to address label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M1 Requires Apple silicon to address
Projects
None yet
Development

No branches or pull requests

2 participants