GCC Code Coverage Report


Directory: ./
File: tests/unit/02_shmem/shmem_fail_01.c
Date: 2026-11-30 15:03:27
Exec Total Coverage
Lines: 0 8 0.0%
Functions: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*********************************************************************************/
2 /* Copyright 2009-2021 Barcelona Supercomputing Center */
3 /* */
4 /* This file is part of the DLB library. */
5 /* */
6 /* DLB is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU Lesser General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* DLB is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU Lesser General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU Lesser General Public License */
17 /* along with DLB. If not, see <https://www.gnu.org/licenses/>. */
18 /*********************************************************************************/
19
20 #include "unique_shmem.h"
21
22 #include "LB_comm/shmem.h"
23
24 /* Check different shared memory version */
25
26 struct data {
27 int foo;
28 };
29
30 ✗ int main(int argc, char **argv) {
31 struct data *shdata;
32 ✗ shmem_handler_t *handler1 = shmem_init((void**)&shdata,
33 ✗ &(const shmem_props_t) {
34 .size = sizeof(struct data),
35 .name = "cpuinfo",
36 .key = SHMEM_KEY,
37 .version = 1,
38 });
39 ✗ shmem_handler_t *handler2 = shmem_init((void**)&shdata,
40 ✗ &(const shmem_props_t) {
41 .size = sizeof(struct data),
42 .name = "cpuinfo",
43 .key = SHMEM_KEY,
44 .version = 2,
45 });
46
47 /* This should not be reached, but it's here to ensure that the test fails
48 * due to the shmem_init abort, and not due to the unfinished shmem destructor
49 */
50 ✗ shmem_finalize(handler1, NULL);
51 ✗ shmem_finalize(handler2, NULL);
52
53 ✗ return 0;
54 }
55