Fix ASAN breakage on eDO device unit test. `A == B` gives an unsigned long result (4 bytes), whereas BOOL is 1 byte. As the result, OCMock's `andReturn(A == B)` saves 4 bytes data into a NSConcreteData with the size 1, and causes asan complaint. PiperOrigin-RevId: 327548825
diff --git a/Device/Tests/EDODeviceConnectorTest.m b/Device/Tests/EDODeviceConnectorTest.m index cedae75..dc00338 100644 --- a/Device/Tests/EDODeviceConnectorTest.m +++ b/Device/Tests/EDODeviceConnectorTest.m
@@ -129,6 +129,7 @@ delay:(NSTimeInterval)delay isAttachment:(BOOL)isAttachment { id mockDetector = OCMClassMock([EDODeviceDetector class]); + BOOL success = listenError == nil; OCMStub([mockDetector listenToBroadcastWithError:[OCMArg anyObjectRef] receiveHandler:OCMOCK_ANY]) .andDo(^(NSInvocation *invocation) { __strong NSError **errorPointer; @@ -160,7 +161,7 @@ } }); }) - .andReturn(listenError == nil); + .andReturn(success); OCMStub([mockDetector cancel]).andDo(^(NSInvocation *invocation) { [mockDetector stopMocking]; });