Skip to content

Commit dad68ad

Browse files
authored
test: Initialize Dyld address before running tests for BinaryImageCache (#5755)
1 parent fae97e5 commit dad68ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Tests/SentryTests/SentryCrash/SentryBinaryImageCacheTests.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "SentryBinaryImageCache+Private.h"
22
#import "SentryCrashBinaryImageCache.h"
3+
#import "SentryCrashDynamicLinker+Test.h"
34
#import "SentryCrashWrapper.h"
45
#import "SentryDependencyContainer.h"
56
#import <XCTest/XCTest.h>
@@ -85,6 +86,7 @@ + (void)setUp
8586
mach_headers_test_cache = [NSMutableArray array];
8687

8788
// Manually include dyld
89+
sentrycrashdl_initialize();
8890
[mach_headers_test_cache addObject:[NSValue valueWithPointer:sentryDyldHeader]];
8991
_dyld_register_func_for_add_image(&cacheMachHeaders);
9092
}
@@ -102,6 +104,7 @@ - (void)setUp
102104

103105
- (void)tearDown
104106
{
107+
sentrycrashdl_clearDyld();
105108
sentry_resetFuncForAddRemoveImage();
106109
sentrycrashbic_stopCache();
107110
sentry_setFuncForBeforeAdd(NULL);

0 commit comments

Comments
 (0)