-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[libc++] Move more tests into test/extensions #152975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
philnik777
wants to merge
1
commit into
llvm:main
Choose a base branch
from
philnik777:move_extension_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-libcxx Author: Nikolas Klauser (philnik777) ChangesThis should be the last set of tests moved to Full diff: https://github.com/llvm/llvm-project/pull/152975.diff 18 Files Affected:
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
rename to libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
rename to libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
rename to libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
similarity index 100%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
rename to libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
rename to libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
rename to libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
diff --git a/libcxx/test/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
rename to libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
diff --git a/libcxx/test/libcxx/odr_signature.exceptions.sh.cpp b/libcxx/test/extensions/libcxx/odr_signature.exceptions.sh.cpp
similarity index 100%
rename from libcxx/test/libcxx/odr_signature.exceptions.sh.cpp
rename to libcxx/test/extensions/libcxx/odr_signature.exceptions.sh.cpp
diff --git a/libcxx/test/libcxx/odr_signature.hardening.sh.cpp b/libcxx/test/extensions/libcxx/odr_signature.hardening.sh.cpp
similarity index 100%
rename from libcxx/test/libcxx/odr_signature.hardening.sh.cpp
rename to libcxx/test/extensions/libcxx/odr_signature.hardening.sh.cpp
diff --git a/libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp b/libcxx/test/extensions/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
rename to libcxx/test/extensions/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
diff --git a/libcxx/test/libcxx/xopen_source.gen.py b/libcxx/test/extensions/posix/xopen_source.gen.py
similarity index 100%
rename from libcxx/test/libcxx/xopen_source.gen.py
rename to libcxx/test/extensions/posix/xopen_source.gen.py
|
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions cpp -- libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_guard.pass.cpp libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp libcxx/test/extensions/libcxx/odr_signature.exceptions.sh.cpp libcxx/test/extensions/libcxx/odr_signature.hardening.sh.cpp libcxx/test/extensions/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp View the diff from clang-format here.diff --git a/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
index e9794acc8..ca3beacec 100644
--- a/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
+++ b/libcxx/test/extensions/clang/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
@@ -24,9 +24,7 @@
std::mutex m;
int foo __attribute__((guarded_by(m)));
-void increment() __attribute__((requires_capability(m))) {
- foo++;
-}
+void increment() __attribute__((requires_capability(m))) { foo++; }
int main(int, char**) {
m.lock();
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
index 652783fc6..6d7a04c91 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
@@ -26,27 +26,25 @@
#include "wide_temp_file.h"
int main(int, char**) {
- std::wstring temp = get_wide_temp_file_name();
- {
- std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
- {
- std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
-
- return 0;
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
index b592492f8..5bf582043 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
@@ -26,33 +26,31 @@
#include "wide_temp_file.h"
int main(int, char**) {
- std::wstring temp = get_wide_temp_file_name();
- {
- std::fstream fs;
- assert(!fs.is_open());
- fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- assert(fs.is_open());
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
- {
- std::wfstream fs;
- assert(!fs.is_open());
- fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- assert(fs.is_open());
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
-
- return 0;
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::fstream fs;
+ assert(!fs.is_open());
+ fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ assert(fs.is_open());
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wfstream fs;
+ assert(!fs.is_open());
+ fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc);
+ assert(fs.is_open());
+ double x = 0;
+ fs << 3.25;
+ fs.seekg(0);
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
index 18e9b2910..e791184a2 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
@@ -25,24 +25,24 @@
#include "test_macros.h"
int main(int, char**) {
- {
- std::ifstream fs(L"test.dat");
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- // std::ifstream(const wchar_t*, std::ios_base::openmode) is tested in
- // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
- // which creates writable files.
- {
- std::wifstream fs(L"test.dat");
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- // std::wifstream(const wchar_t*, std::ios_base::openmode) is tested in
- // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
- // which creates writable files.
-
- return 0;
+ {
+ std::ifstream fs(L"test.dat");
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::ifstream(const wchar_t*, std::ios_base::openmode) is tested in
+ // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
+ // which creates writable files.
+ {
+ std::wifstream fs(L"test.dat");
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ // std::wifstream(const wchar_t*, std::ios_base::openmode) is tested in
+ // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
+ // which creates writable files.
+
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
index 3fa8a29e2..ea5054b3d 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
@@ -25,30 +25,30 @@
#include "test_macros.h"
int main(int, char**) {
- {
- std::ifstream fs;
- assert(!fs.is_open());
- char c = 'a';
- fs >> c;
- assert(fs.fail());
- assert(c == 'a');
- fs.open(L"test.dat");
- assert(fs.is_open());
- fs >> c;
- assert(c == 'r');
- }
- {
- std::wifstream fs;
- assert(!fs.is_open());
- wchar_t c = L'a';
- fs >> c;
- assert(fs.fail());
- assert(c == L'a');
- fs.open(L"test.dat");
- assert(fs.is_open());
- fs >> c;
- assert(c == L'r');
- }
-
- return 0;
+ {
+ std::ifstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == 'a');
+ fs.open(L"test.dat");
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == 'r');
+ }
+ {
+ std::wifstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs >> c;
+ assert(fs.fail());
+ assert(c == L'a');
+ fs.open(L"test.dat");
+ assert(fs.is_open());
+ fs >> c;
+ assert(c == L'r');
+ }
+
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
index 3730e7364..aabdfe407 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
@@ -26,41 +26,41 @@
#include "wide_temp_file.h"
int main(int, char**) {
- std::wstring temp = get_wide_temp_file_name();
- {
- std::ofstream fs(temp.c_str());
- fs << 3.25;
- }
- {
- std::ifstream fs(temp.c_str());
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- {
- std::ifstream fs(temp.c_str(), std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
- {
- std::wofstream fs(temp.c_str());
- fs << 3.25;
- }
- {
- std::wifstream fs(temp.c_str());
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- {
- std::wifstream fs(temp.c_str(), std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
- _wremove(temp.c_str());
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::ofstream fs(temp.c_str());
+ fs << 3.25;
+ }
+ {
+ std::ifstream fs(temp.c_str());
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::ifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
+ {
+ std::wofstream fs(temp.c_str());
+ fs << 3.25;
+ }
+ {
+ std::wifstream fs(temp.c_str());
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ {
+ std::wifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
+ _wremove(temp.c_str());
- return 0;
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
index bfbbd5322..600901008 100644
--- a/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
+++ b/libcxx/test/extensions/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
@@ -26,41 +26,41 @@
#include "wide_temp_file.h"
int main(int, char**) {
- std::wstring temp = get_wide_temp_file_name();
- {
- std::ofstream fs;
- assert(!fs.is_open());
- char c = 'a';
- fs << c;
- assert(fs.fail());
- fs.open(temp.c_str());
- assert(fs.is_open());
- fs << c;
- }
- {
- std::ifstream fs(temp.c_str());
- char c = 0;
- fs >> c;
- assert(c == 'a');
- }
- _wremove(temp.c_str());
- {
- std::wofstream fs;
- assert(!fs.is_open());
- wchar_t c = L'a';
- fs << c;
- assert(fs.fail());
- fs.open(temp.c_str());
- assert(fs.is_open());
- fs << c;
- }
- {
- std::wifstream fs(temp.c_str());
- wchar_t c = 0;
- fs >> c;
- assert(c == L'a');
- }
- _wremove(temp.c_str());
+ std::wstring temp = get_wide_temp_file_name();
+ {
+ std::ofstream fs;
+ assert(!fs.is_open());
+ char c = 'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(temp.c_str());
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::ifstream fs(temp.c_str());
+ char c = 0;
+ fs >> c;
+ assert(c == 'a');
+ }
+ _wremove(temp.c_str());
+ {
+ std::wofstream fs;
+ assert(!fs.is_open());
+ wchar_t c = L'a';
+ fs << c;
+ assert(fs.fail());
+ fs.open(temp.c_str());
+ assert(fs.is_open());
+ fs << c;
+ }
+ {
+ std::wifstream fs(temp.c_str());
+ wchar_t c = 0;
+ fs >> c;
+ assert(c == L'a');
+ }
+ _wremove(temp.c_str());
- return 0;
+ return 0;
}
diff --git a/libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
index c856c931f..3f9c66033 100644
--- a/libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
+++ b/libcxx/test/extensions/libcxx/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
@@ -19,17 +19,16 @@
#include "test_macros.h"
-int main(int, char**)
-{
- {
- std::ostreambuf_iterator<char> i(nullptr);
- assert(i.failed());
- }
+int main(int, char**) {
+ {
+ std::ostreambuf_iterator<char> i(nullptr);
+ assert(i.failed());
+ }
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- {
- std::ostreambuf_iterator<wchar_t> i(nullptr);
- assert(i.failed());
- }
+ {
+ std::ostreambuf_iterator<wchar_t> i(nullptr);
+ assert(i.failed());
+ }
#endif
return 0;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be the last set of tests moved to
test/extensions
for now.