Opened 7 years ago

Closed 7 years ago

#11571 closed Bugs (fixed)

Can't compile BOOST_TEST( ..., per_element() ) comparison of vector<string>

Reported by: Tony Lewis <tonyelewis@…> Owned by: Raffi Enficiaud
Milestone: Boost 1.60.0 Component: test
Version: Boost 1.59.0 Severity: Problem
Keywords: test, BOOST_TEST, per_element, collections, string, vector Cc:

Description

Thanks for the new BOOST_TEST() and per_element() tools, which look very useful.

Unfortunately, the following simple vector<string> example fails to compile under both g++ -std=c++11 and clang++ -std=c++11 -stdlib=libc++.

#define BOOST_TEST_MODULE comp_str_mod

#include <boost/test/included/unit_test.hpp>

#include <string>
#include <vector>

BOOST_AUTO_TEST_CASE( comp_strs ) {
        std::vector<std::string> a{ "ann" };
        std::vector<std::string> b{ "bry" };

        BOOST_TEST( a == b, boost::test_tools::per_element() );
}

The core part of GCC's error message is:

error: ‘revert’ is not a member of ‘boost::test_tools::assertion::op::EQ<std::basic_string<char>, std::basic_string<char>, void>’

If I'm doing it wrong, is there any way we can make the compile errors and/or documentation clearer about avoiding this? Thanks.

Attachments (1)

patch (1.5 KB ) - added by Gennadiy Rozental 7 years ago.
Fix

Download all attachments as: .zip

Change History (11)

by Gennadiy Rozental, 7 years ago

Attachment: patch added

Fix

comment:1 by Gennadiy Rozental, 7 years ago

Thank you for the report. Please use attached fix for the resolution in 1.59

comment:2 by Gennadiy Rozental, 7 years ago

Resolution: fixed
Status: newclosed

comment:3 by anonymous, 7 years ago

This fix works for me. Thanks very much for the prompt response.

comment:4 by anonymous, 7 years ago

This fix works for me. Thanks very much for the prompt response.

comment:5 by Tony Lewis <tonyelewis@…>, 7 years ago

This fix works for me. Thanks very much for the prompt response.

comment:6 by Raffi Enficiaud, 7 years ago

Resolution: fixed
Status: closedreopened

Reopenning for keeping track of the change, will close issue when merged to master

comment:7 by Raffi Enficiaud, 7 years ago

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: reopenednew

comment:8 by Raffi Enficiaud, 7 years ago

Status: newassigned

comment:9 by Raffi Enficiaud, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0

comment:10 by Raffi Enficiaud, 7 years ago

Resolution: fixed
Status: assignedclosed

merged to master

Note: See TracTickets for help on using tickets.