GCC Code Coverage Report


Directory: ./
File: tests/unit/00_support/types_00.c
Date: 2026-11-30 15:03:27
Exec Total Coverage
Lines: 138 138 100.0%
Functions: 1 1 100.0%
Branches: 164 328 50.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 "dlb_errors.h"
21 #include "support/types.h"
22
23 #include <stdio.h>
24 #include <string.h>
25 #include <unistd.h>
26 #include <assert.h>
27
28 1 int main(int argc, char *argv[]) {
29 int err;
30
31 bool b_value;
32
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_bool("", &b_value); assert(err);
33
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_bool("null", &b_value); assert(err);
34
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("1", &b_value); assert(!err && b_value);
35
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("yes", &b_value); assert(!err && b_value);
36
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("true", &b_value); assert(!err && b_value);
37
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("0", &b_value); assert(!err && !b_value);
38
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("no", &b_value); assert(!err && !b_value);
39
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_bool("false", &b_value); assert(!err && !b_value);
40
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_bool("false", "0") );
41
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_bool("false", "1") );
42
43
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_negated_bool("", &b_value); assert(err);
44
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_negated_bool("null", &b_value); assert(err);
45
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("1", &b_value); assert(!err && !b_value);
46
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("yes", &b_value); assert(!err && !b_value);
47
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("true", &b_value); assert(!err && !b_value);
48
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("0", &b_value); assert(!err && b_value);
49
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("no", &b_value); assert(!err && b_value);
50
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_negated_bool("false", &b_value); assert(!err && b_value);
51
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_negated_bool("false", "0") );
52
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_negated_bool("false", "1") );
53
54 int i_value;
55
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_int("", &i_value); assert(err);
56
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_int("zzzzz", &i_value); assert(err);
57
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_int("42", &i_value); assert(!err && i_value==42);
58
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_int("42zzzzz", &i_value); assert(!err && i_value==42);
59
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_int("0", "0") );
60
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_int("0", "1") );
61
62 verbose_opts_t vb;
63
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("", &vb); assert(vb==VB_CLEAR);
64
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("null", &vb); assert(vb==VB_CLEAR);
65
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("yes", &vb); assert(vb==VB_ALL);
66
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("api", &vb); assert(vb==VB_API);
67
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("mpi_api", &vb); assert(vb==VB_MPI_API);
68
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_opts("api:shmem", &vb); assert(vb==(VB_API|VB_SHMEM));
69 1 parse_verbose_opts("api:microlb:shmem:mpi_api:mpi_intercept:stats:drom:async", &vb);
70
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 assert(vb == (VB_API | VB_MICROLB | VB_SHMEM | VB_MPI_API | VB_MPI_INT
71 | VB_STATS | VB_DROM | VB_ASYNC));
72
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_opts_tostr(VB_CLEAR), "no") == 0 );
73
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_opts_tostr(VB_ALL), "all") == 0 );
74
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_opts_tostr((verbose_opts_t)(VB_API|VB_SHMEM)), "api:shmem") == 0 );
75
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_verbose_opts("api:shmem", "shmem:api") );
76
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_verbose_opts("api:shmem", "shmem") );
77
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_verbose_opts("drom:async", "drom_async") );
78
79 verbose_fmt_t fmt;
80
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_fmt("", &fmt); assert(fmt==VBF_CLEAR);
81
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_fmt("null", &fmt); assert(fmt==VBF_CLEAR);
82
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_fmt("node", &fmt); assert(fmt==VBF_NODE);
83
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_verbose_fmt("spid:mpinode", &fmt); assert(fmt==(VBF_SPID|VBF_MPINODE));
84 1 parse_verbose_fmt("node:spid:mpinode:mpirank:thread", &fmt);
85
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 assert(fmt == (VBF_NODE | VBF_SPID | VBF_MPINODE | VBF_MPIRANK | VBF_THREAD));
86
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_fmt_tostr(VBF_CLEAR), "") == 0 );
87
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_fmt_tostr(VBF_NODE), "node") == 0 );
88
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_fmt_tostr(VBF_MPINODE), "mpinode") == 0 );
89
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(verbose_fmt_tostr((verbose_fmt_t)(VBF_NODE|VBF_MPINODE)), "node:mpinode") == 0 );
90
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_verbose_fmt("node:thread", "thread:node") );
91
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_verbose_fmt("node:thread", "thread") );
92
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_verbose_fmt("node:thread", "node_thread") );
93
94 instrument_items_t inst;
95
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_instrument_items("", &inst); assert(inst==INST_NONE);
96
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_instrument_items("null", &inst); assert(inst==INST_NONE);
97
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_instrument_items("none", &inst); assert(inst==INST_NONE);
98
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_instrument_items("all:none", &inst); assert(inst==INST_ALL);
99
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 parse_instrument_items("all:lewi", &inst); assert(inst==INST_ALL);
100 1 parse_instrument_items("null:mpi:lewi:drom:talp:barrier:ompt:cpus", &inst);
101
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 assert(inst == (INST_MPI | INST_LEWI | INST_DROM | INST_TALP | INST_BARR
102 | INST_OMPT | INST_CPUS));
103
104
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert(strcmp(instrument_items_tostr(INST_NONE), "none") == 0);
105
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert(strcmp(instrument_items_tostr(INST_ALL), "all") == 0);
106
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert(strcmp(instrument_items_tostr((instrument_items_t)(INST_LEWI|INST_DROM)),
107 "lewi:drom") == 0);
108
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_instrument_items("all", "thread:node:all") );
109
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_instrument_items("talp", "barrier") );
110
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_instrument_items("all", "callbacks") );
111
112 lewi_affinity_t aff;
113
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_lewi_affinity("", &aff); assert(err);
114
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_lewi_affinity("null", &aff); assert(err);
115
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("auto", &aff); assert(!err && aff==LEWI_AFFINITY_AUTO);
116
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("none", &aff); assert(!err && aff==LEWI_AFFINITY_NONE);
117
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("mask", &aff); assert(!err && aff==LEWI_AFFINITY_MASK);
118
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("any", &aff); assert(!err && aff==LEWI_AFFINITY_MASK);
119
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("nearby-first", &aff); assert(!err
120 && aff==LEWI_AFFINITY_NEARBY_FIRST);
121
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("nearby-only", &aff); assert(!err
122 && aff==LEWI_AFFINITY_NEARBY_ONLY);
123
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_lewi_affinity("spread-ifempty", &aff); assert(!err
124 && aff==LEWI_AFFINITY_SPREAD_IFEMPTY);
125
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_lewi_affinity("nearby-first", "nearby-first") );
126
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_lewi_affinity("nearby-first", "any") );
127
128 policy_t pol;
129
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_policy("", &pol); assert(err);
130 1 printf("Policy: %s\n", policy_tostr((policy_t)42));
131
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_policy("null", &pol); assert(err);
132 1 printf("Policy: %s\n", policy_tostr(pol));
133
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_policy("no", &pol); assert(!err && pol==POLICY_NONE);
134 1 printf("Policy: %s\n", policy_tostr(pol));
135
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_policy("lewi", &pol); assert(!err && pol==POLICY_LEWI);
136 1 printf("Policy: %s\n", policy_tostr(pol));
137
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_policy("lewi_mask", &pol); assert(!err && pol==POLICY_LEWI_MASK);
138 1 printf("Policy: %s\n", policy_tostr(pol));
139
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_policy("lewi", "lewi") );
140
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_policy("lewi", "lewi_mask") );
141
142 talp_summary_t summary;
143
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_talp_summary("", &summary); assert(!err && summary==SUMMARY_NONE);
144
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_talp_summary("node", &summary); assert(!err && summary==SUMMARY_NODE);
145
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_talp_summary("yes", &summary); assert(!err && summary==SUMMARY_POP_METRICS);
146
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_talp_summary("all", &summary); assert(!err && summary==SUMMARY_ALL);
147
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_talp_summary("pop", &summary); assert(!err && summary==SUMMARY_NONE);
148
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(talp_summary_tostr(SUMMARY_NONE), "none") == 0 );
149
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(talp_summary_tostr(SUMMARY_ALL), "all") == 0 );
150
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(talp_summary_tostr(SUMMARY_POP_METRICS), "pop-metrics") == 0 );
151
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_talp_summary("omp:pop-raw", "pop-raw:omp") );
152
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_talp_summary("pop-metrics", "pop-raw") );
153
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_talp_summary("node:process", "node_process") );
154
155 talp_model_t talp_model;
156 1 err = parse_talp_model("", &talp_model);
157
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 assert( err );
158 1 err = parse_talp_model("hybrid-v1", &talp_model);
159
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 assert( !err && talp_model == TALP_MODEL_HYBRID_V1 );
160 1 err = parse_talp_model("hybrid-v2", &talp_model);
161
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 assert( !err && talp_model == TALP_MODEL_HYBRID_V2 );
162
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( strcmp(talp_model_tostr(TALP_MODEL_HYBRID_V2), "hybrid-v2") == 0 );
163
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_talp_model("hybrid-v1", "hybrid-v1") );
164
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_talp_model("hybrid-v1", "hybrid-v2") );
165
166 mngo_mode_t mngo_mode;
167
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_mngo_mode("", &mngo_mode); assert(err == DLB_ERR_NOENT);
168
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_mngo_mode("regions", &mngo_mode); assert(!err && mngo_mode == MNGO_REGIONS);
169 1 err = parse_mngo_mode("helper-thread", &mngo_mode);
170
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 assert(!err && mngo_mode == MNGO_HELPER_THREAD);
171
172 interaction_mode_t mode;
173
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_mode("", &mode); assert(err);
174
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_mode("null", &mode); assert(err);
175
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_mode("polling", &mode); assert(!err && mode==MODE_POLLING);
176
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_mode("async", &mode); assert(!err && mode==MODE_ASYNC);
177
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_mode("polling", "polling") );
178
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_mode("polling", "async") );
179
180 mpi_set_t set;
181
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_mpiset("", &set); assert(err);
182
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_mpiset("all", &set); assert(!err && set==MPISET_ALL);
183
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_mpiset("barrier", &set); assert(!err && set==MPISET_BARRIER);
184
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_mpiset("all", "all") );
185
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_mpiset("all", "collectives") );
186
187 omptool_opts_t ompt;
188
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_omptool_opts("", &ompt); assert(!err && ompt==OMPTOOL_OPTS_NONE);
189
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_omptool_opts("lend", &ompt); assert(!err && ompt==OMPTOOL_OPTS_LEND);
190 1 err = parse_omptool_opts("lend:borrow", &ompt);
191
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 assert(!err && ompt==(OMPTOOL_OPTS_LEND|OMPTOOL_OPTS_BORROW));
192
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert(strcmp(omptool_opts_tostr(OMPTOOL_OPTS_BORROW), "borrow") == 0);
193
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_omptool_opts("lend:borrow", "borrow:borrow:lend") );
194
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_omptool_opts("lend", "borrow") );
195
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_omptool_opts("lend:borrow", "lend_borrow") );
196
197 omptm_version_t omptm;
198
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 err = parse_omptm_version("", &omptm); assert(err);
199
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 err = parse_omptm_version("omp5", &omptm); assert(!err && omptm==OMPTM_OMP5);
200
201
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( equivalent_omptm_version_opts("omp5", "omp5") );
202
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 assert( !equivalent_omptm_version_opts("omp5", "free-agents") );
203
204 1 return 0;
205 }
206