// These tests require locale for non-char paths
// UNSUPPORTED: libcpp-has-no-localization
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
// <filesystem>
// class path
// required.
// On Windows, the append method is more complex and uses intermediate
// path objects, which causes extra allocations.
+ // In DLL builds on Windows, the overridden operator new won't pick up
+ // allocations done within the DLL, so the RequireAllocationGuard below
+ // won't necessarily see allocations in the cases where they're expected.
#ifdef _WIN32
bool DisableAllocations = false;
#else
{
RequireAllocationGuard g; // requires 1 or more allocations occur by default
if (DisableAllocations) g.requireExactly(0);
+ else TEST_ONLY_WIN32_DLL(g.requireAtLeast(0));
LHS /= RHS;
}
assert(PathEq(LHS, E));
{
RequireAllocationGuard g;
if (DisableAllocations) g.requireExactly(0);
+ else TEST_ONLY_WIN32_DLL(g.requireAtLeast(0));
LHS.append(RHS, REnd);
}
assert(PathEq(LHS, E));
// UNSUPPORTED: c++03
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
// <filesystem>
// class path
assert(globalMemCounter.checkOutstandingNewEq(0));
const std::string s("we really really really really really really really "
"really really long string so that we allocate");
- assert(globalMemCounter.checkOutstandingNewEq(1));
+ // On windows, the operator new from count_new.h can't override the default
+ // operator for calls within the libc++ DLL.
+ TEST_NOT_WIN32_DLL(assert(globalMemCounter.checkOutstandingNewEq(1)));
const fs::path::string_type ps(s.begin(), s.end());
path p(s);
{
// These tests require locale for non-char paths
// UNSUPPORTED: libcpp-has-no-localization
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
// <filesystem>
// class path
// code_cvt conversions.
// For the path native type, no allocations will be performed because no
// conversion is required.
+
+ // In DLL builds on Windows, the overridden operator new won't pick up
+ // allocations done within the DLL, so the RequireAllocationGuard below
+ // won't necessarily see allocations in the cases where they're expected.
bool DisableAllocations = std::is_same<CharT, path::value_type>::value;
{
path LHS(L); PathReserve(LHS, ReserveSize);
{
RequireAllocationGuard g; // requires 1 or more allocations occur by default
if (DisableAllocations) g.requireExactly(0);
+ else TEST_ONLY_WIN32_DLL(g.requireAtLeast(0));
LHS += RHS;
}
assert(LHS == E);
{
RequireAllocationGuard g;
if (DisableAllocations) g.requireExactly(0);
+ else TEST_ONLY_WIN32_DLL(g.requireAtLeast(0));
LHS.concat(RHS, REnd);
}
assert(LHS == E);
// UNSUPPORTED: c++03
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
// <filesystem>
// class path
assert(globalMemCounter.checkOutstandingNewEq(0));
const std::string s("we really really really really really really really "
"really really long string so that we allocate");
- assert(globalMemCounter.checkOutstandingNewEq(1));
+ // On windows, the operator new from count_new.h can't override the default
+ // operator for calls within the libc++ DLL.
+ TEST_NOT_WIN32_DLL(assert(globalMemCounter.checkOutstandingNewEq(1)));
const fs::path::string_type ps(s.begin(), s.end());
path p(s);
{
// ~ctype();
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
#include <locale>
#include <cassert>
new std::ctype<char>(new std::ctype<char>::mask[256], true));
assert(globalMemCounter.checkDeleteArrayCalledEq(0));
}
- assert(globalMemCounter.checkDeleteArrayCalledEq(1));
+ // On windows, the operator new from count_new.h can't override the default
+ // operator for calls within the libc++ DLL.
+ TEST_NOT_WIN32_DLL(assert(globalMemCounter.checkDeleteArrayCalledEq(1)));
return 0;
}
//
// UNSUPPORTED: libcpp-has-no-threads
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
// <thread>
// class thread
for (int i=0; i <= numAllocs; ++i) {
throw_one = i;
f_run = false;
- unsigned old_outstanding = outstanding_new;
+ TEST_NOT_WIN32_DLL(unsigned old_outstanding = outstanding_new);
try {
std::thread t(f);
assert(i == numAllocs); // Only final iteration will not throw.
assert(i < numAllocs);
assert(!f_run); // (2.2)
}
- assert(old_outstanding == outstanding_new); // (2.3)
+ // In DLL builds on Windows, the overridden operators new/delete won't
+ // override calls from within the DLL, so this won't match.
+ TEST_NOT_WIN32_DLL(assert(old_outstanding == outstanding_new)); // (2.3)
}
f_run = false;
throw_one = 0xFFF;
#define TEST_NOT_WIN32(...) __VA_ARGS__
#endif
+#if defined(_WIN32) && !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define TEST_NOT_WIN32_DLL(...) ((void)0)
+#define TEST_ONLY_WIN32_DLL(...) __VA_ARGS__
+#else
+#define TEST_NOT_WIN32_DLL(...) __VA_ARGS__
+#define TEST_ONLY_WIN32_DLL(...) ((void)0)
+#endif
+
#ifdef _WIN32
#define TEST_WIN_NO_FILESYSTEM_PERMS_NONE
#endif