try-catch-impl.h 687 B

1234567891011121314151617181920212223242526272829
  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. unsigned long timeout)
  18. {
  19. try_catch->test = test;
  20. try_catch->try = try;
  21. try_catch->catch = catch;
  22. try_catch->timeout = timeout;
  23. }
  24. #endif /* _KUNIT_TRY_CATCH_IMPL_H */