From 5428ad40e8873664c61a65f73ca16f9d3c71cd74 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 28 Dec 2020 17:22:37 +0100 Subject: Test: Add utility to do near comparison for float[2] --- tests/gtests/testing/testing.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/gtests/testing/testing.h b/tests/gtests/testing/testing.h index 8136a93314e..81ff4470221 100644 --- a/tests/gtests/testing/testing.h +++ b/tests/gtests/testing/testing.h @@ -16,6 +16,13 @@ const std::string &flags_test_release_dir(); /* bin/{blender version} in the bui } // namespace blender::tests +#define EXPECT_V2_NEAR(a, b, eps) \ + { \ + EXPECT_NEAR(a[0], b[0], eps); \ + EXPECT_NEAR(a[1], b[1], eps); \ + } \ + (void)0 + #define EXPECT_V3_NEAR(a, b, eps) \ { \ EXPECT_NEAR(a[0], b[0], eps); \ -- cgit v1.2.3