Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Catch::toString support for containers #606

Closed

Commits on Oct 11, 2016

  1. Publish toString support for pairs

    Catch::toString support for pairs was implemented and tested
    but not accessible from the include folder (thus in releases).
    mat tso committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    c3d80cf View commit details
    Browse the repository at this point in the history
  2. Prepare toString support for std containers

    Rename projects/SelfTest/ToStringVector.cpp to ToStringContainers.cpp
    mat tso committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    fbceb5e View commit details
    Browse the repository at this point in the history
  3. Refactor toString vector test

    Exectute allocator tests even for c++98.
    mat tso committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    726b660 View commit details
    Browse the repository at this point in the history
  4. Test self sufficiency of tostring.hpp header

    Signed-off-by: mat tso <mat-tso@topmail.ie>
    mat tso committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    f5ccf98 View commit details
    Browse the repository at this point in the history
  5. Fix indentation of rangeToString in tostring.h

    mat tso committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    b0c88a3 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2016

  1. Add support toString for containers

    Standard container types were printed as `"{?}"`
    (default `toString` implementation for unsupported class).
    This was contradictory with the documentation:
    > "Most [...] std types are supported out of the box"
    when in fact only `string`, `vector` and `tupple` were supported.
    
     - Renamed the `toStringVector.cpp` test file to `toStringContainers.cpp`
    
     - Types are consider containers if they contain `value_type` and
       `const_iterator` members and have `begin` and `end` support
       (members or ADL findable) returning a `const_iterator`.
       `const_iterator::operator*` must also return a `const value_type &`
    
     - Beware that a trying to printing a type fulfilling those requirements
       but returning invalid iterators will results in undefined behaviour. In
       such case specialize the Catch::Detail::IsContainer trait to contain
       `static const bool value = false` to revert to the default behaviour
       (printing `"{?}"`).
    
    Test pretty printing of `std::list`, `std::deque`, `std::forward_list`,
    `std::array` in Catch assertion macro. More complex structure like
    `std::queue` or `std::multi_map` should also be tested.
    
    Signed-off-by: mat tso <mat-tso@topmail.ie>
    mat tso committed Oct 14, 2016
    Configuration menu
    Copy the full SHA
    a47b8de View commit details
    Browse the repository at this point in the history