xref: /kernel/linux/linux-6.6/lib/kunit/try-catch-impl.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/lib/kunit/
162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Internal kunit try catch implementation to be shared with tests.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2019, Google LLC.
662306a36Sopenharmony_ci * Author: Brendan Higgins <brendanhiggins@google.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef _KUNIT_TRY_CATCH_IMPL_H
1062306a36Sopenharmony_ci#define _KUNIT_TRY_CATCH_IMPL_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <kunit/try-catch.h>
1362306a36Sopenharmony_ci#include <linux/types.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cistruct kunit;
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_cistatic inline void kunit_try_catch_init(struct kunit_try_catch *try_catch,
1862306a36Sopenharmony_ci					struct kunit *test,
1962306a36Sopenharmony_ci					kunit_try_catch_func_t try,
2062306a36Sopenharmony_ci					kunit_try_catch_func_t catch)
2162306a36Sopenharmony_ci{
2262306a36Sopenharmony_ci	try_catch->test = test;
2362306a36Sopenharmony_ci	try_catch->try = try;
2462306a36Sopenharmony_ci	try_catch->catch = catch;
2562306a36Sopenharmony_ci}
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#endif /* _KUNIT_TRY_CATCH_IMPL_H */
28

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