summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <bbn@mjolner.dk>2020-11-04 11:23:43 +0100
committerBent Bisballe Nyeng <bbn@mjolner.dk>2020-11-04 11:24:00 +0100
commitc5de72efd46a2f779fda176268b0ccef9e532341 (patch)
treec4271c4eb50212225c988a06dd254cca9ac23b01
parentd178d57ea1dfb6ff8cafadeb61790dd894c26dcb (diff)
Allow for comparison of differrent types in assert_equal and pass arguments by reference.
-rw-r--r--uunit.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/uunit.h b/uunit.h
index 447d27a..f11fa1c 100644
--- a/uunit.h
+++ b/uunit.h
@@ -206,8 +206,9 @@ protected:
throw test_result{"", file, line, ss.str()};
}
}
- template<typename T>
- void assert_equal(T expected, T value,
+
+ template<typename T, typename U>
+ void assert_equal(const T& expected, const U& value,
const char* file, std::size_t line)
{
if(expected != value)