summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/json/test/ryu/gtest.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/json/test/ryu/gtest.hpp')
-rw-r--r--src/boost/libs/json/test/ryu/gtest.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/boost/libs/json/test/ryu/gtest.hpp b/src/boost/libs/json/test/ryu/gtest.hpp
new file mode 100644
index 000000000..582cebe21
--- /dev/null
+++ b/src/boost/libs/json/test/ryu/gtest.hpp
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// Official repository: https://github.com/boostorg/json
+//
+
+#ifndef GTEST_HPP
+#define GTEST_HPP
+
+#include <boost/json/detail/config.hpp>
+#include <boost/json/string_view.hpp>
+
+#include "test_suite.hpp"
+
+#define TEST(s1,s2) \
+struct s1 ## _ ## s2 ## _test; \
+TEST_SUITE(s1 ## _ ## s2 ## _test, "boost.Ryu." #s1 "." #s2); \
+struct s1 ## _ ## s2 ## _test { \
+ void run(); }; void s1 ## _ ## s2 ## _test::run()
+
+#define EXPECT_STREQ(s1, s2) \
+ BOOST_TEST(::boost::json::string_view(s1) == \
+ ::boost::json::string_view(s2))
+
+#define ASSERT_STREQ(s1, s2) \
+ { auto const s1_ = (s1); auto const s2_ = (s2); \
+ EXPECT_STREQ(s1_, s2_); }
+
+#define ASSERT_EQ(e1, e2) BOOST_TEST((e1)==(e2))
+
+#endif