summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers
Commit message (Collapse)AuthorAgeFilesLines
...
* Second half (map/multimap) of N3657Marshall Clow2013-08-1310-57/+793
| | | | llvm-svn: 188320
* First half of support for N3657; heterogenous lookups for set/multisetMarshall Clow2013-08-138-0/+719
| | | | llvm-svn: 188241
* N3644 tests for map/multimap/set/multiset. Drive-by NOEXCEPT for ↵Marshall Clow2013-08-0813-9/+65
| | | | | | __tree_const_iterator constructor. Fix comment typos in other tests llvm-svn: 188019
* N3644 support for <unordered_set> and <unordered_map>Marshall Clow2013-08-074-0/+56
| | | | llvm-svn: 187915
* N3644 support for vector<bool>Marshall Clow2013-08-071-0/+12
| | | | llvm-svn: 187910
* N3644 support for <string> and <vector>Marshall Clow2013-08-071-0/+13
| | | | llvm-svn: 187909
* Correct logic bug in find optimization for vector<bool>. This fixes ↵Howard Hinnant2013-08-071-0/+38
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=16816 llvm-svn: 187908
* War on tabsHoward Hinnant2013-08-071-1/+1
| | | | llvm-svn: 187906
* Implement tests for NULL iterators for <array> re: N3644Marshall Clow2013-08-061-0/+79
| | | | llvm-svn: 187809
* Implement NULL iterators for <forward_list> and <deque> re: N3644Marshall Clow2013-08-062-0/+38
| | | | llvm-svn: 187805
* Implement NULL iterators for <list> re: N3644Marshall Clow2013-08-052-0/+85
| | | | llvm-svn: 187740
* debug mode for unordered_map. Also picked up a missing check and test in ↵Howard Hinnant2013-08-0220-0/+641
| | | | | | unordered_multimap. This wraps up debug mode for the unordered containers. llvm-svn: 187659
* Ok, 3 major changes for debug mode in one commit:Howard Hinnant2013-08-028-399/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 187636
* Debug mode for unordered_multimap. Some mods were done for unordered_map as ↵Howard Hinnant2013-07-3023-22/+726
| | | | | | well to keep all the tests passing. However unordered_map is at the very least still missing tests, if not functionality (if it isn't tested, it probably isn't working). llvm-svn: 187446
* Debug mode for unordered_multiset. The exercise spotted a few places I had ↵Howard Hinnant2013-07-2924-0/+743
| | | | | | | | | | | | | | missed on unordered_set, so I picked those up as well. There are actually two debug modes: 1. -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1 This is a relatively expensive debug mode, but very thorough. This is normally what you want to debug with, but may turn O(1) operations into O(N) operations. 2. -D_LIBCPP_DEBUG2=0 This is "debug lite." Only preconditions that can be checked with O(1) expense are checked. For example range checking on an indexing operation. But not iterator validity. llvm-svn: 187369
* Debug mode for unordered_set. I believe this to be fairly complete forHoward Hinnant2013-07-2335-52/+732
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unordered_set, however it is not complete yet for unordered_multiset, unordered_map or unordered_multimap. There has been a lot of work done for these other three containers, however that work was done just to keep all of the tests passing. You can try this out with -D_LIBCPP_DEBUG2. You will have to link to a libc++.dylib that has been compiled with src/debug.cpp. So far, vector (but not vector<bool>), list, and unordered_set are treated. I hope to get the other three unordered containers up fairly quickly now that unordered_set is done. The flag _LIBCPP_DEBUG2 will eventually be changed to _LIBCPP_DEBUG, but not today. This is my second effort at getting debug mode going for libc++, and I'm not quite yet ready to throw all of the work under the first attempt away. The basic design is that all of the debug information is kept in a central database, instead of in the containers. This has been done as an attempt to have debug mode and non-debug mode be ABI compatible with each other. There are some circumstances where if you construct a container in an environment without debug mode and pass it into debug mode, the checking will get confused and let you know with a readable error message. Passing containers the other way: from debug mode out to a non-debugging mode container should be 100% safe (at least that is the goal). llvm-svn: 186991
* Make std::get constexprMarshall Clow2013-07-176-0/+231
| | | | llvm-svn: 186525
* War on tabs.Howard Hinnant2013-07-087-163/+163
| | | | llvm-svn: 185865
* Remove implicit conversion from __value_type to value_type in ↵Howard Hinnant2013-07-052-0/+6
| | | | | | [unordered_][multi]map. This fixes http://llvm.org/bugs/show_bug.cgi?id=16549 llvm-svn: 185711
* Removed extension in [unordered_][multi]map which allowed one to emplace ↵Howard Hinnant2013-07-0410-32/+150
| | | | | | using just an argument for the key, as opposed to using piecewise_construct. However a bug report exposed that this created an unfortunate ambiguity. People who are currently using the extension will be notified the next time they compile, and will have to change to using piecewise_construct. There are no ABI issues with the removal of this extension. This fixes http://llvm.org/bugs/show_bug.cgi?id=16542 llvm-svn: 185666
* Simplify comparators of [unordered_][multi]map. This fixes ↵Howard Hinnant2013-07-042-0/+68
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=16538 llvm-svn: 185665
* Implement full support for non-pointer pointers in custom allocators for vector.Howard Hinnant2013-06-2795-31/+1655
| | | | llvm-svn: 185093
* Implement full support for non-pointer pointers in custom allocators for list.Howard Hinnant2013-06-2564-4/+1857
| | | | llvm-svn: 184859
* Implement full support for non-pointer pointers in custom allocators for ↵Howard Hinnant2013-06-2455-26/+1555
| | | | | | forward_list. llvm-svn: 184759
* Implement full support for non-pointer pointers in custom allocators for deque.Howard Hinnant2013-06-2346-275/+915
| | | | llvm-svn: 184673
* Implement full support for non-pointer types in custom allocators. This is ↵Howard Hinnant2013-06-22224-12/+10210
| | | | | | for the unordered containers only. This work still needs to be done on the sequence containers. llvm-svn: 184635
* Implement full support for non-pointer types in custom allocators. This is ↵Howard Hinnant2013-06-19145-123/+6813
| | | | | | for the associative containers only. This work still needs to be done on the unordered and sequence containers. Fixes http://llvm.org/bugs/show_bug.cgi?id=15978 llvm-svn: 184358
* Test case for r183481.Howard Hinnant2013-06-071-0/+20
| | | | llvm-svn: 183522
* After years of telling people: 'If you ever find any of my code that ↵Howard Hinnant2013-04-181-0/+7
| | | | | | self-move-assigns, send me a bug report.' Somebody finally took me up on it. vector::erase(begin(), begin()) does a self-move-assign of every element in the vector, leaving all of those elements in an unspecified state. I checked the other containers for this same bug and did not find it. Added test case. llvm-svn: 179760
* I believe this finishes up debug mode for list. The testing is a little ↵Howard Hinnant2013-04-163-0/+36
| | | | | | weak, but I believe all of the functionality is there. Certainly enough for people to checkout and start beating up on. llvm-svn: 179632
* Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.Howard Hinnant2013-04-051-0/+42
| | | | llvm-svn: 178892
* More list debug mode tests.Howard Hinnant2013-04-056-0/+228
| | | | llvm-svn: 178873
* More work on debug mode for list.Howard Hinnant2013-04-056-0/+76
| | | | llvm-svn: 178819
* Some debug test cases for list.Howard Hinnant2013-04-028-0/+324
| | | | llvm-svn: 178565
* The 3rd test in shrink_to_fit.pass.cpp can't possibly pass if exceptions are ↵Howard Hinnant2013-03-291-0/+2
| | | | | | disabled, so #ifdef'ing out the test. llvm-svn: 178350
* Revert r178075, "Tighten up the iterator requirements ...", it breaks LLVMDaniel Dunbar2013-03-271-7/+0
| | | | | | bootstrap with libc++. llvm-svn: 178116
* Tighten up the iterator requirements for the vector member templates. This ↵Howard Hinnant2013-03-261-0/+7
| | | | | | is especially important for the constructors so that is_constructible<vector<T>, I, I> gives the right answer when T can not be constructed from *I. Test case included for this latter point. llvm-svn: 178075
* Another vector debug mode test, and a static test on Allocator::value_type. ↵Howard Hinnant2013-03-261-0/+8
| | | | | | This partially addresses http://llvm.org/bugs/show_bug.cgi?id=15576. llvm-svn: 178064
* More vector debug tests.Howard Hinnant2013-03-266-0/+103
| | | | llvm-svn: 178033
* Simply debug mode tests per Dmitri Gribenko's suggestion.Howard Hinnant2013-03-2621-148/+21
| | | | llvm-svn: 178026
* Need one more swap overload for swapping two lvalue vector<bool>::reference's.Howard Hinnant2013-03-261-0/+10
| | | | llvm-svn: 178016
* Added debug tests for indexing, pop_back and both forms of erase. Added an ↵Howard Hinnant2013-03-259-0/+405
| | | | | | improved error message for erasing a single element with end(). llvm-svn: 177929
* Remove some erroneous code I was using to debug debug mode.Howard Hinnant2013-03-2512-24/+0
| | | | llvm-svn: 177908
* Debug mode tests for vector::front and back.Howard Hinnant2013-03-254-0/+192
| | | | llvm-svn: 177904
* More vector::iterator debug mode tests. Run by adding to OPTIONS ↵Howard Hinnant2013-03-258-7/+346
| | | | | | -D_LIBCPP_DEBUG2=1. llvm-svn: 177897
* Debug mode: learning to crawl. I need to set up some tests that actually ↵Howard Hinnant2013-03-251-0/+53
| | | | | | test that the debug mode is working, but that won't cause problems when debug mode isn't on. This is my first prototype of such a test. It should call std::terminate() because it's comparing iterators from different containers. And std::terminate() is rigged up to exit normally. If debug mode fails, and doesn't call terminate, then the program asserts. The test is a no-op if _LIBCPP_DEBUG2 is not defined or is defined to be 0. llvm-svn: 177892
* This is a start at making the libc++ test suite friendlier to the ↵Howard Hinnant2013-03-232-2/+12
| | | | | | -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. llvm-svn: 177824
* Fix exception safety bug in vector::push_backHoward Hinnant2013-01-116-0/+438
| | | | llvm-svn: 172250
* Move common header files into a 'support' directory; make 'testit' include ↵Marshall Clow2013-01-0558-58/+58
| | | | | | -I to that directory; rename 'iterators.h' to 'iterator_test.h'; remove hard-coded paths to include files from more than 350 source files llvm-svn: 171594
* Removed several more different 'iterators.h' files in libcxx/testMarshall Clow2013-01-0359-309/+58
| | | | llvm-svn: 171452
OpenPOWER on IntegriCloud