xref: /kernel/linux/linux-5.10/lib/kunit/try-catch-impl.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/lib/kunit/
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Internal kunit try catch implementation to be shared with tests.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2019, Google LLC.
68c2ecf20Sopenharmony_ci * Author: Brendan Higgins <brendanhiggins@google.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _KUNIT_TRY_CATCH_IMPL_H
108c2ecf20Sopenharmony_ci#define _KUNIT_TRY_CATCH_IMPL_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <kunit/try-catch.h>
138c2ecf20Sopenharmony_ci#include <linux/types.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct kunit;
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_cistatic inline void kunit_try_catch_init(struct kunit_try_catch *try_catch,
188c2ecf20Sopenharmony_ci					struct kunit *test,
198c2ecf20Sopenharmony_ci					kunit_try_catch_func_t try,
208c2ecf20Sopenharmony_ci					kunit_try_catch_func_t catch)
218c2ecf20Sopenharmony_ci{
228c2ecf20Sopenharmony_ci	try_catch->test = test;
238c2ecf20Sopenharmony_ci	try_catch->try = try;
248c2ecf20Sopenharmony_ci	try_catch->catch = catch;
258c2ecf20Sopenharmony_ci}
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#endif /* _KUNIT_TRY_CATCH_IMPL_H */
28

Indexes created Thu Nov 07 10:32:03 CST 2024