Skip to content

Commit 880b108

Browse files
authored
Fix RNTester image loader test compilation
## Summary: Building the RNTester iOS unit-test target fails in `RCTImageLoaderTests.m` with `expected function body after function declarator`. #59433 removed `RCTImageLoaderHelpers.h` and the bridge-dependent image-loader tests, but left four invocations of `RCTDefineImageURLLoader` and `RCTDefineImageDecoder`. Remove these stale invocations so the remaining `RCTImageLoaderCacheTests` can compile. ## Changelog: [INTERNAL] [FIXED] - Fix RNTester iOS unit-test compilation after removal of the image-loader test helpers. ## Test Plan: Reproduced on main at `f480836ad8e`, using Xcode 27.2 and an iPhone 18 Pro simulator running iOS 27.0. With RNTester's CocoaPods dependencies installed, ran the same command before and after the change, from the repository root: ```sh xcodebuild test \ -workspace packages/rn-tester/RNTesterPods.xcworkspace \ -scheme RNTester \ -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0' \ -only-testing:RNTesterUnitTests/RCTImageLoaderCacheTests \ -derivedDataPath build/image-loader-test-build/DerivedData \ -jobs 6 \ -parallel-testing-enabled NO \ -disableAutomaticPackageResolution \ CODE_SIGNING_ALLOWED=NO ``` - Before: compilation fails at the stale macro invocations in `RCTImageLoaderTests.m`. - After: the `RNTesterUnitTests` target compiles, and `testCachedImagePreservesNaturalSizeWhenNotClipped` passes: 1 test, 0 failures. The repository's formatting check also passes: ```sh node scripts/clang-format.js --check packages/rn-tester/RNTesterUnitTests/RCTImageLoaderTests.m ``` Differential Revision: D130637311 Pull Request resolved: #59852
1 parent dac56f1 commit 880b108

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎packages/rn-tester/RNTesterUnitTests/RCTImageLoaderTests.m‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
1414
0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b};
1515

16-
RCTDefineImageURLLoader(RCTImageLoaderTestsURLLoader1) RCTDefineImageURLLoader(RCTImageLoaderTestsURLLoader2)
17-
RCTDefineImageDecoder(RCTImageLoaderTestsDecoder1) RCTDefineImageDecoder(RCTImageLoaderTestsDecoder2)
18-
19-
@interface RCTImageLoaderTestsImageCache : NSObject<RCTImageCache>
16+
@interface RCTImageLoaderTestsImageCache : NSObject <RCTImageCache>
2017

2118
@property (nonatomic, strong) UIImage *image;
2219
@property (nonatomic, copy) NSString *URLString;

0 commit comments

Comments
 (0)