summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix or move various non-standard tests.Eric Fiselier2016-04-291-5/+2
| | | | | | | | | | | | This patch does the following: * Remove <__config> includes from some container tests. * Guards uses of std::launch::any in async tests because it's an extension. * Move "test/std/extensions" to "test/libcxx/extensions" * Moves various non-standard tests including those in "sequences/vector", "std/localization" and "utilities/meta". llvm-svn: 267981
* Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macrosEric Fiselier2016-04-2877-524/+195
| | | | llvm-svn: 267947
* Recommit r263036 with additional inlining, so that it will continue to work ↵Marshall Clow2016-04-071-2/+25
| | | | | | with existing system dylibs. Implements LWG#2583 llvm-svn: 265706
* Revert r263036, it's ABI-breaking.Nico Weber2016-03-111-25/+2
| | | | llvm-svn: 263246
* Implement LWG#2579: Inconsistency wrt Allocators in basic_string assignment ↵Marshall Clow2016-03-091-1/+33
| | | | | | vs. basic_string::assign llvm-svn: 263042
* Implement LWG#2583: There is no way to supply an allocator for ↵Marshall Clow2016-03-091-2/+25
| | | | | | basic_string(str, pos) llvm-svn: 263036
* Remove a couple tabs that crept inMarshall Clow2016-03-081-2/+2
| | | | llvm-svn: 262932
* Implement P0272R1: Give 'std::string' a non-const '.data()' member functionMarshall Clow2016-03-081-10/+36
| | | | llvm-svn: 262931
* Fix overload sets of strchr, strpbrk, strrchr, memchr and strstr fromRichard Smith2016-02-102-10/+22
| | | | | | | | | | | | | | | | | <string.h> and wcschr, wcspbrk, wcsrchr, wmemchr, and wcsstr from <wchar.h> to provide a const-correct overload set even when the underlying C library does not. This change adds a new macro, _LIBCPP_PREFERRED_OVERLOAD, which (if defined) specifies that a given overload is a better match than an otherwise equally good function declaration without the overload. This is implemented in modern versions of Clang via __attribute__((enable_if)), and not elsewhere. We use this new macro to define overloads in the global namespace for these functions that displace the overloads provided by the C library, unless we believe the C library is already providing the correct signatures. llvm-svn: 260337
* More string fixes for noexcept cases. Apparently I didn't get them all in ↵Marshall Clow2016-01-204-0/+8
| | | | | | r258281. llvm-svn: 258291
* Fix up the tests I added for string exceptions to be skipped when exceptions ↵Marshall Clow2016-01-204-0/+8
| | | | | | are disabled llvm-svn: 258279
* Fix PR#25973 : 'basic_string::assign(InputIt, InputIt) doesn't provide the ↵Marshall Clow2016-01-1336-38/+150
| | | | | | strong exception safety guarantee'. This turned out to be a pervasive problem in <string>, which required a fair amount of rework. Add in an optimization for when iterators provide noexcept increment/comparison/assignment/dereference (which covers many of the iterators in libc++). Reviewed as http://reviews.llvm.org/D15862 llvm-svn: 257682
* Add static_assert to set/multiset/map/multimap/forward_list/deque that the ↵Marshall Clow2015-11-261-0/+18
| | | | | | allocator's value_type match the container's value_type. vector/unordered/list/string already do this. Add tests for all the containers to verify this. llvm-svn: 254119
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-1035-0/+35
| | | | | | | | | | | | Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
* Split <ctype.h> out of <cctype>.Richard Smith2015-10-081-14/+14
| | | | llvm-svn: 249738
* Implement LWG#2063, and update the issues links to point to the github ↵Marshall Clow2015-10-051-0/+6
| | | | | | generated pages llvm-svn: 249325
* Change initialization of mbstate_t objects in tests from '= {0}' to '= {}', ↵Marshall Clow2015-09-151-1/+1
| | | | | | which does the same thing, w/o having clang and gcc warn with -Wall. llvm-svn: 247695
* implement more of N4258 - Cleaning up noexcept in the standard library. ↵Marshall Clow2015-08-181-4/+52
| | | | | | Specifically add new noexcept stuff to vector and string's move-assignment operations llvm-svn: 245330
* Implement the first part of N4258: 'Cleaning up noexcept in the Library'. ↵Marshall Clow2015-07-131-0/+31
| | | | | | This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates. llvm-svn: 242056
* Make support for thread-unsafe C functions optional.Ed Schouten2015-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | One of the aspects of CloudABI is that it aims to help you write code that is thread-safe out of the box. This is very important if you want to write libraries that are easy to reuse. For CloudABI we decided to not provide the thread-unsafe functions. So far this is working out pretty well, as thread-unsafety issues are detected really early on. The following patch adds a knob to libc++, _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable thread-unsafe functions that can easily be avoided in practice. The following functions are not thread-safe: - <clocale>: locale handles should be preferred over setlocale(). - <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over their non-restartable counterparts. - <ctime>: asctime(), ctime(), gmtime() and localtime() are not thread-safe. The first two are also deprecated by POSIX. Differential Revision: http://reviews.llvm.org/D8703 Reviewed by: marshall llvm-svn: 240527
* While applying N4258, I forgot about LWG#2455, which modified the ↵Marshall Clow2015-06-041-5/+0
| | | | | | modifications. Correct those - h/t: Howard llvm-svn: 239004
* More of N4258 implementation. Mark all of our test_allocators as noexcept ↵Marshall Clow2015-06-034-3/+56
| | | | | | constructible. Make the constructors for basic_string noexcept all the time (under C++14). Update tests to reflect the new world order. More to come. llvm-svn: 238957
* Add tests to ensure that string/vector/array have contiguous iterators - ↵Marshall Clow2015-05-262-12/+53
| | | | | | which they did. Mark N4284 as complete llvm-svn: 238233
* Make the presence of stdin and stdout optional.Ed Schouten2015-03-261-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind Nuxi CloudABI is that it is targeted at (but not limited to) running networked services in a sandboxed environment. The model behind stdin, stdout and stderr is strongly focused on interactive tools in a command shell. CloudABI does not support the notion of stdin and stdout, as 'standard input/output' does not apply to services. The concept of stderr does makes sense though, as services do need some mechanism to log error messages in a uniform way. This patch extends libc++ in such a way that std::cin and std::cout and the associated <cstdio>/<cwchar> functions can be disabled through the flags _LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time it attempts to clean up src/iostream.cpp a bit. Instead of using a single array of mbstate_t objects and hardcoding the array indices, it creates separate objects that declared next to the iostream objects and their buffers. The code is also restructured by interleaving the construction and setup of c* and wc* objects. That way it is more obvious that this is done identically. The c* and wc* objects already have separate unit tests. Make use of this fact by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in both directions. If stdin or stdout is disabled, these tests will therefore test for the absence of c* and wc*. Differential Revision: http://reviews.llvm.org/D8340 llvm-svn: 233275
* Use generic feature name for sanitizers that replace new and deleteEric Fiselier2015-03-101-1/+1
| | | | llvm-svn: 231841
* Rooting out more undefined behavior in char_traits.Marshall Clow2015-02-1316-0/+24
| | | | llvm-svn: 229119
* Move the test for zero-length into the char_traits (from string_view). Add ↵Marshall Clow2015-02-124-0/+4
| | | | | | tests to char_traits specializations llvm-svn: 228981
* Rename system_lib -> system_cxx_lib. NFCJonathan Roelofs2015-01-145-10/+10
| | | | llvm-svn: 226061
* Walter Brown sent a list of tests which needed 'additional includes' to ↵Marshall Clow2015-01-096-0/+6
| | | | | | match what was in the standard. Added these includes to the tests. No changes to the library or test results. llvm-svn: 225541
* libc++ implements its' hash objects as deriving from std::unary_function, ↵Marshall Clow2015-01-071-2/+2
| | | | | | and the tests test for that. STL @ MS pointed out that the standard doesn't requie these objects to derive from unary_function, and so the tests should not require that either. Change the tests to check for the embedded typedefs - which ARE required. No change to the library. llvm-svn: 225403
* Move test into test/std subdirectory.Eric Fiselier2014-12-20275-0/+40752
llvm-svn: 224658
OpenPOWER on IntegriCloud