YAC 3.20.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_interp_method_config_param_invalid.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
18
20 MPI_Comm comm, char const * msg, char const * source, int line) {
21
22 UNUSED(comm);
23 UNUSED(msg);
24 UNUSED(source);
25 UNUSED(line);
26
28 MPI_Finalize();
29
30 exit(TEST_EXIT_CODE);
31}
32
33int main(void) {
34 MPI_Init(NULL, NULL);
35
37
39
40// for coverage tests internal asserts are deactivated, therefore the following
41// code cannot safely be executed
42#ifndef YAC_CODE_COVERAGE_TEST
43
44 // This must abort because "nonexistent_parameter" is not a valid param name
45 // for the "nnn" method.
46 yac_interp_method_config_set_param_int(config, "nonexistent_parameter", 42);
47
48 // Should never reach here.
49 PUT_ERR("should be unreachable");
50
51#endif // YAC_CODE_COVERAGE_TEST
52
54 MPI_Finalize();
55 return TEST_EXIT_CODE;
56}
#define UNUSED(x)
Definition core.h:72
void yac_interp_method_config_set_param_int(struct yac_interp_method_config *config, char const *path, int value)
struct yac_interp_method_config * yac_interp_method_config_default_from_name_new(char const *method_name)
void yac_interp_method_config_delete(struct yac_interp_method_config *config)
Defines the interface for interpolation method configuration "base class" in YAC.
static struct yac_interp_method_config * config
static void custom_abort_handler(MPI_Comm comm, char const *msg, char const *source, int line)
#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:3545
void yac_set_abort_handler(yac_abort_func custom_abort)