File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Tests/SentryTests/SentryCrash Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3232#import " TestThread.h"
3333
3434#import < mach/mach.h>
35+ #if defined(__arm64__)
36+ # include < sys/_types/_ucontext64.h>
37+ #endif
3538
3639@interface SentryCrashCPU_Tests : XCTestCase
3740@end
@@ -81,12 +84,22 @@ - (void)testCPUState
8184 XCTAssertTrue (value == 0 , @" " );
8285
8386 uintptr_t address;
87+ #if defined(__arm64__)
88+ ucontext64_t userContext;
89+ userContext.uc_mcontext64 = &machineContext->machineContext ;
90+ #else
91+ ucontext_t userContext;
92+ userContext.uc_mcontext = &machineContext->machineContext ;
93+ #endif
8494 address = sentrycrashcpu_framePointer (machineContext);
8595 XCTAssertTrue (address != 0 , @" " );
96+ XCTAssertEqual (sentrycrashcpu_framePointerFromUserContext (&userContext), address);
8697 address = sentrycrashcpu_stackPointer (machineContext);
8798 XCTAssertTrue (address != 0 , @" " );
99+ XCTAssertEqual (sentrycrashcpu_stackPointerFromUserContext (&userContext), address);
88100 address = sentrycrashcpu_instructionAddress (machineContext);
89101 XCTAssertTrue (address != 0 , @" " );
102+ XCTAssertEqual (sentrycrashcpu_instructionAddressFromUserContext (&userContext), address);
90103
91104 numRegisters = sentrycrashcpu_numExceptionRegisters ();
92105 for (int i = 0 ; i < numRegisters; i++) {
You can’t perform that action at this time.
0 commit comments