summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/unord
Commit message (Collapse)AuthorAgeFilesLines
* Move test into test/std subdirectory.Eric Fiselier2014-12-20303-34349/+0
| | | | llvm-svn: 224658
* Add 'REQUIERS: long_tests' to a few more long testsJonathan Roelofs2014-12-111-0/+2
| | | | llvm-svn: 224064
* Fix some failing tests for the standard containers. The tests were failing ↵Marshall Clow2014-07-084-4/+8
| | | | | | in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests. llvm-svn: 212538
* Fix typo 'fourty' in testsAlp Toker2014-05-1520-87/+87
| | | | llvm-svn: 208870
* Add tests for LWG issue #2356. Stability of erasure in unordered associative ↵Marshall Clow2014-03-104-0/+143
| | | | | | containers. Libc++ already does this, but now we have tests for it. llvm-svn: 203494
* More tests for LWG Issue #2263; this time to the associative and unordered ↵Marshall Clow2014-03-104-12/+24
| | | | | | containers. Still no changes to libc++ llvm-svn: 203480
* Implement LWG 2193. Default constructors for standard library containers are ↵Marshall Clow2014-03-055-1/+37
| | | | | | explicit. Note that libc++ already did this for string/deque/forward_list/list/vector and the unordered containers; implement it for set/multiset/map/multimap. Add tests for all the containers. Two drive-by fixes as well: add a missing explicit in <deque>, and remove a tab that snuck into a container test. This issue is also LLVM bug 15724, and resolves it. llvm-svn: 202994
* Fix for PR18735 - self-assignment for map/multimap gives incorrect results ↵Marshall Clow2014-02-084-0/+73
| | | | | | in C++03 llvm-svn: 201021
* Found six (nmostly) identical files named 'test_allocator.h' in the libcxx ↵Marshall Clow2013-12-03123-123/+123
| | | | | | test suite. Moved one to /support, made it a superset, and removed all but one of the others, and iupdated all the includes. Left the odd one (thread/futures/test_allocator.h) for later. llvm-svn: 196174
* There were two identical files named 'min_allocator.h'. Move one of them to ↵Marshall Clow2013-11-26240-240/+240
| | | | | | /support and delete the other. Then adjust all the tests that used them to include the moved one. No functionality change. llvm-svn: 195785
* Part 8 of LWG Issue 2210' unordered_set and unordered multiset; this got ↵Marshall Clow2013-09-306-0/+369
| | | | | | missed when I went on vacation llvm-svn: 191705
* SCARY/N2913 iterator support between the multi and non-multi versions of the ↵Howard Hinnant2013-09-302-0/+48
| | | | | | associative and unordered containers. I beleive lack of support for this was accidentally recently introduced (by me) and this is fixing a regression. This time tests are put in to prevent such a regression in the future. llvm-svn: 191692
* LWG Issue 2210 (Part #6): unordered_map and unordered_multimapMarshall Clow2013-09-126-0/+451
| | | | llvm-svn: 190576
* Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.Howard Hinnant2013-08-2376-92/+92
| | | | llvm-svn: 189140
* N3644 tests for map/multimap/set/multiset. Drive-by NOEXCEPT for ↵Marshall Clow2013-08-084-4/+4
| | | | | | __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
* 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-026-291/+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-2334-52/+723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove implicit conversion from __value_type to value_type in ↵Howard Hinnant2013-07-051-0/+3
| | | | | | [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-045-8/+57
| | | | | | 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-041-0/+39
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=16538 llvm-svn: 185665
* 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
* Move common header files into a 'support' directory; make 'testit' include ↵Marshall Clow2013-01-0528-28/+28
| | | | | | -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-0328-28/+28
| | | | llvm-svn: 171452
* This commit establishes a new bucket_count policy in the unordered ↵Howard Hinnant2012-07-064-4/+4
| | | | | | containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have. llvm-svn: 159836
* The rules for emplace in map, multimap, unordered_map and unordered_multimap ↵Howard Hinnant2012-05-254-4/+8
| | | | | | changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()). llvm-svn: 157503
* unord test fixes by Edward MeewisHoward Hinnant2011-12-0273-93/+166
| | | | llvm-svn: 145707
* Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574Howard Hinnant2011-08-1228-56/+56
| | | | llvm-svn: 137522
* noexcept for <unordered_set>.Howard Hinnant2011-06-0410-0/+690
| | | | llvm-svn: 132647
* noexcept for <unordered_map>.Howard Hinnant2011-06-0410-0/+690
| | | | llvm-svn: 132646
* Bug 9096 - list::iterator not default constructibleHoward Hinnant2011-01-284-1/+9
| | | | llvm-svn: 124508
* license changeHoward Hinnant2010-11-16235-470/+470
| | | | llvm-svn: 119395
* Fix two test bugsHoward Hinnant2010-10-141-2/+0
| | | | llvm-svn: 116515
* Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant2010-09-0457-114/+114
| | | | | | flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. llvm-svn: 113086
* Fixing whitespace problemsHoward Hinnant2010-08-2265-65/+61
| | | | llvm-svn: 111755
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-11235-235/+235
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-11235-0/+18939
llvm-svn: 103490
OpenPOWER on IntegriCloud