MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / createBinaryMessage

Function createBinaryMessage

Source/Falcor/Testing/UnitTest.h:502–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500/// If the failedOpStr is not set, it means it hasn't failed
501template<typename TCmpHelper, typename TLhs, typename TRhs>
502inline std::optional<std::string> createBinaryMessage(std::string_view lhsStr, std::string_view rhsStr, const TLhs& lhs, const TRhs& rhs)
503{
504 // don't bother creating message when it won't be used
505 if (TCmpHelper::compare(lhs, rhs))
506 return std::optional<std::string>{};
507 size_t maxSize = std::max(lhsStr.size(), rhsStr.size());
508 return fmt::format(
509 "Expected: ({}) {} ({}), actual:\n {:<{}} = {}\n {:<{}} = {}",
510 lhsStr,
511 TCmpHelper::asString(),
512 rhsStr,
513 lhsStr,
514 maxSize,
515 lhs,
516 rhsStr,
517 maxSize,
518 rhs
519 );
520}
521
522#define FTEST_TEST_BINARY(opHelper, lhs, rhs, userFailMsg, asserts) \
523 FTEST_MESSAGE(::Falcor::unittest::createBinaryMessage<::Falcor::unittest::opHelper>(#lhs, #rhs, lhs, rhs), userFailMsg, asserts)

Callers

nothing calls this directly

Calls 3

compareFunction · 0.85
maxFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected