mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 14:50:26 +00:00
[libcxx] [test] Use string().c_str() to convert a std::filesystem::path to a const char*
On Windows, path::value_type is wchar_t, so one can't pass the return value of path::c_str() directly to std::remove(). This matches what was done for tests under std/input.output/filesystems in81db3c31aa
and3784bdf217
. Differential Revision: https://reviews.llvm.org/D97458
This commit is contained in:
parent
3573a90b8a
commit
f15377084c
@ -46,7 +46,7 @@ int main(int, char**) {
|
||||
assert(f.sbumpc() == '2');
|
||||
assert(f.sbumpc() == '3');
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
{
|
||||
std::wfilebuf f;
|
||||
assert(f.open(p, std::ios_base::out) != 0);
|
||||
@ -61,7 +61,7 @@ int main(int, char**) {
|
||||
assert(f.sbumpc() == L'2');
|
||||
assert(f.sbumpc() == L'3');
|
||||
}
|
||||
remove(p.c_str());
|
||||
remove(p.string().c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ int main(int, char**) {
|
||||
fs >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
{
|
||||
std::wfstream fs(p, std::ios_base::in | std::ios_base::out |
|
||||
std::ios_base::trunc);
|
||||
@ -54,7 +54,7 @@ int main(int, char**) {
|
||||
fs >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ int main(int, char**) {
|
||||
stream >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
{
|
||||
std::wfstream stream;
|
||||
assert(!stream.is_open());
|
||||
@ -57,7 +57,7 @@ int main(int, char**) {
|
||||
stream >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ int main(int, char**) {
|
||||
stream >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
{
|
||||
std::wofstream stream(p);
|
||||
stream << 3.25;
|
||||
@ -74,7 +74,7 @@ int main(int, char**) {
|
||||
stream >> x;
|
||||
assert(x == 3.25);
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ int main(int, char**) {
|
||||
fs >> c;
|
||||
assert(c == 'a');
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
{
|
||||
std::wofstream fs;
|
||||
assert(!fs.is_open());
|
||||
@ -67,7 +67,7 @@ int main(int, char**) {
|
||||
fs >> c;
|
||||
assert(c == L'a');
|
||||
}
|
||||
std::remove(p.c_str());
|
||||
std::remove(p.string().c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user