Commit Graph

105 Commits

Author SHA1 Message Date
Daniel James
1cc3f680e8 Fix a couple more explicit default constructors for Visual C++ 7.1 2018-01-20 11:49:07 +00:00
Daniel James
dc9faddf22 Try to fix constructor_tests on Visual C++ 7.1
I'm really not sure why it fails to compile, the error message isn't very
helpful.  I assume it might be because allocator1 has an explicit default
constructor, so I tried making it implicit.
2018-01-17 10:40:58 +00:00
Daniel James
6b5b968b97 Format with clang-format 4.0 2017-10-05 10:54:22 +01:00
Daniel James
0676b4f4ca Change clang format indentation + .editorconfig file 2017-06-11 20:55:59 +01:00
Daniel James
76e7322262 Use streams from lightweight test 2017-05-10 19:02:47 +01:00
Daniel James
31c5b5bfa1 Merge exception tests 2017-05-07 17:54:34 +01:00
Daniel James
3fe259a79e Fix creating exception::less from exception::equal_to 2017-05-05 12:58:26 +01:00
Daniel James
47a8c3fc67 Fix exception handling in rehash_impl
And improve tests so they will catch the error, and other similar errors.
2017-05-04 19:30:18 +01:00
Daniel James
8229aa6b3c Stop throwing exception in allocator copy/assignment
The standard specifies that all of these "shall not exit via an
exception". The containers have been exception safe when these throw,
but the 'noexcept' attribute on 'get_allocator' will terminate if an
exception is thrown in the copy constructor.

The standard doesn't specify a default constructor, so that is allowed
to throw an exception (not just pedantry, this makes sense if an
allocator has shared data that's allocated in the initial constructor).
2017-04-23 11:01:04 +01:00
Daniel James
ef05493c83 Test that construct/destroy aren't used when C++11 isn't available 2017-04-18 10:14:26 +01:00
Daniel James
7a0a598649 Don't track construction when using boost::tuple
Because it doesn't quiet work on C++11 compilers onwards.
2017-04-18 10:14:26 +01:00
Daniel James
cafd236a18 Test more memory tracking 2017-04-18 10:14:26 +01:00
Daniel James
c0b72d97b3 Stricter about rebinding the allocator 2017-02-23 20:14:27 +00:00
Daniel James
13063abce5 Move friend function outside of class
The use of std::pair was causing issues with the sun compiler.
2017-02-23 20:10:40 +00:00
Daniel James
bf5ef9824d Reformat with clang-format 2017-02-19 13:05:17 +00:00
Daniel James
e416cafd49 Count instances constructed/destructed in exception tests 2017-01-01 18:35:50 +00:00
Daniel James
7da307c696 Supply explicit test::cxx11_allocator::rebind for old GCC
The rebind mechanism doesn't work for templates with multiple template
parameters on old versions of GCC. But allocators written for that
compiler will have an explicit rebind, so that should be acceptable.
2016-10-17 07:54:06 +01:00
Daniel James
da6e8e8041 Better allocator rebind support 2016-10-14 09:27:40 +01:00
Daniel James
a316d3fa46 Fix more warnings 2016-10-11 10:07:07 +01:00
Daniel James
147885fec4 Add another random generation style.
This time for a more limited range of values so that equal values turn
up more often.  This is a bit shoddy, but seems like the best way to
improve the existing tests without too much effort.
2016-10-06 21:52:19 +01:00
Daniel James
65aaf27380 Fix accidental fallthrough in switch cases.
This was causing the hash function to be different to the equality
function. For some reason this resulted in a lot of windows test
failures, but none on linux or os x. I'm a bit confused and worried
about that.
2016-10-06 10:53:10 +01:00
Daniel James
71d19820ac Fix signed conversion warnings. 2016-10-05 09:45:53 +01:00
Daniel James
9debeadee7 Fix some test warnings.
And turn on warnings as errors in Travis.
2016-08-17 12:08:16 +01:00
Daniel James
0273ec59d7 Fix Visual C++ 9.0 workaround. 2014-12-03 18:28:40 +00:00
Daniel James
9090d87725 Restore ampersand workaround for Visual C++ 9 2014-11-16 10:01:29 +00:00
Daniel James
a81c86a90e Remove use of operator&.
Also reactivate operator& for minimal test classes. Apparently I
disabled them because of a problem in a type trait, but I'm not seeing
that now. Maybe it will appear on other compilers.
2014-10-26 22:21:12 +00:00
Marshall Clow
1bd3b029fa Removed usage of deprecated macros
[SVN r81563]
2012-11-26 17:47:12 +00:00
Daniel James
3f060a70d1 Unordered: Fix unnecessary_copy_tests + extra tests.
It looks the odd result in unnecessary_copy_tests on Visual C++ 11 is not a
bug, but add some extra tests just to make sure. Also some extra rehash and
reserve testing thrown in.

[SVN r80705]
2012-09-26 08:09:26 +00:00
Daniel James
37d58e84e3 Unordered: Fix creating extra node when resizing.
[SVN r80518]
2012-09-13 19:50:31 +00:00
Daniel James
c0faf59a86 Unordered: De-template constructor for allocator2 from allocator.
Sun is failing one of the tests because it isn't using it implicitly.


[SVN r80276]
2012-08-28 08:04:51 +00:00
Daniel James
a822b27efc Unordered: Weaken requirements in compile tests.
Assigning a container requires that its elements can be assignable. Could split
the tests up so that other tests aren't assignable, but it doesn't seem worth
the hassle.

[SVN r80228]
2012-08-25 21:56:16 +00:00
Daniel James
aefea862c2 Unordered: Two exception testing allocators.
For different C++11 properties.

[SVN r80225]
2012-08-25 21:54:50 +00:00
Daniel James
7c968fd38d Unordered: Avoid an MSVC warning.
[SVN r79651]
2012-07-22 07:14:42 +00:00
Daniel James
f387994422 Unordered: Test with more allocators.
Causes some C++11 failures....

[SVN r79357]
2012-07-08 11:55:35 +00:00
Daniel James
f5292fd9f7 Unordered: Simplify the object count stuff.
[SVN r79355]
2012-07-08 11:54:47 +00:00
Daniel James
9a284b4106 Unordered: Remove some junk from the end of memory.hpp
[SVN r79353]
2012-07-08 11:54:01 +00:00
Daniel James
98083078a3 Unordered: Remove malloc_allocator.
It was originally introduced because of some issues with Boost.Test and older
compilers, neither of which I'm using now. Simplifies a few things.

[SVN r79352]
2012-07-08 11:53:39 +00:00
Daniel James
39bafd7b10 Unordered: Reapply changes reverted in r78788.
[SVN r79163]
2012-06-28 20:58:56 +00:00
Daniel James
7158700502 Unordered: Revert unmerged changes in trunk.
So that I can fix issues in the beta.


[SVN r78788]
2012-06-01 11:03:22 +00:00
Daniel James
1eac47a275 Unordered: Use Boost.Move in a few more places.
Should be better for compilers with variadic parameters, but no rvalue
references. If such a thing ever exists.

[SVN r78536]
2012-05-21 22:15:33 +00:00
Daniel James
992cc0b077 Unordered: Some C++11 allocator_traits fixes.
Can now be used with g++ 4.7. Not activating by default yet.

[SVN r76893]
2012-02-05 08:45:52 +00:00
Daniel James
2665090568 Unordered: Use Boost.Move for variadic forwarding.
[SVN r76331]
2012-01-06 08:36:43 +00:00
Daniel James
dac1dc5837 Unordered: Reorganization to use void pointers and other things.
Helps allocators which can't use incomplete pointers, and avoid using
base pointers where that might not be possible.  And some other
reorganization. Storing arguments to emplace in a structure when
variadic template parameters aren't available. Changed some of the odd
design for working with older compilers.

[SVN r74742]
2011-10-05 19:45:14 +00:00
Daniel James
099a893678 Unordered: More portable allocator_traits.
[SVN r74067]
2011-08-26 08:11:46 +00:00
Daniel James
11e390bf42 Unordered: Use Boost.Move in minimal tests.
[SVN r73828]
2011-08-16 22:17:11 +00:00
Daniel James
a8fdf19c91 Unordered: Test types that are only destructible.
[SVN r73820]
2011-08-16 18:08:23 +00:00
Daniel James
bbad921022 Unordered: Fix some portability issues in tests.
- Simplify mechanism for detecting traits of test allocators. There were
  some portability issues, but rather than fix them I've just gone for a
  simpler mechanism. Does mean that the relevant tests can't be run for
  other allocators.
- Fix a couple of unnecessary_copy_tests, whose results were the wrong
  way round.
- It appears that Visual C++ only implements RVO for implicitly defined
  copy constructors in debug mode, so adjust a move_test to account for
  the extra copies now that the copy constructors are explicitly
  defined.

[SVN r73798]
2011-08-15 20:23:29 +00:00
Daniel James
f64cf03e1d Unordered: Implement select_on_container_copy_construction support.
[SVN r73772]
2011-08-15 07:48:53 +00:00
Daniel James
559122f67a Unordered: Small improvements for windows.
[SVN r73760]
2011-08-14 21:03:18 +00:00
Daniel James
5f622027cd Unordered: Implement allocator propagation on assignment.
It's pretty messy because I'm trying to avoid swapping allocators in
these cases. I'm also not sure of the exception requirements of
allocator swap and assignment.

[SVN r73756]
2011-08-14 18:53:29 +00:00