try-catch-impl.h 628 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Internal kunit try catch implementation to be shared with tests.
  4. *
  5. * Copyright (C) 2019, Google LLC.
  6. * Author: Brendan Higgins <brendanhiggins@google.com>
  7. */
  8. #ifndef _KUNIT_TRY_CATCH_IMPL_H
  9. #define _KUNIT_TRY_CATCH_IMPL_H
  10. #include <kunit/try-catch.h>
  11. #include <linux/types.h>
  12. struct kunit;
  13. static inline void kunit_try_catch_init(struct kunit_try_catch *try_catch,
  14. struct kunit *test,
  15. kunit_try_catch_func_t try,
  16. kunit_try_catch_func_t catch)
  17. {
  18. try_catch->test = test;
  19. try_catch->try = try;
  20. try_catch->catch = catch;
  21. }
  22. #endif /* _KUNIT_TRY_CATCH_IMPL_H */