MCPcopy Create free account
hub / github.com/CleverRaven/Cataclysm-DDA / test_lvalues

Function test_lvalues

tests/string_formatter_test.cpp:74–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72// Test that supplying `T&&`, `T&` and `const T&` as arguments will work the same.
73template<typename T>
74void test_lvalues( const std::string &expected, const char *const pattern, const T &value )
75{
76 test_for_expected( expected, pattern, T( value ) ); // T &&
77 T lvalue( value );
78 test_for_expected( expected, pattern, lvalue ); // T &
79 // NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
80 const T const_lvalue( value );
81 test_for_expected( expected, pattern, const_lvalue ); // const T &
82}
83// Test whether formatting min and max values of a given type works. Uses old_pattern
84// for raw printf (which is assumed to match type) and new_pattern for use with
85// string_formatter, which may be different (e.g. "%lli" requires a long long int

Callers

nothing calls this directly

Calls 1

test_for_expectedFunction · 0.85

Tested by

no test coverage detected