#pragma once #include #include #include #include "mg_procedure.h" #include "query/procedure/mg_procedure_impl.hpp" namespace test_utils { using MgpValueOwningPtr = std::unique_ptr; MgpValueOwningPtr CreateValueOwningPtr(mgp_value *value) { return MgpValueOwningPtr(value, &mgp_value_destroy); } template TResult ExpectNoError(const char *file, int line, TFunc func, TArgs &&...args) { static_assert(std::is_trivially_copyable_v); static_assert((std::is_trivially_copyable_v> && ...)); TResult result{}; EXPECT_EQ(func(args..., &result), MGP_ERROR_NO_ERROR) << fmt::format("Source of error: {} at line {}", file, line); return result; } } // namespace test_utils #define EXPECT_MGP_NO_ERROR(type, ...) test_utils::ExpectNoError(__FILE__, __LINE__, __VA_ARGS__)