BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt::FormatterTestUtil< char > Struct Reference

#include <bslfmt_formattertestutil.h>

Detailed Description

This is a specialization of FormatterTestUtil template for char.

Static Public Member Functions

template<class t_TYPE >
static bool testEvaluateFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value)
 
template<class t_TYPE , class t_ARG >
static bool testEvaluateFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_ONE_ARG fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg)
 
template<class t_TYPE , class t_ARG_1 , class t_ARG_2 >
static bool testEvaluateFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_TWO_ARGS fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_1) arg1, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_2) arg2)
 
template<class t_TYPE >
static bool testEvaluateVFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, bsl::basic_string_view< char > fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value)
 
template<class t_TYPE , class t_ARG >
static bool testEvaluateVFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, bsl::basic_string_view< char > fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg)
 
template<class t_TYPE , class t_ARG_1 , class t_ARG_2 >
static bool testEvaluateVFormat (bsl::string *message, bsl::basic_string_view< char > expectedResult, bool alsoTestOracle, bsl::basic_string_view< char > fmt, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) value, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_1) arg1, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_2) arg2)
 
template<class t_TYPE >
static bool testParseFailure (bsl::string *message, bool alsoTestOracle, bsl::basic_string_view< char > fmt)
 
template<class t_TYPE >
static BSLFMT_FORMATTER_TEST_CONSTEVAL bool testParseFormat (bsl::string *message, bool alsoTestOracle, BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_P fmt)
 
template<class t_TYPE >
static bool testParseVFormat (bsl::string *message, bool alsoTestOracle, bsl::basic_string_view< char > fmt)
 

Member Function Documentation

◆ testEvaluateFormat() [1/3]

template<class t_TYPE >
bool bslfmt::FormatterTestUtil< char >::testEvaluateFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value 
)
static

Compare the specified expectedResult with the result of formatting the specified value with the specified fmt obtained using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also compare the expectedResult with the result of formatting obtained using standard library implementation. Optionally specify arg, arg1 and arg2 to be passed to the formatter as additional arguments. Return true if these strings are equal, otherwise store a description of the error in the specified output message and return false.

Note
Note that fmt is required to be a compile time constant expression.

◆ testEvaluateFormat() [2/3]

template<class t_TYPE , class t_ARG >
bool bslfmt::FormatterTestUtil< char >::testEvaluateFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_ONE_ARG  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG)  arg 
)
static

◆ testEvaluateFormat() [3/3]

template<class t_TYPE , class t_ARG_1 , class t_ARG_2 >
bool bslfmt::FormatterTestUtil< char >::testEvaluateFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_TWO_ARGS  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_1)  arg1,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_2)  arg2 
)
static

◆ testEvaluateVFormat() [1/3]

template<class t_TYPE >
bool bslfmt::FormatterTestUtil< char >::testEvaluateVFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
bsl::basic_string_view< char >  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value 
)
static

Compare the specified expectedResult with the result of formatting the specified value with the specified fmt obtained using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also compare the expectedResult with the result of formatting obtained using standard library implementation. Optionally specify arg, arg1 and arg2 to be passed to the formatter as additional arguments. Return true if these strings are equal, otherwise store a description of the error in the specified output message and return false.

Note
Note that fmt is NOT required to be a compile time constant expression.

◆ testEvaluateVFormat() [2/3]

template<class t_TYPE , class t_ARG >
bool bslfmt::FormatterTestUtil< char >::testEvaluateVFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
bsl::basic_string_view< char >  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG)  arg 
)
static

◆ testEvaluateVFormat() [3/3]

template<class t_TYPE , class t_ARG_1 , class t_ARG_2 >
bool bslfmt::FormatterTestUtil< char >::testEvaluateVFormat ( bsl::string message,
bsl::basic_string_view< char >  expectedResult,
bool  alsoTestOracle,
bsl::basic_string_view< char >  fmt,
BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE)  value,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_1)  arg1,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG_2)  arg2 
)
static

◆ testParseFailure()

template<class t_TYPE >
bool bslfmt::FormatterTestUtil< char >::testParseFailure ( bsl::string message,
bool  alsoTestOracle,
bsl::basic_string_view< char >  fmt 
)
static

Verify that the specified fmt has a valid structure and, if so, parse it using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also parse fmt using a standard library implementation. Return true if fmt is valid and the exception IS thrown during the parsing, and return false otherwise.

◆ testParseFormat()

template<class t_TYPE >
BSLFMT_FORMATTER_TEST_CONSTEVAL bool bslfmt::FormatterTestUtil< char >::testParseFormat ( bsl::string message,
bool  alsoTestOracle,
BSLFMT_FORMATTER_TEST_UTIL_FORMAT_STRING_P  fmt 
)
static

Verify that the specified fmt has a valid structure and, if so, parse it using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also parse the fmt using a standard library implementation. Return true if the fmt is valid and the exception is NOT thrown during the parsing, and return false otherwise.

Note
Note that fmt is required to be a compile time constant expression.

◆ testParseVFormat()

template<class t_TYPE >
bool bslfmt::FormatterTestUtil< char >::testParseVFormat ( bsl::string message,
bool  alsoTestOracle,
bsl::basic_string_view< char >  fmt 
)
static

Verify that the specified fmt has a valid structure and, if so, parse it using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also parse the fmt using a standard library implementation. Return true if the fmt is valid and the exception is NOT thrown during the parsing, and return false otherwise.

Note
Note that fmt can be determined at runtime.

The documentation for this struct was generated from the following file: