79 | | /* Should be called only in blocks having an instance of |
80 | | CurrentContext. The argument, when not default, should be |
81 | | __LINE__ (and it is included in the returned string). |
82 | | */ |
83 | | static std::string format_context ( int ln = -1 ); |
| 79 | /* Should be called only in blocks having an instance of |
| 80 | CurrentContext. The argument, when not default, should be |
| 81 | __LINE__ (and it is included in the returned string). |
| 82 | */ |
| 83 | static std::string format_context ( int ln = -1 ); |
85 | | template<typename Expected, typename Actual> |
86 | | static void CheckEqualEx ( UnitTest::TestResults& results, |
87 | | Expected const& expected, |
88 | | Actual const& actual, |
89 | | UnitTest::TestDetails const& details ) { |
90 | | if ( ! ( expected == actual ) ) { |
91 | | UnitTest::MemoryOutStream stream; |
92 | | stream << format_context() << "expected " << expected << " but was " << actual; |
| 85 | template<typename Expected, typename Actual> |
| 86 | static void CheckEqualEx ( UnitTest::TestResults& results, |
| 87 | Expected const& expected, |
| 88 | Actual const& actual, |
| 89 | UnitTest::TestDetails const& details ) { |
| 90 | if ( ! ( expected == actual ) ) { |
| 91 | UnitTest::MemoryOutStream stream; |
| 92 | stream << format_context() << "expected " << expected << " but was " << actual; |
98 | | template<typename Expected, typename Actual, typename Tolerance> |
99 | | static void CheckCloseEx ( UnitTest::TestResults& results, |
100 | | Expected const& expected, |
101 | | Actual const& actual, |
102 | | Tolerance const& tolerance, |
103 | | UnitTest::TestDetails const& details ) { |
104 | | if ( !UnitTest::AreClose ( expected, actual, tolerance ) ) { |
105 | | UnitTest::MemoryOutStream stream; |
106 | | stream << format_context() << "expected " << expected << " +/- " << tolerance << " but was " << actual; |
| 98 | template<typename Expected, typename Actual, typename Tolerance> |
| 99 | static void CheckCloseEx ( UnitTest::TestResults& results, |
| 100 | Expected const& expected, |
| 101 | Actual const& actual, |
| 102 | Tolerance const& tolerance, |
| 103 | UnitTest::TestDetails const& details ) { |
| 104 | if ( !UnitTest::AreClose ( expected, actual, tolerance ) ) { |
| 105 | UnitTest::MemoryOutStream stream; |
| 106 | stream << format_context() << "expected " << expected << " +/- " << tolerance << " but was " << actual; |