darling-libcxx/test/re
Howard Hinnant 8b00e6c960 Ok, 3 major changes for debug mode in one commit:
1.  I had been detecting and trapping iterator == and \!= among iterators
    in different containers as an error.  But the trapping itself is actually
    an error.
    
    Consider:
    
    #include <iostream>
    #include <vector>
    #include <algorithm>

    template <class C>
    void
    display(const C& c)
    {
        std::cout << "{";
        bool first = true;
        for (const auto& x : c)
        {
            if (\!first)
                std::cout << ", ";
            first = false;
            std::cout << x;
        }
        std::cout << "}\n";
    }

    int
    main()
    {
        typedef std::vector<int> V;
        V v1 = {1, 3, 5};
        V v2 = {2, 4, 6};
        display(v1);
        display(v2);
        V::iterator i = std::find(v1.begin(), v1.end(), 1);
        V::iterator j = std::find(v2.begin(), v2.end(), 2);
        if (*i == *j)
            i = j;    // perfectly legal
        // ...
        if (i \!= j)   // the only way to check
            v2.push_back(*i);
        display(v1);
        display(v2);
    }

    It is legal to assign an iterator from one container to another of the
    same type.  This is required to work.  One might want to test whether or
    not such an assignment had been made.  The way one performs such a check
    is using the iterator's ==, \!= operator.  This is a logical and necessary
    function and does not constitute an error.

2.  I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
    This caused a problem in several of the libc++ tests.
    Fixed.

3.  There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
    std::basic_string is inoperable.  std::basic_string uses __wrap_iterator
    to implement its iterators.  __wrap_iterator has been rigged up in debug
    mode to support vector.  But string hasn't been rigged up yet.  This means
    that one gets false positives when using std::string in debug mode.  I've
    upped std::string's priority in www/debug_mode.html.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 00:26:35 +00:00
..
re.alg Ok, 3 major changes for debug mode in one commit: 2013-08-02 00:26:35 +00:00
re.badexp license change 2010-11-16 22:09:02 +00:00
re.const license change 2010-11-16 22:09:02 +00:00
re.def license change 2010-11-16 22:09:02 +00:00
re.general license change 2010-11-16 22:09:02 +00:00
re.grammar license change 2010-11-16 22:09:02 +00:00
re.iter Fix test bugs found by David Chisnall 2011-09-21 18:33:46 +00:00
re.regex Bill Fisher: This patch fixes an ill-formed comparison when parsing control escapes, e.g. "\cA\ca". The code will now throw an error_escape exception for invalid control sequences like "\c:" or "\c". 2013-07-15 18:21:11 +00:00
re.req license change 2010-11-16 22:09:02 +00:00
re.results Move common header files into a 'support' directory; make 'testit' include -I to that directory; rename 'iterators.h' to 'iterator_test.h'; remove hard-coded paths to include files from more than 350 source files 2013-01-05 03:21:01 +00:00
re.submatch N3158 Missing preconditions for default-constructed match_result objects 2010-12-08 21:07:55 +00:00
re.syn license change 2010-11-16 22:09:02 +00:00
re.traits Mark some tests with XFAIL for Lion and Mountain Lion. 2013-05-07 17:37:19 +00:00
nothing_to_do.pass.cpp license change 2010-11-16 22:09:02 +00:00
test_allocator.h This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously. 2013-03-23 17:27:16 +00:00