summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.runtime
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite and cleanup unique_ptr tests.Eric Fiselier2017-04-1570-3814/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch almost entirely rewrites the unique_ptr tests. There are a couple of reasons for this: A) Most of the *.fail.cpp tests were either incorrect or could be better written as a *.pass.cpp test that uses <type_traits> to check if certain operations are valid (Ex. Using static_assert(!std::is_copy_constructible_v<T>) instead of writing a failure test). B) [unique.ptr.runtime] has very poor test coverage. Many of the constructors and assignment operators have to tests at all. The special members that have tests have very few test cases and are typically way out of date. C) The tests for [unique.ptr.single] and [unique.ptr.runtime] are largely duplicates of each other. This means common requirements have two different sets of tests in two different test files. This makes the tests harder to maintain than if there was a single copy. To address (A) this patch changes almost all of the *.fail.cpp tests into .pass.cpp tests using type traits; Allowing the *.fail.cpp tests to be removed. The address (B) and (C) the tests for [unique.ptr.single] and [unique.ptr.runtime] have been combined into a single directory, allowing both specializations to share common tests. Tests specific to the single/runtime specializations are given the suffix "*.single.pass.cpp" or "*.runtime.pass.cpp". Finally the unique.ptr test have been moved into the correct directory according to the standard. Specifically they have been removed from "utilities/memory" into "utilities/smartptr". PS. This patch also adds newly written tests for upcoming unique_ptr changes/fixes. However since these tests don't currently pass they are guarded by the macro TEST_WORKAROUND_UPCOMING_UNIQUE_PTR_CHANGES. This allows other STL's to validate the tests before libc++ implements the changes. The relevant libc++ changes should land in the next week. llvm-svn: 300388
* Fix template >> within C++03 codeEric Fiselier2017-04-131-1/+1
| | | | llvm-svn: 300165
* Fix C++03 test failuresEric Fiselier2017-04-131-1/+1
| | | | llvm-svn: 300159
* Add tests that std::unique_ptr's default constructor is constexpr.Eric Fiselier2017-04-132-49/+45
| | | | | | | | | | | | std::unique_ptr's default constructor must be constexpr in order to allow constant initialization to take place for static objects; Even though we can never have a constexpr unique_ptr variable since it's not a literal type. This patch adds tests that constant initialization takes place by using the __attribute__((require_constant_initialization)) macro. llvm-svn: 300158
* [libcxx] Fix __compressed_pair so it doesn't copy the argument multiple ↵Eric Fiselier2017-04-121-13/+14
| | | | | | | | | | | | | | | | | | | | | times, and add constexpr. Summary: __compressed_pair takes and passes it's constructor arguments by value. This causes arguments to be moved 3 times instead of once. This patch addresses that issue and fixes `constexpr` on the constructors. I would rather have this fix than D27564, and I'm fairly confident it's not ABI breaking but I'm not 100% sure. I prefer this solution because it removes a lot of code and makes the implementation *much* smaller. Reviewers: mclow.lists, K-ballo Reviewed By: K-ballo Subscribers: K-ballo, cfe-commits Differential Revision: https://reviews.llvm.org/D27565 llvm-svn: 300140
* Fix test failures with older Clang versionsEric Fiselier2017-04-121-0/+2
| | | | llvm-svn: 300132
* Fix incorrectly qualified return type from unique_ptr::get_deleter().Eric Fiselier2017-04-121-11/+30
| | | | | | | | | | | For reference deleter types the const qualifier on the return type of get_deleter() should be ignored, and a non-const deleter should be returned. This patch fixes a bug where "const deleter_type&" is incorrectly formed. llvm-svn: 300121
* Refactor unique_ptr/shared_ptr deleter test types into single header.Eric Fiselier2017-01-2017-17/+17
| | | | llvm-svn: 292577
* Fix unused parameters and variablesEric Fiselier2016-12-231-3/+3
| | | | llvm-svn: 290459
* Fix unique_ptr.runtime tests for null inputs. Patch from STL@microsoft.comEric Fiselier2016-07-242-0/+13
| | | | llvm-svn: 276587
* Mark LWG issue 2520 as completeEric Fiselier2016-05-313-0/+16
| | | | llvm-svn: 271249
* Add a test for uniqueptr having either NULL and nullptrMarshall Clow2016-05-161-0/+6
| | | | llvm-svn: 269665
* Fix failing unique_ptr tests.Eric Fiselier2015-07-312-38/+7
| | | | | | | | When I was refactoring the unique_ptr.single.ctor tests I added a test deleter, 'NCDeleter', to deleter.h. Other tests that include deleter.h redefine the NCDeleter type causing test failures. llvm-svn: 243733
* Start cleanup of unique_ptr tests.Eric Fiselier2015-07-312-46/+13
| | | | | | | | | | | | | | | | One of the last sections of tests that still fail in C++03 are the unique_ptr tests. This patch begins cleaning up the tests and fixing C++03 failures. The main changes of this patch: - The "Deleter" type in "deleter.h" tried to be "move-only" in C++03. However the move simulation no longer works (see "__rv"). "Deleter" is now copy constructible in C++03. However copying "Deleter" will "move" the test value instead of copying it. - Reduce the unique.ptr.single.ctor tests files from ~25 to 4. There is no reason the tests were split through so many files. llvm-svn: 243730
* Automatically detect and use clang verify in failure tests.Eric Fiselier2015-07-061-1/+0
| | | | | | | | | Automatically enable clang verify whenever the '-verify-ignore-unexpected' flag is supported. Failure tests are run using verify if they contain one or more "expected-*" diagnostics tags. Otherwise they are run normally. llvm-svn: 241492
* Get tests running with warnings. Fix warnings in headers and testsEric Fiselier2015-02-051-0/+2
| | | | llvm-svn: 228344
* Walter Brown sent a list of tests which needed 'additional includes' to ↵Marshall Clow2015-01-0915-0/+15
| | | | | | match what was in the standard. Added these includes to the tests. No changes to the library or test results. llvm-svn: 225541
* Move test into test/std subdirectory.Eric Fiselier2014-12-2070-0/+3809
llvm-svn: 224658
OpenPOWER on IntegriCloud