YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_interp_method_config_invalid_name.c
Go to the documentation of this file.
1// Copyright (c) 2026 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
14#include "tests.h"
15#include "test_common.h"
16
17static void utest_custom_abort_handler(
18 MPI_Comm comm, char const * msg, char const * source, int line) {
19
20 UNUSED(comm);
21 UNUSED(msg);
22 UNUSED(source);
23 UNUSED(line);
24
25 MPI_Finalize();
26
27 exit(TEST_EXIT_CODE);
28}
29
30int main(void) {
31 MPI_Init(NULL, NULL);
32
33 yac_set_abort_handler((yac_abort_func)utest_custom_abort_handler);
34
35// for coverage tests internal asserts are deactivated, therefore the following
36// code cannot safely be executed
37#ifndef YAC_CODE_COVERAGE_TEST
38
39 // This must abort because "invalid_name" is not a known method name.
42
43 // Should never reach here.
44 PUT_ERR("should be unreachable");
45
47
48#endif // YAC_CODE_COVERAGE_TEST
49
50 MPI_Finalize();
51 return TEST_EXIT_CODE;
52}
#define UNUSED(x)
Definition core.h:72
struct yac_interp_method_config * yac_interp_method_config_default_from_name_new(char const *method_name)
Defines the interface for interpolation method configuration "base class" in YAC.
void yac_interp_method_config_delete(struct yac_interp_method_config *config)
static struct yac_interp_method_config * config
#define TEST_EXIT_CODE
Definition tests.h:15
#define PUT_ERR(string)
Definition tests.h:10
void(* yac_abort_func)(MPI_Comm comm, const char *msg, const char *source, int line) __attribute__((noreturn))
Definition yac.h:3587
void yac_set_abort_handler(yac_abort_func custom_abort)