Mark bucket_size() assertions as non-portible. Patch from STL@microsoft.com

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276578 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2016-07-24 23:13:36 +00:00
parent a54d1cb852
commit a3db71902a
4 changed files with 52 additions and 48 deletions

View File

@ -23,6 +23,7 @@
#include <string>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main()
@ -41,11 +42,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 1);
assert(c.bucket_size(2) == 1);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 1);
LIBCPP_ASSERT(c.bucket_size(2) == 1);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#if TEST_STD_VER >= 11
{
@ -63,11 +64,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 1);
assert(c.bucket_size(2) == 1);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 1);
LIBCPP_ASSERT(c.bucket_size(2) == 1);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1

View File

@ -23,6 +23,7 @@
#include <string>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main()
@ -41,13 +42,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 2);
assert(c.bucket_size(2) == 2);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
assert(c.bucket_size(5) == 0);
assert(c.bucket_size(6) == 0);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 2);
LIBCPP_ASSERT(c.bucket_size(2) == 2);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(5) == 0);
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#if TEST_STD_VER >= 11
{
@ -65,13 +66,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 2);
assert(c.bucket_size(2) == 2);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
assert(c.bucket_size(5) == 0);
assert(c.bucket_size(6) == 0);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 2);
LIBCPP_ASSERT(c.bucket_size(2) == 2);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(5) == 0);
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main()
@ -40,13 +41,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 2);
assert(c.bucket_size(2) == 2);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
assert(c.bucket_size(5) == 0);
assert(c.bucket_size(6) == 0);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 2);
LIBCPP_ASSERT(c.bucket_size(2) == 2);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(5) == 0);
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#if TEST_STD_VER >= 11
{
@ -64,13 +65,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 2);
assert(c.bucket_size(2) == 2);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
assert(c.bucket_size(5) == 0);
assert(c.bucket_size(6) == 0);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 2);
LIBCPP_ASSERT(c.bucket_size(2) == 2);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(5) == 0);
LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main()
@ -40,11 +41,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 1);
assert(c.bucket_size(2) == 1);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 1);
LIBCPP_ASSERT(c.bucket_size(2) == 1);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#if TEST_STD_VER >= 11
{
@ -61,11 +62,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
assert(c.bucket_size(0) == 0);
assert(c.bucket_size(1) == 1);
assert(c.bucket_size(2) == 1);
assert(c.bucket_size(3) == 1);
assert(c.bucket_size(4) == 1);
LIBCPP_ASSERT(c.bucket_size(0) == 0);
LIBCPP_ASSERT(c.bucket_size(1) == 1);
LIBCPP_ASSERT(c.bucket_size(2) == 1);
LIBCPP_ASSERT(c.bucket_size(3) == 1);
LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1