From 2bc1c7b534244e7cb80fad38d79aca5360153d2e Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Thu, 26 Mar 2015 10:20:38 +0100 Subject: [PATCH] tests: Make rows_assertions::with_rows() verify order --- tests/urchin/cql_query_test.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/urchin/cql_query_test.cc b/tests/urchin/cql_query_test.cc index 32f508370d..0e3ab85edb 100644 --- a/tests/urchin/cql_query_test.cc +++ b/tests/urchin/cql_query_test.cc @@ -158,11 +158,15 @@ public: return {*this}; } + // Verifies that the result has the following rows and only that rows, in that order. rows_assertions with_rows(std::initializer_list> rows) { with_size(rows.size()); - for (auto&& row : rows) { - with_row(row); - } + BOOST_REQUIRE(std::equal(rows.begin(), rows.end(), + _rows->rs().rows().begin(), [] (auto&& lhs, auto&& rhs) { + return std::equal( + std::begin(lhs), std::end(lhs), + std::begin(rhs), std::end(rhs)); + })); return {*this}; } };