2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2018 EfficiOS Inc. and Linux Foundation
5 * Copyright (c) 2018-2020 Philippe Proulx <pproulx@efficios.com>
8 #ifndef BABELTRACE_ASSERT_COND_INTERNAL_H
9 #define BABELTRACE_ASSERT_COND_INTERNAL_H
11 #include "assert-cond-base.h"
14 * Asserts that a given variable `_obj` named `_obj_name` (capitalized)
17 #define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name) \
18 BT_ASSERT_PRE((_obj), "%s is NULL: ", _obj_name)
21 * Asserts that a given index `_index` is less than a given length
24 #define BT_ASSERT_PRE_VALID_INDEX(_index, _length) \
25 BT_ASSERT_PRE((_index) < (_length), \
26 "Index is out of bounds: index=%" PRIu64 ", " \
27 "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
30 * Asserts that the current thread has no error set.
32 #define BT_ASSERT_PRE_NO_ERROR() \
34 const struct bt_error *err = bt_current_thread_take_error(); \
36 bt_current_thread_move_error(err); \
39 "API function called while current thread has an " \
40 "error: function=%s", __func__); \
44 * Asserts that, if the current thread has an error, `_status` is an
47 * Puts back the error in place (if there is one) such that if this
48 * macro aborts, it will be possible to inspect it with a debugger.
50 #define BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
52 const struct bt_error *err = bt_current_thread_take_error(); \
54 bt_current_thread_move_error(err); \
56 BT_ASSERT_POST(_status < 0 || !err, \
57 "Current thread has an error, but user function " \
58 "returned a non-error status: status=%s", \
59 bt_common_func_status_string(_status)); \
63 * Asserts that the current thread has no error.
65 #define BT_ASSERT_POST_NO_ERROR() \
66 BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(0)
69 /* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
70 # define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
71 BT_ASSERT_PRE_NON_NULL((_obj), (_obj_name))
74 * Developer mode: asserts that a given object `_obj` named `_obj_name`
75 * (capitalized) is NOT frozen. This macro checks the `frozen` field of
78 * This currently only exists in developer mode because some freezing
79 * functions can be called on the fast path, so they too are only
80 * enabled in developer mode.
82 # define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
83 BT_ASSERT_PRE(!(_obj)->frozen, "%s is frozen" _fmt, _obj_name, \
86 /* Developer mode version of BT_ASSERT_PRE_VALID_INDEX() */
87 # define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
88 BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
90 /* Developer mode version of BT_ASSERT_PRE_NO_ERROR(). */
91 # define BT_ASSERT_PRE_DEV_NO_ERROR() \
92 BT_ASSERT_PRE_NO_ERROR()
95 * Developer mode version of
96 * BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS().
98 # define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
99 BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status)
101 /* Developer mode version of BT_ASSERT_POST_NO_ERROR(). */
102 # define BT_ASSERT_POST_DEV_NO_ERROR() \
103 BT_ASSERT_POST_NO_ERROR()
106 * Marks a function as being only used within a BT_ASSERT_PRE_DEV() or
107 * BT_ASSERT_POST_DEV() context.
109 # define BT_ASSERT_COND_DEV_FUNC
111 # define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
112 ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
114 # define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
115 ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
117 # define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
118 ((void) sizeof((void) (_index), (void) (_length), 0))
120 # define BT_ASSERT_PRE_DEV_NO_ERROR()
122 # define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
123 ((void) sizeof((void) (_status), 0))
125 # define BT_ASSERT_POST_DEV_NO_ERROR()
126 #endif /* BT_DEV_MODE */
128 #define _BT_ASSERT_PRE_CLK_CLS_NAME "Clock class"
130 #define BT_ASSERT_PRE_CLK_CLS_NON_NULL(_cc) \
131 BT_ASSERT_PRE_NON_NULL(clock_class, _BT_ASSERT_PRE_CLK_CLS_NAME)
133 #define BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(_cc) \
134 BT_ASSERT_PRE_DEV_NON_NULL(clock_class, _BT_ASSERT_PRE_CLK_CLS_NAME)
136 #define _BT_ASSERT_PRE_DEF_CLK_CLS_NAME "Default clock class"
138 #define BT_ASSERT_PRE_DEF_CLK_CLS_NON_NULL(_cc) \
139 BT_ASSERT_PRE_NON_NULL(clock_class, _BT_ASSERT_PRE_DEF_CLK_CLS_NAME)
141 #define BT_ASSERT_PRE_DEV_DEF_CLK_CLS_NON_NULL(_cc) \
142 BT_ASSERT_PRE_DEV_NON_NULL(clock_class, _BT_ASSERT_PRE_DEF_CLK_CLS_NAME)
144 #define _BT_ASSERT_PRE_CS_NAME "Clock snapshot"
146 #define BT_ASSERT_PRE_CS_NON_NULL(_cs) \
147 BT_ASSERT_PRE_NON_NULL(_cs, _BT_ASSERT_PRE_CS_NAME)
149 #define BT_ASSERT_PRE_DEV_CS_NON_NULL(_cs) \
150 BT_ASSERT_PRE_DEV_NON_NULL(_cs, _BT_ASSERT_PRE_CS_NAME)
152 #define _BT_ASSERT_PRE_EVENT_NAME "Event"
154 #define BT_ASSERT_PRE_EVENT_NON_NULL(_ec) \
155 BT_ASSERT_PRE_NON_NULL(_ec, _BT_ASSERT_PRE_EVENT_NAME)
157 #define BT_ASSERT_PRE_DEV_EVENT_NON_NULL(_ec) \
158 BT_ASSERT_PRE_DEV_NON_NULL(_ec, _BT_ASSERT_PRE_EVENT_NAME)
160 #define _BT_ASSERT_PRE_EC_NAME "Event class"
162 #define BT_ASSERT_PRE_EC_NON_NULL(_ec) \
163 BT_ASSERT_PRE_NON_NULL(_ec, _BT_ASSERT_PRE_EC_NAME)
165 #define BT_ASSERT_PRE_DEV_EC_NON_NULL(_ec) \
166 BT_ASSERT_PRE_DEV_NON_NULL(_ec, _BT_ASSERT_PRE_EC_NAME)
168 #define _BT_ASSERT_PRE_FC_IS_INT_COND(_fc) \
169 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
170 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
171 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
172 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION)
174 #define _BT_ASSERT_PRE_FC_IS_INT_FMT(_name) \
175 _name " is not an integer field class: %![fc-]+F"
177 #define _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc) \
178 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
179 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION)
181 #define _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name) \
182 _name " is not an unsigned integer field class: %![fc-]+F"
185 #define _BT_ASSERT_PRE_FC_IS_SIGNED_INT_COND(_fc) \
186 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
187 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION)
189 #define _BT_ASSERT_PRE_FC_IS_SIGNED_INT_FMT(_name) \
190 _name " is not a signed integer field class: %![fc-]+F"
192 #define _BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc) \
193 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
194 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION)
196 #define _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name) \
197 _name " is not an enumeration field class: %![fc-]+F"
199 #define _BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc) \
200 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
201 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD || \
202 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD)
204 #define _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name) \
205 _name " is not an array field class: %![fc-]+F"
207 #define _BT_ASSERT_PRE_FC_IS_OPTION_COND(_fc) \
208 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD || \
209 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD || \
210 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
211 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD)
213 #define _BT_ASSERT_PRE_FC_IS_OPTION_FMT(_name) \
214 _name " is not an option field class: %![fc-]+F"
216 #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_COND(_fc) \
217 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD || \
218 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
219 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD)
221 #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_FMT(_name) \
222 _name " is not an option field class with a selector: %![fc-]+F"
224 #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_COND(_fc) \
225 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
226 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD)
228 #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_FMT(_name) \
229 _name " is not an option field class with an integer selector: %![fc-]+F"
231 #define _BT_ASSERT_PRE_FC_IS_STRUCT_FMT(_name) \
232 _name " is not a structure field class: %![fc-]+F"
234 #define _BT_ASSERT_PRE_FC_IS_STRUCT_COND(_fc) \
235 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_STRUCTURE)
237 #define _BT_ASSERT_PRE_FC_IS_VARIANT_COND(_fc) \
238 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD || \
239 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
240 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD)
242 #define _BT_ASSERT_PRE_FC_IS_VARIANT_FMT(_name) \
243 _name " is not a variant field class: %![fc-]+F"
245 #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc) \
246 (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
247 ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD)
249 #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name) \
250 _name " is not a variant field class with a selector: %![fc-]+F"
252 #define _BT_ASSERT_PRE_FC_HAS_TYPE_COND(_fc, _type) \
253 (((const struct bt_field_class *) (_fc))->type == (_type))
255 #define _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name) \
256 _name " has the wrong type: expected-type=%s, %![fc-]+F"
258 #define BT_ASSERT_PRE_FC_IS_INT(_fc, _name) \
259 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_INT_COND(_fc), \
260 _BT_ASSERT_PRE_FC_IS_INT_FMT(_name), (_fc))
262 #define BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(_fc, _name) \
263 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc), \
264 _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name), (_fc))
266 #define BT_ASSERT_PRE_FC_IS_SIGNED_INT(_fc, _name) \
267 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_SIGNED_INT_COND(_fc), \
268 _BT_ASSERT_PRE_FC_IS_SIGNED_INT_FMT(_name), (_fc))
270 #define BT_ASSERT_PRE_FC_IS_ENUM(_fc, _name) \
271 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc), \
272 _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name), (_fc))
274 #define BT_ASSERT_PRE_FC_IS_ARRAY(_fc, _name) \
275 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc), \
276 _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name), (_fc))
278 #define BT_ASSERT_PRE_FC_IS_STRUCT(_fc, _name) \
279 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_STRUCT_COND(_fc), \
280 _BT_ASSERT_PRE_FC_IS_STRUCT_FMT(_name), (_fc))
282 #define BT_ASSERT_PRE_FC_IS_OPTION(_fc, _name) \
283 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_OPTION_COND(_fc), \
284 _BT_ASSERT_PRE_FC_IS_OPTION_FMT(_name), (_fc))
286 #define BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL(_fc, _name) \
287 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_COND(_fc), \
288 _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_FMT(_name), (_fc))
290 #define BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL(_fc, _name) \
291 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_COND(_fc), \
292 _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_FMT(_name), (_fc))
294 #define BT_ASSERT_PRE_FC_IS_VARIANT(_fc, _name) \
295 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_VARIANT_COND(_fc), \
296 _BT_ASSERT_PRE_FC_IS_VARIANT_FMT(_name), (_fc))
298 #define BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL(_fc, _name) \
299 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc), \
300 _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name), (_fc))
302 #define BT_ASSERT_PRE_FC_HAS_TYPE(_fc, _type, _name) \
303 BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_HAS_TYPE_COND((_fc), (_type)), \
304 _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name), \
305 bt_common_field_class_type_string(_type), (_fc))
307 #define BT_ASSERT_PRE_DEV_FC_IS_INT(_fc, _name) \
308 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_INT_COND(_fc), \
309 _BT_ASSERT_PRE_FC_IS_INT_FMT(_name), (_fc))
311 #define BT_ASSERT_PRE_DEV_FC_IS_UNSIGNED_INT(_fc, _name) \
312 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc), \
313 _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name), (_fc))
315 #define BT_ASSERT_PRE_DEV_FC_IS_SIGNED_INT(_fc, _name) \
316 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_SIGNED_INT_COND(_fc), \
317 _BT_ASSERT_PRE_FC_IS_SIGNED_INT_FMT(_name), (_fc))
319 #define BT_ASSERT_PRE_DEV_FC_IS_ENUM(_fc, _name) \
320 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc), \
321 _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name), (_fc))
323 #define BT_ASSERT_PRE_DEV_FC_IS_ARRAY(_fc, _name) \
324 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc), \
325 _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name), (_fc))
327 #define BT_ASSERT_PRE_DEV_FC_IS_STRUCT(_fc, _name) \
328 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_STRUCT_COND(_fc), \
329 _BT_ASSERT_PRE_FC_IS_STRUCT_FMT(_name), (_fc))
331 #define BT_ASSERT_PRE_DEV_FC_IS_OPTION(_fc, _name) \
332 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_OPTION_COND(_fc), \
333 _BT_ASSERT_PRE_FC_IS_OPTION_FMT(_name), (_fc))
335 #define BT_ASSERT_PRE_DEV_FC_IS_OPTION_WITH_SEL(_fc, _name) \
336 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_COND(_fc), \
337 _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_FMT(_name), (_fc))
339 #define BT_ASSERT_PRE_DEV_FC_IS_OPTION_WITH_INT_SEL(_fc, _name) \
340 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_COND(_fc), \
341 _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_FMT(_name), (_fc))
343 #define BT_ASSERT_PRE_DEV_FC_IS_VARIANT(_fc, _name) \
344 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_VARIANT_COND(_fc), \
345 _BT_ASSERT_PRE_FC_IS_VARIANT_FMT(_name), (_fc))
347 #define BT_ASSERT_PRE_DEV_FC_IS_VARIANT_WITH_SEL(_fc, _name) \
348 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc), \
349 _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name), (_fc))
351 #define BT_ASSERT_PRE_DEV_FC_HAS_TYPE(_fc, _type, _name) \
352 BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_HAS_TYPE_COND((_fc), (_type)), \
353 _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name), \
354 bt_common_field_class_type_string(_type), (_fc))
356 #define BT_ASSERT_PRE_DEV_FC_HOT(_fc, _name) \
357 BT_ASSERT_PRE_DEV_HOT((const struct bt_field_class *) (_fc), \
358 (_name), ": %!+F", (_fc))
360 #define _BT_ASSERT_PRE_FC_NAME "Field class"
362 #define BT_ASSERT_PRE_FC_NON_NULL(_fc) \
363 BT_ASSERT_PRE_NON_NULL(_fc, _BT_ASSERT_PRE_FC_NAME)
365 #define BT_ASSERT_PRE_DEV_FC_NON_NULL(_fc) \
366 BT_ASSERT_PRE_DEV_NON_NULL(_fc, _BT_ASSERT_PRE_FC_NAME)
368 #define _BT_ASSERT_PRE_STRUCT_FC_MEMBER_NAME "Structure field class member"
370 #define BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(_fc) \
371 BT_ASSERT_PRE_NON_NULL(_fc, _BT_ASSERT_PRE_STRUCT_FC_MEMBER_NAME)
373 #define BT_ASSERT_PRE_DEV_STRUCT_FC_MEMBER_NON_NULL(_fc) \
374 BT_ASSERT_PRE_DEV_NON_NULL(_fc, _BT_ASSERT_PRE_STRUCT_FC_MEMBER_NAME)
376 #define _BT_ASSERT_PRE_VAR_FC_OPT_NAME "Variant field class option"
378 #define BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(_fc) \
379 BT_ASSERT_PRE_NON_NULL(_fc, _BT_ASSERT_PRE_VAR_FC_OPT_NAME)
381 #define BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(_fc) \
382 BT_ASSERT_PRE_DEV_NON_NULL(_fc, _BT_ASSERT_PRE_VAR_FC_OPT_NAME)
384 #define _BT_ASSERT_PRE_FP_NAME "Field path"
386 #define BT_ASSERT_PRE_FP_NON_NULL(_fp) \
387 BT_ASSERT_PRE_NON_NULL(_fp, _BT_ASSERT_PRE_FP_NAME)
389 #define BT_ASSERT_PRE_DEV_FP_NON_NULL(_fp) \
390 BT_ASSERT_PRE_DEV_NON_NULL(_fp, _BT_ASSERT_PRE_FP_NAME)
392 #define BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(_field, _cls_type, _name) \
393 BT_ASSERT_PRE_DEV(((const struct bt_field *) (_field))->class->type == (_cls_type), \
394 _name " has the wrong class type: expected-class-type=%s, " \
396 bt_common_field_class_type_string(_cls_type), (_field))
398 #define BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(_field, _name) \
400 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
401 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, \
402 _name " is not an unsigned integer field: %![field-]+f", \
405 #define BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(_field, _name) \
407 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
408 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
409 _name " is not a signed integer field: %![field-]+f", \
412 #define BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(_field, _name) \
414 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
415 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD || \
416 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD, \
417 _name " is not an array field: %![field-]+f", (_field))
419 #define BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(_field, _name) \
421 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD || \
422 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD, \
423 _name " is not a dynamic array field: %![field-]+f", (_field))
425 #define BT_ASSERT_PRE_DEV_FIELD_IS_OPTION(_field, _name) \
427 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD || \
428 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD || \
429 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
430 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD, \
431 _name " is not an option field: %![field-]+f", (_field))
433 #define BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(_field, _name) \
435 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD || \
436 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \
437 ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, \
438 _name " is not a variant field: %![field-]+f", (_field))
440 #define BT_ASSERT_PRE_DEV_FIELD_IS_SET(_field) \
441 BT_ASSERT_PRE_DEV(bt_field_is_set(_field), \
442 "Field is not set: %!+f", (_field))
444 #define _BT_ASSERT_PRE_FIELD_NAME "Field"
446 #define BT_ASSERT_PRE_FIELD_NON_NULL(_field) \
447 BT_ASSERT_PRE_NON_NULL(_field, _BT_ASSERT_PRE_FIELD_NAME)
449 #define BT_ASSERT_PRE_DEV_FIELD_NON_NULL(_field) \
450 BT_ASSERT_PRE_DEV_NON_NULL(_field, _BT_ASSERT_PRE_FIELD_NAME)
452 #define _BT_ASSERT_PRE_PACKET_NAME "Packet"
454 #define BT_ASSERT_PRE_PACKET_NON_NULL(_packet) \
455 BT_ASSERT_PRE_NON_NULL(_packet, _BT_ASSERT_PRE_PACKET_NAME)
457 #define BT_ASSERT_PRE_DEV_PACKET_NON_NULL(_packet) \
458 BT_ASSERT_PRE_DEV_NON_NULL(_packet, _BT_ASSERT_PRE_PACKET_NAME)
460 #define _BT_ASSERT_PRE_SC_NAME "Stream class"
462 #define BT_ASSERT_PRE_SC_NON_NULL(_sc) \
463 BT_ASSERT_PRE_NON_NULL(_sc, _BT_ASSERT_PRE_SC_NAME)
465 #define BT_ASSERT_PRE_DEV_SC_NON_NULL(_sc) \
466 BT_ASSERT_PRE_DEV_NON_NULL(_sc, _BT_ASSERT_PRE_SC_NAME)
468 #define _BT_ASSERT_PRE_STREAM_NAME "Stream"
470 #define BT_ASSERT_PRE_STREAM_NON_NULL(_stream) \
471 BT_ASSERT_PRE_NON_NULL(_stream, _BT_ASSERT_PRE_STREAM_NAME)
473 #define BT_ASSERT_PRE_DEV_STREAM_NON_NULL(_stream) \
474 BT_ASSERT_PRE_DEV_NON_NULL(_stream, _BT_ASSERT_PRE_STREAM_NAME)
476 #define _BT_ASSERT_PRE_TC_NAME "Trace class"
478 #define BT_ASSERT_PRE_TC_NON_NULL(_tc) \
479 BT_ASSERT_PRE_NON_NULL(_tc, _BT_ASSERT_PRE_TC_NAME)
481 #define BT_ASSERT_PRE_DEV_TC_NON_NULL(_tc) \
482 BT_ASSERT_PRE_DEV_NON_NULL(_tc, _BT_ASSERT_PRE_TC_NAME)
484 #define _BT_ASSERT_PRE_TRACE_NAME "Trace"
486 #define BT_ASSERT_PRE_TRACE_NON_NULL(_trace) \
487 BT_ASSERT_PRE_NON_NULL(_trace, _BT_ASSERT_PRE_TRACE_NAME)
489 #define BT_ASSERT_PRE_DEV_TRACE_NON_NULL(_trace) \
490 BT_ASSERT_PRE_DEV_NON_NULL(_trace, _BT_ASSERT_PRE_TRACE_NAME)
492 #define _BT_ASSERT_PRE_USER_ATTRS_NAME "User attributes"
494 #define BT_ASSERT_PRE_USER_ATTRS_NON_NULL(_ua) \
495 BT_ASSERT_PRE_NON_NULL(_ua, _BT_ASSERT_PRE_USER_ATTRS_NAME)
497 #define BT_ASSERT_PRE_DEV_USER_ATTRS_NON_NULL(_ua) \
498 BT_ASSERT_PRE_DEV_NON_NULL(_ua, _BT_ASSERT_PRE_USER_ATTRS_NAME)
500 #define BT_ASSERT_PRE_USER_ATTRS_IS_MAP(_ua) \
501 BT_ASSERT_PRE((_ua)->type == BT_VALUE_TYPE_MAP, \
502 _BT_ASSERT_PRE_USER_ATTRS_NAME \
503 " object is not a map value object.")
505 #define BT_ASSERT_COND_LISTENER_FUNC_NAME "Listener function"
507 #define BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(_func) \
508 BT_ASSERT_PRE_NON_NULL(_func, BT_ASSERT_COND_LISTENER_FUNC_NAME)
510 #define BT_ASSERT_PRE_DEV_LISTENER_FUNC_NON_NULL(_func) \
511 BT_ASSERT_PRE_DEV_NON_NULL(_func, BT_ASSERT_COND_LISTENER_FUNC_NAME)
513 #define _BT_ASSERT_PRE_MSG_ITER_NAME "Message iterator"
515 #define BT_ASSERT_PRE_MSG_ITER_NON_NULL(_msg_iter) \
516 BT_ASSERT_PRE_NON_NULL(_msg_iter, _BT_ASSERT_PRE_MSG_ITER_NAME)
518 #define BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(_msg_iter) \
519 BT_ASSERT_PRE_DEV_NON_NULL(_msg_iter, _BT_ASSERT_PRE_MSG_ITER_NAME)
521 #define BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(_msg, _sc) \
522 BT_ASSERT_PRE_DEV((_sc)->default_clock_class, \
523 "Message's stream's class has no default clock class: " \
524 "%![msg-]+n, %![sc-]+S", (_msg), (_sc));
526 #define _BT_ASSERT_PRE_MSG_HAS_TYPE_COND(_msg, _type) \
527 (((struct bt_message *) (_msg))->type == (_type))
529 #define _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT \
530 "Message has the wrong type: expected-type=%s, %![msg-]+n"
532 #define BT_ASSERT_PRE_MSG_HAS_TYPE(_msg, _type) \
534 _BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
535 _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \
536 bt_message_type_string(_type), (_msg))
538 #define BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(_msg, _type) \
540 _BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
541 _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \
542 bt_message_type_string(_type), (_msg))
544 #define _BT_ASSERT_PRE_MSG_NAME "Message"
546 #define BT_ASSERT_PRE_MSG_NON_NULL(_msg_iter) \
547 BT_ASSERT_PRE_NON_NULL(_msg_iter, _BT_ASSERT_PRE_MSG_NAME)
549 #define BT_ASSERT_PRE_DEV_MSG_NON_NULL(_msg_iter) \
550 BT_ASSERT_PRE_DEV_NON_NULL(_msg_iter, _BT_ASSERT_PRE_MSG_NAME)
552 #define BT_ASSERT_PRE_MSG_CS_BEGIN_LE_END(_msg_iter, _begin, _end) \
555 "Beginning default clock snapshot value is greater " \
556 "than end default clock snapshot value: " \
557 "cs-begin-val=%" PRIu64 ", cs-end-val=%" PRIu64 ", " \
559 _begin, _end, _msg_iter);
561 #define BT_ASSERT_PRE_DEV_MSG_HOT(_msg) \
562 BT_ASSERT_PRE_DEV_HOT((_msg), "Message", ": %!+n", (_msg));
564 #define _BT_ASSERT_PRE_MSG_ITER_CLS_NAME "Message iterator class"
566 #define BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(_msg_iter_cls) \
567 BT_ASSERT_PRE_NON_NULL(_msg_iter_cls, _BT_ASSERT_PRE_MSG_ITER_CLS_NAME)
569 #define BT_ASSERT_PRE_DEV_MSG_ITER_CLS_NON_NULL(_msg_iter_cls) \
570 BT_ASSERT_PRE_DEV_NON_NULL(_msg_iter_cls, _BT_ASSERT_PRE_MSG_ITER_CLS_NAME)
572 #define _BT_ASSERT_PRE_COMP_CLS_NAME "Component class"
574 #define BT_ASSERT_PRE_COMP_CLS_NON_NULL(_comp_cls) \
575 BT_ASSERT_PRE_NON_NULL(_comp_cls, _BT_ASSERT_PRE_COMP_CLS_NAME)
577 #define BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(_comp_cls) \
578 BT_ASSERT_PRE_DEV_NON_NULL(_comp_cls, _BT_ASSERT_PRE_COMP_CLS_NAME)
580 #define _BT_ASSERT_PRE_COMP_DESCR_SET_NAME "Component descriptor set"
582 #define BT_ASSERT_PRE_COMP_DESCR_SET_NON_NULL(_comp_descr_set) \
583 BT_ASSERT_PRE_NON_NULL(_comp_descr_set, _BT_ASSERT_PRE_COMP_DESCR_SET_NAME)
585 #define BT_ASSERT_PRE_DEV_COMP_DESCR_SET_NON_NULL(_comp_descr_set) \
586 BT_ASSERT_PRE_DEV_NON_NULL(_comp_descr_set, _BT_ASSERT_PRE_COMP_DESCR_SET_NAME)
588 #define _BT_ASSERT_PRE_COMP_NAME "Component"
590 #define BT_ASSERT_PRE_COMP_NON_NULL(_comp) \
591 BT_ASSERT_PRE_NON_NULL(_comp, _BT_ASSERT_PRE_COMP_NAME)
593 #define BT_ASSERT_PRE_DEV_COMP_NON_NULL(_comp) \
594 BT_ASSERT_PRE_DEV_NON_NULL(_comp, _BT_ASSERT_PRE_COMP_NAME)
596 #define _BT_ASSERT_PRE_CONN_NAME "Connection"
598 #define BT_ASSERT_PRE_CONN_NON_NULL(_conn) \
599 BT_ASSERT_PRE_NON_NULL(_conn, _BT_ASSERT_PRE_CONN_NAME)
601 #define BT_ASSERT_PRE_DEV_CONN_NON_NULL(_conn) \
602 BT_ASSERT_PRE_DEV_NON_NULL(_conn, _BT_ASSERT_PRE_CONN_NAME)
604 #define _BT_ASSERT_PRE_GRAPH_NAME "Graph"
606 #define BT_ASSERT_PRE_GRAPH_NON_NULL(_graph) \
607 BT_ASSERT_PRE_NON_NULL(_graph, _BT_ASSERT_PRE_GRAPH_NAME)
609 #define BT_ASSERT_PRE_DEV_GRAPH_NON_NULL(_graph) \
610 BT_ASSERT_PRE_DEV_NON_NULL(_graph, _BT_ASSERT_PRE_GRAPH_NAME)
612 #define _BT_ASSERT_PRE_INTR_NAME "Interrupter"
614 #define BT_ASSERT_PRE_INTR_NON_NULL(_intr) \
615 BT_ASSERT_PRE_NON_NULL(_intr, _BT_ASSERT_PRE_INTR_NAME)
617 #define BT_ASSERT_PRE_DEV_INTR_NON_NULL(_intr) \
618 BT_ASSERT_PRE_DEV_NON_NULL(_intr, _BT_ASSERT_PRE_INTR_NAME)
620 #define _BT_ASSERT_PRE_PORT_NAME "Port"
622 #define BT_ASSERT_PRE_PORT_NON_NULL(_port) \
623 BT_ASSERT_PRE_NON_NULL(_port, _BT_ASSERT_PRE_PORT_NAME)
625 #define BT_ASSERT_PRE_DEV_PORT_NON_NULL(_port) \
626 BT_ASSERT_PRE_DEV_NON_NULL(_port, _BT_ASSERT_PRE_PORT_NAME)
628 #define _BT_ASSERT_PRE_QUERY_EXEC_NAME "Query executor"
630 #define BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(_query_exec) \
631 BT_ASSERT_PRE_NON_NULL(_query_exec, _BT_ASSERT_PRE_QUERY_EXEC_NAME)
633 #define BT_ASSERT_PRE_DEV_QUERY_EXEC_NON_NULL(_query_exec) \
634 BT_ASSERT_PRE_DEV_NON_NULL(_query_exec, _BT_ASSERT_PRE_QUERY_EXEC_NAME)
636 #define _BT_ASSERT_PRE_PLUGIN_SET_NAME "Plugin set"
638 #define BT_ASSERT_PRE_PLUGIN_SET_NON_NULL(_plugin_set) \
639 BT_ASSERT_PRE_NON_NULL(_plugin_set, _BT_ASSERT_PRE_PLUGIN_SET_NAME)
641 #define BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(_plugin_set) \
642 BT_ASSERT_PRE_DEV_NON_NULL(_plugin_set, _BT_ASSERT_PRE_PLUGIN_SET_NAME)
644 #define _BT_ASSERT_PRE_PLUGIN_SET_OUT_NAME \
645 _BT_ASSERT_PRE_PLUGIN_SET_NAME " (output)"
647 #define BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(_plugin_set) \
648 BT_ASSERT_PRE_NON_NULL(_plugin_set, _BT_ASSERT_PRE_PLUGIN_SET_OUT_NAME)
650 #define BT_ASSERT_PRE_DEV_PLUGIN_SET_OUT_NON_NULL(_plugin_set) \
651 BT_ASSERT_PRE_DEV_NON_NULL(_plugin_set, _BT_ASSERT_PRE_PLUGIN_SET_OUT_NAME)
653 #define _BT_ASSERT_PRE_PLUGIN_NAME "Plugin"
655 #define BT_ASSERT_PRE_PLUGIN_NON_NULL(_plugin) \
656 BT_ASSERT_PRE_NON_NULL(_plugin, _BT_ASSERT_PRE_PLUGIN_NAME)
658 #define BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(_plugin) \
659 BT_ASSERT_PRE_DEV_NON_NULL(_plugin, _BT_ASSERT_PRE_PLUGIN_NAME)
661 #define _BT_ASSERT_PRE_PLUGIN_OUT_NAME \
662 _BT_ASSERT_PRE_PLUGIN_NAME " (output)"
664 #define BT_ASSERT_PRE_PLUGIN_OUT_NON_NULL(_plugin) \
665 BT_ASSERT_PRE_NON_NULL(_plugin, _BT_ASSERT_PRE_PLUGIN_OUT_NAME)
667 #define BT_ASSERT_PRE_DEV_PLUGIN_OUT_NON_NULL(_plugin) \
668 BT_ASSERT_PRE_DEV_NON_NULL(_plugin, _BT_ASSERT_PRE_PLUGIN_OUT_NAME)
670 #define _BT_ASSERT_PRE_ERROR_NAME "Error"
672 #define BT_ASSERT_PRE_ERROR_NON_NULL(_error) \
673 BT_ASSERT_PRE_NON_NULL(_error, _BT_ASSERT_PRE_ERROR_NAME)
675 #define BT_ASSERT_PRE_DEV_ERROR_NON_NULL(_error) \
676 BT_ASSERT_PRE_DEV_NON_NULL(_error, _BT_ASSERT_PRE_ERROR_NAME)
678 #define _BT_ASSERT_PRE_ERROR_CAUSE_NAME "Error cause"
680 #define BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(_error_cause) \
681 BT_ASSERT_PRE_NON_NULL(_error_cause, _BT_ASSERT_PRE_ERROR_CAUSE_NAME)
683 #define BT_ASSERT_PRE_DEV_ERROR_CAUSE_NON_NULL(_error_cause) \
684 BT_ASSERT_PRE_DEV_NON_NULL(_error_cause, _BT_ASSERT_PRE_ERROR_CAUSE_NAME)
686 #define _BT_ASSERT_PRE_INT_RANGE_NAME "Integer range"
688 #define BT_ASSERT_PRE_INT_RANGE_NON_NULL(_int_range) \
689 BT_ASSERT_PRE_NON_NULL(_int_range, _BT_ASSERT_PRE_INT_RANGE_NAME)
691 #define BT_ASSERT_PRE_DEV_INT_RANGE_NON_NULL(_int_range) \
692 BT_ASSERT_PRE_DEV_NON_NULL(_int_range, _BT_ASSERT_PRE_INT_RANGE_NAME)
694 #define _BT_ASSERT_PRE_INT_RANGE_SET_NAME "Integer range set"
696 #define BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(_int_range_set) \
697 BT_ASSERT_PRE_NON_NULL(_int_range_set, _BT_ASSERT_PRE_INT_RANGE_SET_NAME)
699 #define BT_ASSERT_PRE_DEV_INT_RANGE_SET_NON_NULL(_int_range_set) \
700 BT_ASSERT_PRE_DEV_NON_NULL(_int_range_set, _BT_ASSERT_PRE_INT_RANGE_SET_NAME)
702 #define _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND(_value, _type) \
703 (((struct bt_value *) (_value))->type == (_type))
705 #define _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT \
706 "Value has the wrong type: expected-type=%s, %![value-]+v"
708 #define BT_ASSERT_PRE_VALUE_HAS_TYPE(_value, _type) \
710 _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND((_value), (_type)), \
711 _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT, \
712 bt_common_value_type_string(_type), (_value))
714 #define BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(_value, _type) \
716 _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND((_value), (_type)), \
717 _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT, \
718 bt_common_value_type_string(_type), (_value))
720 #define _BT_ASSERT_PRE_VALUE_NAME "Value object"
722 #define BT_ASSERT_PRE_VALUE_NON_NULL(_value) \
723 BT_ASSERT_PRE_NON_NULL(_value, _BT_ASSERT_PRE_VALUE_NAME)
725 #define BT_ASSERT_PRE_DEV_VALUE_NON_NULL(_value) \
726 BT_ASSERT_PRE_DEV_NON_NULL(_value, _BT_ASSERT_PRE_VALUE_NAME)
728 #define BT_ASSERT_PRE_PARAM_VALUE_IS_MAP(_value) \
729 BT_ASSERT_PRE(!(_value) || bt_value_is_map(_value), \
730 "Parameter value is not a map value: %!+v", (_value));
732 #define _BT_ASSERT_PRE_RES_OUT_NAME "Result (output)"
734 #define BT_ASSERT_PRE_RES_OUT_NON_NULL(_res) \
735 BT_ASSERT_PRE_NON_NULL(_res, _BT_ASSERT_PRE_RES_OUT_NAME)
737 #define BT_ASSERT_PRE_DEV_RES_OUT_NON_NULL(_res) \
738 BT_ASSERT_PRE_DEV_NON_NULL(_res, _BT_ASSERT_PRE_RES_OUT_NAME)
740 #define BT_ASSERT_PRE_METHOD_NON_NULL(_method) \
741 BT_ASSERT_PRE_NON_NULL(_method, "Method");
743 #define _BT_ASSERT_PRE_NAME_NAME "Name"
745 #define BT_ASSERT_PRE_NAME_NON_NULL(_name) \
746 BT_ASSERT_PRE_NON_NULL(_name, _BT_ASSERT_PRE_NAME_NAME)
748 #define BT_ASSERT_PRE_DEV_NAME_NON_NULL(_name) \
749 BT_ASSERT_PRE_DEV_NON_NULL(_name, _BT_ASSERT_PRE_NAME_NAME)
751 #define _BT_ASSERT_PRE_DESCR_NAME "Description"
753 #define BT_ASSERT_PRE_DESCR_NON_NULL(_descr) \
754 BT_ASSERT_PRE_NON_NULL(_descr, _BT_ASSERT_PRE_DESCR_NAME)
756 #define BT_ASSERT_PRE_DEV_DESCR_NON_NULL(_descr) \
757 BT_ASSERT_PRE_DEV_NON_NULL(_descr, _BT_ASSERT_PRE_DESCR_NAME)
759 #define _BT_ASSERT_PRE_UUID_NAME "UUID"
761 #define BT_ASSERT_PRE_UUID_NON_NULL(_uuid) \
762 BT_ASSERT_PRE_NON_NULL(_uuid, _BT_ASSERT_PRE_UUID_NAME)
764 #define BT_ASSERT_PRE_DEV_UUID_NON_NULL(_uuid) \
765 BT_ASSERT_PRE_DEV_NON_NULL(_uuid, _BT_ASSERT_PRE_UUID_NAME)
767 #define _BT_ASSERT_PRE_KEY_NAME "Key"
769 #define BT_ASSERT_PRE_KEY_NON_NULL(_key) \
770 BT_ASSERT_PRE_NON_NULL(_key, _BT_ASSERT_PRE_KEY_NAME)
772 #define BT_ASSERT_PRE_DEV_KEY_NON_NULL(_key) \
773 BT_ASSERT_PRE_DEV_NON_NULL(_key, _BT_ASSERT_PRE_KEY_NAME)
775 #endif /* BABELTRACE_ASSERT_COND_INTERNAL_H */
This page took 0.044412 seconds and 5 git commands to generate.