/* * Copyright 2015 Cloudius Systems */ #pragma once #include "transport/messages/result_message_base.hh" #include "bytes.hh" #include "core/shared_ptr.hh" #include "core/future.hh" class rows_assertions { shared_ptr _rows; public: rows_assertions(shared_ptr rows); rows_assertions with_size(size_t size); rows_assertions is_empty(); rows_assertions with_row(std::initializer_list values); // Verifies that the result has the following rows and only that rows, in that order. rows_assertions with_rows(std::initializer_list> rows); }; class result_msg_assertions { shared_ptr _msg; public: result_msg_assertions(shared_ptr msg); rows_assertions is_rows(); }; result_msg_assertions assert_that(shared_ptr msg); template void assert_that_failed(future& f) { assert(f.failed()); try { f.get(); } catch (...) { } }