Fix vector<bool> tests that were using ints. Patch from STL@microsoft.com

llvm-svn: 272620
This commit is contained in:
Eric Fiselier 2016-06-14 02:53:04 +00:00
parent f4755f5b15
commit f81cfbab12
5 changed files with 17 additions and 17 deletions

View File

@ -19,14 +19,14 @@
int main()
{
{
std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
l2 = l;
assert(l2 == l);
assert(l2.get_allocator() == test_allocator<bool>(3));
}
{
std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
l2 = l;
assert(l2 == l);
@ -34,7 +34,7 @@ int main()
}
#if __cplusplus >= 201103L
{
std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
l2 = l;
assert(l2 == l);

View File

@ -31,8 +31,8 @@ test(typename C::size_type n, const typename C::value_type& x)
int main()
{
test<std::vector<bool> >(50, 3);
test<std::vector<bool> >(50, true);
#if TEST_STD_VER >= 11
test<std::vector<bool, min_allocator<bool>> >(50, 3);
test<std::vector<bool, min_allocator<bool>> >(50, true);
#endif
}

View File

@ -33,8 +33,8 @@ test(typename C::size_type n, const typename C::value_type& x,
int main()
{
test<std::vector<bool> >(50, 3, std::allocator<bool>());
test<std::vector<bool> >(50, true, std::allocator<bool>());
#if TEST_STD_VER >= 11
test<std::vector<bool, min_allocator<bool>> >(50, 3, min_allocator<bool>());
test<std::vector<bool, min_allocator<bool>> >(50, true, min_allocator<bool>());
#endif
}

View File

@ -38,14 +38,14 @@ int main()
test(std::vector<bool>(a, an));
}
{
std::vector<bool, test_allocator<bool> > v(3, 2, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > v(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
}
#if TEST_STD_VER >= 11
{
std::vector<bool, other_allocator<bool> > v(3, 2, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > v(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == other_allocator<bool>(-2));
@ -56,7 +56,7 @@ int main()
test(std::vector<bool, min_allocator<bool>>(a, an));
}
{
std::vector<bool, min_allocator<bool> > v(3, 2, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > v(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());

View File

@ -32,30 +32,30 @@ test(const C& x, const typename C::allocator_type& a)
int main()
{
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
bool* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<bool>(a, an), std::allocator<bool>());
}
{
std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
assert(l2 == l);
assert(l2.get_allocator() == test_allocator<bool>(3));
}
{
std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<bool>(3));
}
#if TEST_STD_VER >= 11
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
bool* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<bool, min_allocator<bool>>(a, an), min_allocator<bool>());
}
{
std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
assert(l2 == l);
assert(l2.get_allocator() == min_allocator<bool>());