+/**
+ * Useful macros for testing
+ */
+#define S(s) (s),strlen(s)
+#define DECLARE_STREQUAL static auto strequal = equal_to<string>();
+#define LOOPED_SECTION(tests) \
+ for (auto &[name, test] : tests) DYNAMIC_SECTION("test " << name)
+#define REQUIRE_SUCCESS(rc) do { \
+ INFO("expected: SUCCESS"); \
+ REQUIRE_THAT(rc, test.returns.success()); \
+ } while(0)
+#define REQUIRE_RC(rc, call) do { \
+ INFO("expected: " << memcached_strerror(nullptr, rc)); \
+ REQUIRE_THAT(call, test.returns(rc)); \
+ } while(0)
+