diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2016-01-12 14:51:04 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2016-01-12 14:51:04 +0000 |
commit | e5e9bff62a4ae030ca42d312dc73f03d9cf61c4e (patch) | |
tree | 9f2fa74ff43d859f83fd34435f37810832c8f7f4 /test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp | |
parent | 040a0340bfcdf885619845660c41d164326bee44 (diff) | |
download | external_libcxx-e5e9bff62a4ae030ca42d312dc73f03d9cf61c4e.tar.gz external_libcxx-e5e9bff62a4ae030ca42d312dc73f03d9cf61c4e.tar.bz2 external_libcxx-e5e9bff62a4ae030ca42d312dc73f03d9cf61c4e.zip |
Add a bunch of missing includes in the test suite to make it more portable. Fixes bugs #26120 and #26121. Thanks to Jonathan Wakely for the reports and the patches.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp')
-rw-r--r-- | test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp index ac09053b1..b60fb2cad 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp @@ -19,6 +19,7 @@ #include <string> #include <cassert> #include <cfloat> +#include <cmath> #include "../../../test_compare.h" #include "../../../test_hash.h" @@ -58,7 +59,7 @@ int main() assert(!c.empty()); assert(std::distance(c.begin(), c.end()) == c.size()); assert(std::distance(c.cbegin(), c.cend()) == c.size()); - assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); + assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } #if __cplusplus >= 201103L @@ -92,7 +93,7 @@ int main() assert(!c.empty()); assert(std::distance(c.begin(), c.end()) == c.size()); assert(std::distance(c.cbegin(), c.cend()) == c.size()); - assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); + assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } #endif |