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>

struct FormatTestUtil;

Static Member Functions

Name

Description

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.

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.

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.

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.

Created with MrDocs