diff options
Diffstat (limited to 'tests/gtests/testing/testing.h')
-rw-r--r-- | tests/gtests/testing/testing.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/gtests/testing/testing.h b/tests/gtests/testing/testing.h index 9083654f1d5..1594ed3926c 100644 --- a/tests/gtests/testing/testing.h +++ b/tests/gtests/testing/testing.h @@ -75,4 +75,20 @@ double CosinusBetweenMatrices(const TMat &a, const TMat &b) { } #endif +template <typename T> +inline void EXPECT_EQ_ARRAY(const T *expected, T *actual, const size_t N) { + for(size_t i = 0; i < N; ++i) { + EXPECT_EQ(expected[i], actual[i]); + } +} + +template <typename T> +inline void EXPECT_EQ_ARRAY_ND(const T *expected, T *actual, const size_t N, const size_t D) { + for(size_t i = 0; i < N; ++i) { + for(size_t j = 0; j < D; ++j) { + EXPECT_EQ(expected[i][j], actual[i][j]); + } + } +} + #endif // __BLENDER_TESTING_H__ |