[#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 &hyphen;&hyphen; used in the implementation of the above macros, and for conversion between `bsl&colon;&colon;string` and `bsl&colon;&colon;wstring`&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;formattestutil&period;h&gt;`

[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&lowbar;t` to `char` and return the resulting `bsl&colon;&colon;string` by value&period; The behavior is undefined unless all of the `wchar&lowbar;t` values in `viewIn` are ascii&period;
| xref:BloombergLP/bdlt/FormatTestUtil/testFormat.adoc[`testFormat`] 
| Compare the specified `exp` to the string result of calling `bsl&colon;&colon;format` with the specified `format` and `value`, and return `true` if they match and `false` otherwise&period; If they do not match, load into the specified `message` a value describing the inputs and result of the failed test&period; Perform these tests for both `char`&hyphen;based and `wchar&lowbar;t`&hyphen;based strings&period;
| xref:BloombergLP/bdlt/FormatTestUtil/testFormatArg.adoc[`testFormatArg`] 
| Compare the specified `exp` to the string result of calling `bsl&colon;&colon;format` with the specified `format`, `value`, and `arg`, and return `true` if they match and `false` otherwise&period; If they do not match, load into the specified `message` a value describing the inputs and result of the failed test&period; Perform these tests for both `char`&hyphen;based and `wchar&lowbar;t`&hyphen;based strings&period;
| xref:BloombergLP/bdlt/FormatTestUtil/widen.adoc[`widen`] 
| Load the `wstring` version of the specified `char`&hyphen;based string view `viewIn` into the specified `result`&period; The behavior is undefined unless all of the `char` values in `viewIn` are ascii&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
