Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

// unordered_map& operator=(const unordered_map& u);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <algorithm>
#include <cassert>
#include <cfloat>
Expand Down Expand Up @@ -270,7 +268,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
V rhs_arr[] = {V(10, 4), V(13, 5), V(12, 324), V(0, 54), V(50, 5), V(2, 5)};
Map copy(begin(rhs_arr), end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
copy = orig;
LIBCPP_ASSERT(copy.bucket_count() == 5);
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
assert(copy.size() == 4);
assert(copy.at(1) == 1);
assert(copy.at(2) == 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

// unordered_multimap& operator=(const unordered_multimap& u);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <algorithm>
#include <cassert>
#include <cfloat>
Expand Down Expand Up @@ -289,7 +287,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
V rhs_arr[] = {V(10, 4), V(13, 5), V(12, 324), V(0, 54), V(50, 5), V(2, 5)};
Map copy(begin(rhs_arr), end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
copy = orig;
LIBCPP_ASSERT(copy.bucket_count() == 5);
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
assert(copy.size() == 4);
assert(copy.find(1)->second == 1);
assert(copy.find(2)->second == 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

// unordered_multiset& operator=(const unordered_multiset& u);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <algorithm>
#include <cassert>
#include <cfloat>
Expand Down Expand Up @@ -259,7 +257,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
int rhs_arr[] = {10, 13, 12, 0, 50, 2};
Set copy(std::begin(rhs_arr), std::end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
copy = orig;
LIBCPP_ASSERT(copy.bucket_count() == 5);
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
assert(copy.size() == 4);
assert(copy.count(1) == 1);
assert(copy.count(2) == 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

// unordered_set& operator=(const unordered_set& u);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <algorithm>
#include <cassert>
#include <cfloat>
Expand Down Expand Up @@ -262,7 +260,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
int rhs_arr[] = {10, 13, 12, 0, 50, 2};
Set copy(std::begin(rhs_arr), std::end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
copy = orig;
LIBCPP_ASSERT(copy.bucket_count() == 5);
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
assert(copy.size() == 4);
assert(copy.count(1) == 1);
assert(copy.count(2) == 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

// iter_type put(iter_type s, ios_base& iob, char_type fill, void* v) const;

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <cassert>
#include <ios>
#include <locale>
Expand All @@ -36,7 +34,7 @@ int main(int, char**) {
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), ios, '*', v);
std::string ex(str, base(iter));
assert(!ex.empty());
LIBCPP_ASSERT(ex == "0");
LIBCPP_NON_FROZEN_ASSERT(ex == "0");
}

return 0;
Expand Down
6 changes: 6 additions & 0 deletions libcxx/test/support/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@
#define LIBCPP_ONLY(...) static_assert(true, "")
#endif

#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
# define LIBCPP_NON_FROZEN_ASSERT(...) static_assert(true, "")
#else
# define LIBCPP_NON_FROZEN_ASSERT(...) LIBCPP_ASSERT(__VA_ARGS__)
#endif

#if __has_cpp_attribute(nodiscard)
# define TEST_NODISCARD [[nodiscard]]
#else
Expand Down
Loading