[#BloombergLP-bdlt-FormatTestUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::FormatTestUtil :relfileprefix: ../../ :mrdocs: This `struct` serves as a namespace for static functions to facilitate testing of formatting of `bdlt` value types ‐‐ used in the implementation of the above macros, and for conversion between `bsl::string` and `bsl::wstring`. == Synopsis Declared in `<bdlt_formattestutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct FormatTestUtil; ---- == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlt/FormatTestUtil/narrow.adoc[`narrow`] | Convert the string referred to by the specified `viewIn` from `wchar_t` to `char` and return the resulting `bsl::string` by value. The behavior is undefined unless all of the `wchar_t` values in `viewIn` are ascii. | xref:BloombergLP/bdlt/FormatTestUtil/testFormat.adoc[`testFormat`] | Compare the specified `exp` to the string result of calling `bsl::format` with the specified `format` and `value`, and return `true` if they match and `false` otherwise. If they do not match, load into the specified `message` a value describing the inputs and result of the failed test. Perform these tests for both `char`‐based and `wchar_t`‐based strings. | xref:BloombergLP/bdlt/FormatTestUtil/testFormatArg.adoc[`testFormatArg`] | Compare the specified `exp` to the string result of calling `bsl::format` with the specified `format`, `value`, and `arg`, and return `true` if they match and `false` otherwise. If they do not match, load into the specified `message` a value describing the inputs and result of the failed test. Perform these tests for both `char`‐based and `wchar_t`‐based strings. | xref:BloombergLP/bdlt/FormatTestUtil/widen.adoc[`widen`] | Load the `wstring` version of the specified `char`‐based string view `viewIn` into the specified `result`. The behavior is undefined unless all of the `char` values in `viewIn` are ascii. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#