FIRTestsAssertionHandler.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2020 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. typedef void (^FIRTestsAssertionHandlerBlock)(id object, NSString *fileName, NSInteger lineNumber);
  19. @interface FIRTestsAssertionHandler : NSAssertionHandler
  20. /**
  21. * Sets a handler for assertions in objects of the specified class.
  22. * @param aClass A class to set an assertion method failure handler.
  23. * @param handler A custom handler that will be called each time when
  24. * `-[FIRTestsAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]` is
  25. * called. If `nil` then
  26. * `-[super handleFailureInMethod:object:file:lineNumber:description:]` (default implementation)
  27. * will be called.
  28. */
  29. - (void)setMethodFailureHandlerForClass:(Class)aClass
  30. handler:(nullable FIRTestsAssertionHandlerBlock)handler;
  31. @end
  32. NS_ASSUME_NONNULL_END