58 ::testing::AssertionResult result = ::testing::AssertionFailure();
59 if (expected.size() != actual.size()) {
60 return result <<
"expected result size=" << expected.size()
61 <<
" differs from actual size=" << actual.size();
63 const unsigned long length = expected.size();
66 const char* separator =
" ";
67 for (
unsigned long index = 0; index < length; index++) {
68 auto expected_real = ::testing::internal::FloatingPoint(expected[index].real());
69 auto expected_imag = ::testing::internal::FloatingPoint(expected[index].imag());
70 auto actual_real = ::testing::internal::FloatingPoint(actual[index].real());
71 auto actual_imag = ::testing::internal::FloatingPoint(actual[index].imag());
72 if (not expected_real.AlmostEquals(actual_real) or
73 not expected_imag.AlmostEquals(actual_imag))
76 if (errorsFound == 0) {
77 result <<
"Differences found:";
79 if (errorsFound < 3) {
80 result << separator << expected[index] <<
" != " << actual[index] <<
" @ "
87 if (errorsFound > 0) {
88 result << separator << errorsFound <<
" differences in total";
91 return ::testing::AssertionSuccess();