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.

llvm-svn: 257474
This commit is contained in:
Marshall Clow 2016-01-12 14:51:04 +00:00
parent 00021429d4
commit 8d113d430f
59 changed files with 175 additions and 116 deletions

View File

@ -15,6 +15,7 @@
// http://llvm.org/bugs/show_bug.cgi?id=16816
#include <vector>
#include <algorithm>
#include <cassert>
int main()

View File

@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
#include <cmath>
#include <cfloat>
#include "test_macros.h"
@ -40,7 +41,7 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_map<int, std::string> C;
@ -64,7 +65,7 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -63,7 +64,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);
}
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -103,7 +104,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 // _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -144,7 +145,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

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -63,7 +64,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
@ -103,7 +104,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

View File

@ -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

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -59,7 +60,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
@ -94,7 +95,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

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -61,7 +62,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
@ -97,7 +98,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

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -62,7 +63,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
@ -99,7 +100,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

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -91,7 +92,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);
assert(c0.empty());
@ -158,7 +159,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);
assert(c0.empty());

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -64,7 +65,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);
assert(c0.empty());
@ -105,7 +106,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);
assert(c0.empty());
@ -147,7 +148,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);
assert(c0.empty());

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -62,7 +63,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
@ -98,7 +99,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

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -64,7 +65,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
@ -101,7 +102,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

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -65,7 +66,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
@ -103,7 +104,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

View File

@ -22,6 +22,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -67,7 +68,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
@ -106,7 +107,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

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "min_allocator.h"
@ -39,7 +40,7 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_multimap<int, std::string> C;
@ -64,7 +65,7 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "min_allocator.h"
@ -62,7 +63,7 @@ void test(const C& c)
assert(i->second == "four");
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);
}
int main()

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -77,7 +78,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);
}
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -131,7 +132,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 // _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -186,7 +187,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

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -77,7 +78,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
@ -131,7 +132,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

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -77,7 +78,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());
@ -133,7 +134,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -78,7 +79,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >());
@ -135,7 +136,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >());

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -80,7 +81,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -138,7 +139,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -81,7 +82,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -140,7 +141,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -119,7 +120,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -219,7 +220,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -86,7 +87,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -150,7 +151,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -215,7 +216,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -20,6 +20,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -81,7 +82,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());
@ -139,7 +140,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -83,7 +84,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >());
@ -142,7 +143,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >());

View File

@ -21,6 +21,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -84,7 +85,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -144,7 +145,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -22,6 +22,7 @@
#include <string>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../NotConstructible.h"
@ -86,7 +87,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
@ -147,7 +148,7 @@ int main()
assert(i->second == "four");
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);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "min_allocator.h"
@ -38,7 +39,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_multiset<int> C;
@ -63,7 +64,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_multiset<int, std::hash<int>,

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -69,7 +70,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);
}
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -116,7 +117,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 // _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -164,7 +165,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -69,7 +70,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
@ -116,7 +117,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -56,7 +57,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
@ -89,7 +90,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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -59,7 +60,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
@ -94,7 +95,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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -60,7 +61,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
@ -96,7 +97,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -97,7 +98,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);
assert(c0.empty());
@ -173,7 +174,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);
assert(c0.empty());

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -71,7 +72,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);
assert(c0.empty());
@ -112,7 +113,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);
assert(c0.empty());
@ -162,7 +163,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);
assert(c0.empty());
@ -203,7 +204,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);
assert(c0.empty());

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -59,7 +60,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
@ -94,7 +95,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

View File

@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -61,7 +62,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
@ -97,7 +98,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

View File

@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -62,7 +63,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
@ -99,7 +100,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

View File

@ -21,6 +21,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -64,7 +65,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
@ -102,7 +103,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "min_allocator.h"
@ -38,7 +39,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_set<int> C;
@ -63,7 +64,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
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);
}
{
typedef std::unordered_set<int, std::hash<int>,

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -61,7 +62,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);
}
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -100,7 +101,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 // _LIBCPP_HAS_NO_ADVANCED_SFINAE
@ -140,7 +141,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -61,7 +62,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
@ -100,7 +101,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -56,7 +57,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
@ -89,7 +90,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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -59,7 +60,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
@ -94,7 +95,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

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -60,7 +61,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
@ -96,7 +97,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

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -97,7 +98,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);
assert(c0.empty());
@ -173,7 +174,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);
assert(c0.empty());

View File

@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@ -63,7 +64,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);
assert(c0.empty());
@ -104,7 +105,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);
assert(c0.empty());
@ -146,7 +147,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);
assert(c0.empty());

View File

@ -19,6 +19,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -59,7 +60,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
@ -94,7 +95,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

View File

@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -61,7 +62,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
@ -97,7 +98,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

View File

@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -62,7 +63,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
@ -99,7 +100,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

View File

@ -21,6 +21,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
#include <cmath>
#include "test_iterators.h"
#include "../../../test_compare.h"
@ -64,7 +65,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
@ -102,7 +103,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

View File

@ -17,6 +17,7 @@
// constexpr const _CharT& at(size_type _pos) const;
#include <experimental/string_view>
#include <stdexcept>
#include <cassert>
template <typename CharT>

View File

@ -13,6 +13,7 @@
// template <class Facet> locale combine(const locale& other) const;
#include <locale>
#include <stdexcept>
#include <cassert>
#include "count_new.hpp"

View File

@ -20,6 +20,7 @@
// throw.
#include <random>
#include <system_error>
#include <cassert>
#include <unistd.h>

View File

@ -19,6 +19,7 @@
#include <utility>
#include <type_traits>
#include <cstddef>
#include <cassert>
int main()
@ -27,7 +28,7 @@ int main()
// Make a few of sequences
using int3 = std::integer_sequence<int, 3, 2, 1>;
using size1 = std::integer_sequence<size_t, 7>;
using size1 = std::integer_sequence<std::size_t, 7>;
using ushort2 = std::integer_sequence<unsigned short, 4, 6>;
using bool0 = std::integer_sequence<bool>;
@ -35,7 +36,7 @@ int main()
static_assert ( std::is_same<int3::value_type, int>::value, "int3 type wrong" );
static_assert ( int3::size() == 3, "int3 size wrong" );
static_assert ( std::is_same<size1::value_type, size_t>::value, "size1 type wrong" );
static_assert ( std::is_same<size1::value_type, std::size_t>::value, "size1 type wrong" );
static_assert ( size1::size() == 1, "size1 size wrong" );
static_assert ( std::is_same<ushort2::value_type, unsigned short>::value, "ushort2 type wrong" );

View File

@ -13,6 +13,7 @@
#include <string>
#include <type_traits>
#include <complex>
#include <memory>
#include <cassert>