BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlat_fuzzutil.h
Go to the documentation of this file.
1/// @file bdlat_fuzzutil.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlat_fuzzutil.h -*-C++-*-
8#ifndef INCLUDED_BDLAT_FUZZUTIL
9#define INCLUDED_BDLAT_FUZZUTIL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlat_fuzzutil bdlat_fuzzutil
15/// @brief Provide fuzz test utilities for `bdlat`-types.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlat
19/// @{
20/// @addtogroup bdlat_fuzzutil
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlat_fuzzutil-purpose"> Purpose</a>
25/// * <a href="#bdlat_fuzzutil-classes"> Classes </a>
26/// * <a href="#bdlat_fuzzutil-description"> Description </a>
27/// * <a href="#bdlat_fuzzutil-usage"> Usage </a>
28/// * <a href="#bdlat_fuzzutil-example-1-creating-a-message"> Example 1: Creating a Message </a>
29///
30/// # Purpose {#bdlat_fuzzutil-purpose}
31/// Provide fuzz test utilities for `bdlat`-types.
32///
33/// # Classes {#bdlat_fuzzutil-classes}
34///
35/// - bdlat::FuzzUtil: functions to create messages from fuzz data
36///
37/// @see bslim_fuzzdataview, bslim_fuzzutil
38///
39/// # Description {#bdlat_fuzzutil-description}
40/// This component provides a namespace, `bdlat::FuzzUtil`,
41/// containing functions that create `bdlat` message types from fuzz data
42/// provided by a fuzz harness (e.g., `libFuzzer`).
43///
44/// Effectively, given a random sequence of bytes provided by a fuzz harness,
45/// like `libFuzzer`, this component can be used to populate a
46/// `bdlat`-compatible message with arbitrary data determined by that random
47/// sequence. This can be used to fuzz test an interface (like a service
48/// interface) taking a `bdlat`-compatible message. See the
49/// [BDE fuzz-testing guide](https://bloomberg.github.io/bde/articles/fuzz_testing.html)
50/// for more detail.
51///
52/// ## Usage {#bdlat_fuzzutil-usage}
53///
54///
55/// This section illustrates intended use of this component.
56///
57/// ### Example 1: Creating a Message {#bdlat_fuzzutil-example-1-creating-a-message}
58///
59///
60/// Suppose we have a message type `MyMessage` and we wish to fuzz test it.
61///
62/// We have to provide a function like this for libFuzzer:
63/// @code
64/// extern "C"
65/// int LLVMFuzzerTestOneInput(const uint8_t *bytes, size_t size)
66/// {
67/// bslim::FuzzDataView fuzzData(bytes, size);
68///
69/// MyMessage msg;
70/// bdlat::FuzzUtil::consumeMessage(&msg, &fuzzData);
71/// // Use `msg`...
72///
73/// return 0;
74/// }
75/// @endcode
76/// After the `FuzzUtil::consumeMessage` call, the `msg` object contains a
77/// well-formed message, which can then be serialized or processed in another
78/// way.
79/// @}
80/** @} */
81/** @} */
82
83/** @addtogroup bdl
84 * @{
85 */
86/** @addtogroup bdlat
87 * @{
88 */
89/** @addtogroup bdlat_fuzzutil
90 * @{
91 */
92
93#include <bslscm_version.h>
94
98#include <bdlat_enumfunctions.h>
102#include <bdlat_typecategory.h>
103
104#include <bdldfp_decimal.h>
105
106#include <bdlt_fuzzutil.h>
107
108#include <bslim_fuzzdataview.h>
109#include <bslim_fuzzutil.h>
110
111#include <bslmf_assert.h>
112
113#include <bsls_platform.h>
114
115#include <bsl_limits.h>
116#include <bsl_type_traits.h>
117
118
119namespace bdlat {
120
121 // ==========================
122 // class FuzzUtil_Manipulator
123 // ==========================
124
125/// A generic functor (manipulator) with function call operators that match the
126/// signature expected by the `bdlat_*Functions::manipulate*` operations.
127///
128/// See @ref bdlat_fuzzutil
130 // PUBLIC DATA
133
134 // MANIPULATORS
135
136 /// Call `FuzzUtil::consume(object, fuzzData)`. Return 0.
137 template <class t_TYPE>
138 int operator()(t_TYPE *object);
139
140 /// Call `FuzzUtil::consume(object, fuzzData)`. Return 0.
141 template <class t_TYPE, class t_INFO>
142 int operator()(t_TYPE *object, const t_INFO&);
143};
144
145 // ======================================
146 // class FuzzUtil_ManipulatorWithCategory
147 // ======================================
148
149/// A generic functor (manipulator) with a function call operator that matches
150/// the signature expected by the
151/// `bdlat_TypeCategoryUtil::manipulateByCategory` operation.
152///
153/// See @ref bdlat_fuzzutil
155 // PUBLIC DATA
158
159 // MANIPULATORS
160
161 /// Call `FuzzUtil::consume(object, fuzzData)`. Return 0.
162 template <class t_TYPE, class t_CATEGORY_TAG>
163 int operator()(t_TYPE *object, t_CATEGORY_TAG);
164};
165
166 // ==============
167 // class FuzzUtil
168 // ==============
169
170/// This utility `class` provides a namespace for a suite of functions
171/// operating on objects of type `bslim::FuzzDataView` and providing the
172/// consumption of fuzz data bytes into `bdlat`-compatible types.
173///
174/// See @ref bdlat_fuzzutil
175class FuzzUtil {
176 // PRIVATE TYPES
177 template <class t_TYPE, bdlat_TypeCategory::Value t_VALUE>
178 struct EnableIf : bsl::enable_if<
179 static_cast<bdlat_TypeCategory::Value>(
180 bdlat_TypeCategory::Select<t_TYPE>::e_SELECTION) == t_VALUE> {
181 };
182
183 // PRIVATE CLASS METHODS
184
185 /// Initialize the specified `object` with a value generated using the
186 /// specified `fuzzData` and the specified `options`.
187 template <class t_ARRAY>
188 static typename EnableIf<t_ARRAY,
190 consume(t_ARRAY *object,
191 bslim::FuzzDataView *fuzzData,
192 const FuzzUtilOptions *options);
193 template <class t_CHOICE>
194 static typename EnableIf<t_CHOICE,
196 consume(t_CHOICE *object,
197 bslim::FuzzDataView *fuzzData,
198 const FuzzUtilOptions *options);
199 template <class t_CUSTOMIZED>
200 static typename EnableIf<t_CUSTOMIZED,
202 consume(t_CUSTOMIZED *object,
203 bslim::FuzzDataView *fuzzData,
204 const FuzzUtilOptions *options);
205 template <class t_DYNAMIC>
206 static typename EnableIf<t_DYNAMIC,
208 consume(t_DYNAMIC *object,
209 bslim::FuzzDataView *fuzzData,
210 const FuzzUtilOptions *options);
211 template <class t_ENUM>
212 static typename EnableIf<t_ENUM,
214 consume(t_ENUM *object,
215 bslim::FuzzDataView *fuzzData,
216 const FuzzUtilOptions *options);
217 template <class t_NULLABLE>
218 static typename EnableIf<t_NULLABLE,
220 consume(t_NULLABLE *object,
221 bslim::FuzzDataView *fuzzData,
222 const FuzzUtilOptions *options);
223 template <class t_SEQUENCE>
224 static typename EnableIf<t_SEQUENCE,
226 consume(t_SEQUENCE *object,
227 bslim::FuzzDataView *fuzzData,
228 const FuzzUtilOptions *options);
229 template <class t_SIMPLE>
230 static typename EnableIf<t_SIMPLE,
232 consume(t_SIMPLE *object,
233 bslim::FuzzDataView *fuzzData,
234 const FuzzUtilOptions *options);
235 static void
236 consume(bsl::vector<char> *object,
237 bslim::FuzzDataView *fuzzData,
238 const FuzzUtilOptions *options);
239
240 /// Initialize the specified `object` with a value generated using the
241 /// specified `fuzzData` and the specified `options`.
242 template<class t_NUMBER>
243 static typename bsl::enable_if<
246 consumeSimple(t_NUMBER *object,
247 bslim::FuzzDataView *fuzzData,
248 const FuzzUtilOptions *options);
249 static void consumeSimple(bdldfp::Decimal64 *object,
250 bslim::FuzzDataView *fuzzData,
251 const FuzzUtilOptions *options);
252 static void consumeSimple(bool *object,
253 bslim::FuzzDataView *fuzzData,
254 const FuzzUtilOptions *options);
255 static void consumeSimple(bsl::string *object,
256 bslim::FuzzDataView *fuzzData,
257 const FuzzUtilOptions *options);
258 static void consumeSimple(bsl::vector<char> *object,
259 bslim::FuzzDataView *fuzzData,
260 const FuzzUtilOptions *options);
261 static void consumeSimple(bdlt::Date *object,
262 bslim::FuzzDataView *fuzzData,
263 const FuzzUtilOptions *options);
264 static void consumeSimple(bdlt::DateTz *object,
265 bslim::FuzzDataView *fuzzData,
266 const FuzzUtilOptions *options);
267 static void consumeSimple(bdlt::Datetime *object,
268 bslim::FuzzDataView *fuzzData,
269 const FuzzUtilOptions *options);
270 static void consumeSimple(bdlt::DatetimeTz *object,
271 bslim::FuzzDataView *fuzzData,
272 const FuzzUtilOptions *options);
273 static void consumeSimple(bdlt::Time *object,
274 bslim::FuzzDataView *fuzzData,
275 const FuzzUtilOptions *options);
276 static void consumeSimple(bdlt::TimeTz *object,
277 bslim::FuzzDataView *fuzzData,
278 const FuzzUtilOptions *options);
279
280 // FRIENDS
281 friend struct FuzzUtil_Manipulator;
283 public:
284 // CLASS METHODS
285
286 /// Load into the specified `message` content generated using bytes from
287 /// the specified `fuzzData`, and update `fuzzData` to reflect the bytes
288 /// consumed. Optionally specify an `options` to customize the generated
289 /// values. If `options` is not supplied, default values for the options
290 /// are used. In general, this operation uses `fuzzData` to load the root
291 /// message element, and then recursively applies `consumeMessage` to any
292 /// child elements. More specifically:
293 ///
294 /// * sequence types: recursively `consumeMessage` on each of the elements
295 /// of the sequence
296 /// * array types: use `fuzzData` to determine the size of the array, use
297 /// `consumeMessage` on each of the elements in the array
298 /// * choice types: use `fuzzData` to select the active element of the
299 /// choice, and then recursively `consumeMessage` for that element
300 /// * nullable values: use `fuzzData` to select whether the object contains
301 /// a value, and if it is engaged, recursively `consumeMessage` on it.
302 /// * customized and dynamic types: recursively `consumeMessage` on the
303 /// underlying value.
304 ///
305 /// `t_MESSAGE` must be a `bdlat`-compatible type.
306 template <class t_MESSAGE>
307 static void consumeMessage(t_MESSAGE *message,
308 bslim::FuzzDataView *fuzzData);
309 template <class t_MESSAGE>
310 static void consumeMessage(t_MESSAGE *message,
311 bslim::FuzzDataView *fuzzData,
312 const FuzzUtilOptions& options);
313};
314
315// ============================================================================
316// INLINE DEFINITIONS
317// ============================================================================
318
319 // --------------------------
320 // class FuzzUtil_Manipulator
321 // --------------------------
322
323// MANIPULATORS
324template <class t_TYPE>
325inline
327{
328 FuzzUtil::consume(object, fuzzData, options);
329 return 0;
330}
331
332template <class t_TYPE, class t_INFO>
333inline
334int FuzzUtil_Manipulator::operator()(t_TYPE *object, const t_INFO&)
335{
336 return (*this)(object);
337}
338
339 // --------------------------------------
340 // class FuzzUtil_ManipulatorWithCategory
341 // --------------------------------------
342
343// MANIPULATORS
344template <class t_TYPE, class t_CATEGORY_TAG>
345inline
347 t_CATEGORY_TAG )
348{
349 FuzzUtil::consume(object, fuzzData, options);
350 return 0;
351}
352
353 // --------------
354 // class FuzzUtil
355 // --------------
356
357// PRIVATE CLASS METHODS
358template <class t_ARRAY>
359inline
360typename FuzzUtil::EnableIf<t_ARRAY,
362FuzzUtil::consume(t_ARRAY *object,
363 bslim::FuzzDataView *fuzzData,
364 const FuzzUtilOptions *options)
365{
366 unsigned maxSize = options ? options->maxArrayLength()
368 const unsigned maxInt = static_cast<unsigned>(
369 bsl::numeric_limits<int>::max());
370 if (maxSize > maxInt) {
371 maxSize = maxInt;
372 }
373 unsigned newSize = bslim::FuzzUtil::consumeNumberInRange<unsigned>(
374 fuzzData,
375 0U,
376 maxSize);
377 bsl::size_t size = bdlat_ArrayFunctions::size(*object);
378 if (newSize != size) {
379 bdlat_ArrayFunctions::resize(object, static_cast<int>(newSize));
380 FuzzUtil_Manipulator manipulator = {fuzzData, options};
381 // init added elements
382 for(; size < newSize; size++) {
384 manipulator,
385 static_cast<int>(size));
386 }
387 }
388}
389
390template <class t_CHOICE>
391inline
392typename FuzzUtil::EnableIf<t_CHOICE,
394FuzzUtil::consume(t_CHOICE *object,
395 bslim::FuzzDataView *fuzzData,
396 const FuzzUtilOptions *options)
397{
399 int selectionIndex = bslim::FuzzUtil::consumeNumberInRange<int>(
400 fuzzData,
401 0,
402 t_CHOICE::NUM_SELECTIONS - 1);
403 int selectionId = t_CHOICE::SELECTION_INFO_ARRAY[selectionIndex].id();
404 if (object->makeSelection(selectionId) == 0) {
405 FuzzUtil_Manipulator manipulator = {fuzzData, options};
406 object->manipulateSelection(manipulator);
407 }
408}
409
410template <class t_CUSTOMIZED>
411inline
412typename FuzzUtil::EnableIf<t_CUSTOMIZED,
414FuzzUtil::consume(t_CUSTOMIZED *object,
415 bslim::FuzzDataView *fuzzData,
416 const FuzzUtilOptions *options)
417{
418 FuzzUtil_Manipulator manipulator = {fuzzData, options};
420}
421
422template <class t_DYNAMIC>
423inline
424typename FuzzUtil::EnableIf<t_DYNAMIC,
426FuzzUtil::consume(t_DYNAMIC *object,
427 bslim::FuzzDataView *fuzzData,
428 const FuzzUtilOptions *options)
429{
430 FuzzUtil_ManipulatorWithCategory manipulator = {fuzzData, options};
432}
433
434template <class t_ENUM>
435inline
436typename FuzzUtil::EnableIf<t_ENUM,
438FuzzUtil::consume(t_ENUM *object,
439 bslim::FuzzDataView *fuzzData,
440 const FuzzUtilOptions *)
441{
443 typedef typename bdlat_BasicEnumerationWrapper<t_ENUM>::Wrapper Wrapper;
444 int index = bslim::FuzzUtil::consumeNumberInRange<int>(
445 fuzzData,
446 0,
447 Wrapper::NUM_ENUMERATORS - 1);
448 int intValue = Wrapper::ENUMERATOR_INFO_ARRAY[index].value();
449 Wrapper::fromInt(object, intValue);
450}
451
452template <class t_NULLABLE>
453inline
454typename FuzzUtil::EnableIf<t_NULLABLE,
456FuzzUtil::consume(t_NULLABLE *object,
457 bslim::FuzzDataView *fuzzData,
458 const FuzzUtilOptions *options)
459{
460 bool addValue = bslim::FuzzUtil::consumeBool(fuzzData);
461 if (addValue) {
463 FuzzUtil_Manipulator manipulator = {fuzzData, options};
465 }
466}
467
468template <class t_SEQUENCE>
469inline
470typename FuzzUtil::EnableIf<t_SEQUENCE,
472FuzzUtil::consume(t_SEQUENCE *object,
473 bslim::FuzzDataView *fuzzData,
474 const FuzzUtilOptions *options)
475{
476 FuzzUtil_Manipulator manipulator = {fuzzData, options};
478}
479
480template <class t_SIMPLE>
481inline
482typename FuzzUtil::EnableIf<t_SIMPLE,
484FuzzUtil::consume(t_SIMPLE *object,
485 bslim::FuzzDataView *fuzzData,
486 const FuzzUtilOptions *options)
487{
488 consumeSimple(object, fuzzData, options);
489}
490
491inline
492void FuzzUtil::consume(bsl::vector<char> *object,
493 bslim::FuzzDataView *fuzzData,
494 const FuzzUtilOptions *options)
495{
496 consumeSimple(object, fuzzData, options);
497}
498
499template<class t_NUMBER>
500inline
501typename bsl::enable_if<
504FuzzUtil::consumeSimple(t_NUMBER *number,
505 bslim::FuzzDataView *fuzzData,
506 const FuzzUtilOptions *)
507{
508 *number = bslim::FuzzUtil::consumeNumber<t_NUMBER>(fuzzData);
509}
510
511inline
512void FuzzUtil::consumeSimple(bdldfp::Decimal64 *number,
513 bslim::FuzzDataView *fuzzData,
514 const FuzzUtilOptions *)
515{
516 *number = bdldfp::Decimal64(
517 bslim::FuzzUtil::consumeNumber<double>(fuzzData));
518}
519
520inline
521void FuzzUtil::consumeSimple(bool *boolean,
522 bslim::FuzzDataView *fuzzData,
523 const FuzzUtilOptions *)
524{
525 *boolean = bslim::FuzzUtil::consumeBool(fuzzData);
526}
527
528inline
529void FuzzUtil::consumeSimple(bsl::string *chars,
530 bslim::FuzzDataView *fuzzData,
531 const FuzzUtilOptions *options)
532{
533 unsigned maxLen = options ? options->maxStringLength()
535 bool asciiOnly = options
536 ? options->printableAsciiCharsOnly()
538 if (asciiOnly) {
540 fuzzData,
541 maxLen);
542 }
543 else {
544 bslim::FuzzUtil::consumeRandomLengthString(chars, fuzzData, maxLen);
545 }
546}
547
548inline
549void FuzzUtil::consumeSimple(bsl::vector<char> *chars,
550 bslim::FuzzDataView *fuzzData,
551 const FuzzUtilOptions *options)
552{
553 unsigned maxLen = options ? options->maxStringLength()
555 bslim::FuzzUtil::consumeRandomLengthChars(chars, fuzzData, maxLen);
556}
557
558inline
559void FuzzUtil::consumeSimple(bdlt::Date *date,
560 bslim::FuzzDataView *fuzzData,
561 const FuzzUtilOptions *)
562{
563 *date = bdlt::FuzzUtil::consumeDate(fuzzData);
564}
565
566inline
567void FuzzUtil::consumeSimple(bdlt::DateTz *date,
568 bslim::FuzzDataView *fuzzData,
569 const FuzzUtilOptions *)
570{
571 *date = bdlt::FuzzUtil::consumeDateTz(fuzzData);
572}
573
574inline
575void FuzzUtil::consumeSimple(bdlt::Datetime *datetime,
576 bslim::FuzzDataView *fuzzData,
577 const FuzzUtilOptions *)
578{
579 *datetime = bdlt::FuzzUtil::consumeDatetime(fuzzData);
580}
581
582inline
583void FuzzUtil::consumeSimple(bdlt::DatetimeTz *datetime,
584 bslim::FuzzDataView *fuzzData,
585 const FuzzUtilOptions *)
586{
587 *datetime = bdlt::FuzzUtil::consumeDatetimeTz(fuzzData);
588}
589
590inline
591void FuzzUtil::consumeSimple(bdlt::Time *time,
592 bslim::FuzzDataView *fuzzData,
593 const FuzzUtilOptions *)
594{
595 *time = bdlt::FuzzUtil::consumeTime(fuzzData);
596}
597
598inline
599void FuzzUtil::consumeSimple(bdlt::TimeTz *time,
600 bslim::FuzzDataView *fuzzData,
601 const FuzzUtilOptions *)
602{
603 *time = bdlt::FuzzUtil::consumeTimeTz(fuzzData);
604}
605
606// CLASS METHODS
607template <class t_MESSAGE>
608void FuzzUtil::consumeMessage(t_MESSAGE *message,
609 bslim::FuzzDataView *fuzzData)
610{
611 consume(message, fuzzData, 0);
612}
613
614template <class t_MESSAGE>
615void FuzzUtil::consumeMessage(t_MESSAGE *message,
616 bslim::FuzzDataView *fuzzData,
617 const FuzzUtilOptions& options)
618{
619 consume(message, fuzzData, &options);
620}
621
622} // close package namespace
623
624
625#endif
626
627// ----------------------------------------------------------------------------
628// Copyright 2024 Bloomberg Finance L.P.
629//
630// Licensed under the Apache License, Version 2.0 (the "License");
631// you may not use this file except in compliance with the License.
632// You may obtain a copy of the License at
633//
634// http://www.apache.org/licenses/LICENSE-2.0
635//
636// Unless required by applicable law or agreed to in writing, software
637// distributed under the License is distributed on an "AS IS" BASIS,
638// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
639// See the License for the specific language governing permissions and
640// limitations under the License.
641// ----------------------------- END-OF-FILE ----------------------------------
642
643/** @} */
644/** @} */
645/** @} */
Definition bdlat_fuzzutiloptions.h:67
static const bool k_PRINTABLE_ASCII_CHARS_ONLY_DEFAULT
Definition bdlat_fuzzutiloptions.h:79
static const unsigned k_MAX_STRING_LENGTH_DEFAULT
Definition bdlat_fuzzutiloptions.h:78
static const unsigned k_MAX_ARRAY_LENGTH_DEFAULT
Default values.
Definition bdlat_fuzzutiloptions.h:77
unsigned maxArrayLength() const
Return the maximum array length.
Definition bdlat_fuzzutiloptions.h:158
Definition bdlat_fuzzutil.h:175
static void consumeMessage(t_MESSAGE *message, bslim::FuzzDataView *fuzzData)
Definition bdlat_fuzzutil.h:608
friend struct FuzzUtil_ManipulatorWithCategory
Definition bdlat_fuzzutil.h:282
friend struct FuzzUtil_Manipulator
Definition bdlat_fuzzutil.h:281
Definition bdldfp_decimal.h:1890
Definition bdlt_datetz.h:161
Definition bdlt_date.h:294
Definition bdlt_datetimetz.h:308
Definition bdlt_datetime.h:330
Definition bdlt_timetz.h:190
Definition bdlt_time.h:195
Definition bslstl_string.h:1252
Definition bslstl_vector.h:1120
Definition bslim_fuzzdataview.h:130
static int manipulateByCategory(TYPE *object, MANIPULATOR &manipulator)
Definition bdlat_typecategory.h:1414
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
int manipulateElement(TYPE *array, MANIPULATOR &manipulator, int index)
void resize(TYPE *array, int newSize)
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
int selectionId(const TYPE &object)
int createBaseAndConvert(t_TYPE *object, t_MANIPULATOR &baseManipulator)
int manipulateValue(TYPE *object, MANIPULATOR &manipulator)
void makeValue(TYPE *object)
int manipulateAttributes(TYPE *object, MANIPULATOR &manipulator)
Definition bdlat_arrayutil.h:198
Decimal_Type64 Decimal64
Definition bdldfp_decimal.h:750
Definition bdlat_fuzzutil.h:154
int operator()(t_TYPE *object, t_CATEGORY_TAG)
Call FuzzUtil::consume(object, fuzzData). Return 0.
Definition bdlat_fuzzutil.h:346
bslim::FuzzDataView * fuzzData
Definition bdlat_fuzzutil.h:156
const FuzzUtilOptions * options
Definition bdlat_fuzzutil.h:157
Definition bdlat_fuzzutil.h:129
int operator()(t_TYPE *object)
Call FuzzUtil::consume(object, fuzzData). Return 0.
Definition bdlat_fuzzutil.h:326
const FuzzUtilOptions * options
Definition bdlat_fuzzutil.h:132
bslim::FuzzDataView * fuzzData
Definition bdlat_fuzzutil.h:131
Definition bdlat_typetraits.h:155
This trait may be declared for "choice" types.
Definition bdlat_typetraits.h:111
This trait may be declared for "enumeration" types.
Definition bdlat_typetraits.h:123
@ e_ARRAY_CATEGORY
Definition bdlat_typecategory.h:1048
@ e_DYNAMIC_CATEGORY
Definition bdlat_typecategory.h:1047
@ e_CHOICE_CATEGORY
Definition bdlat_typecategory.h:1049
@ e_SEQUENCE_CATEGORY
Definition bdlat_typecategory.h:1053
@ e_SIMPLE_CATEGORY
Definition bdlat_typecategory.h:1054
@ e_CUSTOMIZED_TYPE_CATEGORY
Definition bdlat_typecategory.h:1050
@ e_NULLABLE_VALUE_CATEGORY
Definition bdlat_typecategory.h:1052
@ e_ENUMERATION_CATEGORY
Definition bdlat_typecategory.h:1051
static bdlt::Date consumeDate(bslim::FuzzDataView *fuzzDataView)
Definition bdlt_fuzzutil.h:235
static Time consumeTime(bslim::FuzzDataView *fuzzDataView)
static DatetimeTz consumeDatetimeTz(bslim::FuzzDataView *fuzzDataView)
static Datetime consumeDatetime(bslim::FuzzDataView *fuzzDataView)
static TimeTz consumeTimeTz(bslim::FuzzDataView *fuzzDataView)
static DateTz consumeDateTz(bslim::FuzzDataView *fuzzDataView)
Definition bslmf_enableif.h:530
Definition bslmf_isfloatingpoint.h:144
Definition bslmf_isintegral.h:140
static void consumeRandomLengthChars(bsl::vector< char > *output, FuzzDataView *fuzzDataView, bsl::size_t maxLength)
static void consumeRandomLengthAsciiString(bsl::string *output, FuzzDataView *fuzzDataView, bsl::size_t maxLength)
static bool consumeBool(FuzzDataView *fuzzDataView)
Definition bslim_fuzzutil.h:289
static void consumeRandomLengthString(bsl::string *output, FuzzDataView *fuzzDataView, bsl::size_t maxLength)