mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-12-04 01:54:02 +00:00
unord test fixes by Edward Meewis
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145707 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e814a90f74
commit
f836d531b4
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -36,7 +37,7 @@ int main()
|
||||
P(80, "eighty"),
|
||||
};
|
||||
const C c(std::begin(a), std::end(a));
|
||||
assert(c.load_factor() == (float)c.size() / c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,7 @@ int main()
|
||||
assert(c.at(4) == "four");
|
||||
assert(std::distance(c.begin(), c.end()) == c.size());
|
||||
assert(std::distance(c.cbegin(), c.cend()) == c.size());
|
||||
assert(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -68,7 +69,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -113,7 +114,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
assert(c0.size() == 0);
|
||||
}
|
||||
@ -159,7 +160,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
assert(c0.size() == 0);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -57,7 +58,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -36,7 +37,7 @@ int main()
|
||||
P(80, "eighty"),
|
||||
};
|
||||
const C c(std::begin(a), std::end(a));
|
||||
assert(c.load_factor() == (float)c.size() / c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
void test(const std::unordered_multimap<int, std::string>& c)
|
||||
{
|
||||
@ -53,7 +54,7 @@ void test(const std::unordered_multimap<int, std::string>& c)
|
||||
assert(i->second == "four");
|
||||
assert(std::distance(c.begin(), c.end()) == c.size());
|
||||
assert(std::distance(c.cbegin(), c.cend()) == c.size());
|
||||
assert(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -81,7 +82,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -79,7 +80,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -88,7 +89,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -153,7 +154,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -218,7 +219,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -75,7 +76,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
@ -129,7 +130,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -75,7 +76,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -73,7 +74,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -75,7 +76,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -76,7 +77,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -79,7 +80,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -117,7 +118,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
@ -148,7 +149,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.h"
|
||||
@ -79,7 +80,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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> >());
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../NotConstructible.h"
|
||||
@ -82,7 +83,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(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));
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -35,7 +36,7 @@ int main()
|
||||
P(80)
|
||||
};
|
||||
const C c(std::begin(a), std::end(a));
|
||||
assert(c.load_factor() == (float)c.size() / c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_multiset<int> C;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -74,7 +75,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -127,7 +128,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,7 @@ int main()
|
||||
assert(c.count(4) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == c.size());
|
||||
assert(std::distance(c.cbegin(), c.cend()) == c.size());
|
||||
assert(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -75,7 +76,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -120,7 +121,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -165,7 +166,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
@ -114,7 +115,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -52,7 +53,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -57,7 +58,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -95,7 +96,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
@ -110,7 +111,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.h"
|
||||
@ -55,7 +56,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.h"
|
||||
@ -57,7 +58,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -35,7 +36,7 @@ int main()
|
||||
P(80)
|
||||
};
|
||||
const C c(std::begin(a), std::end(a));
|
||||
assert(c.load_factor() == (float)c.size() / c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_set<int> C;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -66,7 +67,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -111,7 +112,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,7 @@ int main()
|
||||
assert(c.count(4) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == c.size());
|
||||
assert(std::distance(c.cbegin(), c.cend()) == c.size());
|
||||
assert(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
@ -157,7 +158,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -52,7 +53,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -54,7 +55,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -57,7 +58,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../test_compare.h"
|
||||
#include "../../../test_hash.h"
|
||||
@ -95,7 +96,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
@ -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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
|
||||
assert(c0.empty());
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.h"
|
||||
@ -55,7 +56,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.h"
|
||||
@ -57,7 +58,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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../iterators.h"
|
||||
#include "../../../test_compare.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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cfloat>
|
||||
|
||||
#include "../../../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(c.load_factor() == (float)c.size()/c.bucket_count());
|
||||
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user