Skip to content

Issue with tuples #157

Open
Open

Description

@grahamreeds

CHECK_EQUAL doesn't support tuples ie:

TEST(TupleTest)
{
	std::tuple<int, int, int> t(1,2,3);
	CHECK_EQUAL(std::make_tuple(1,2,3), t);
}

returns a stream of template vomit but the crux seems to be that there isn't a stream operator for std::tuple

/home/master/splint/unittest++/UnitTest++/Checks.h:24:32: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&’
           stream << "Expected " << expected << " but was " << actual;
                                 ^

Activity

  1. grahamreeds commented on Jul 5, 2017

    @grahamreeds
    ContributorAuthor

    Similarly, pairs aren't supported either.

    TEST(PairTest)
    {
    	std::pair<int, int> p(1,2);
    	CHECK_EQUAL(std::make_pair(1,2), p);
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions