-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[libc++][format] Enables formattable tests for chrono formatters. #128356
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
Merged
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
Member
|
@llvm/pr-subscribers-libcxx Author: Mark de Wever (mordante) ChangesThese were forgotten when these types were implemented. Full diff: https://github.com/llvm/llvm-project/pull/128356.diff 2 Files Affected:
diff --git a/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
index ec27acd75e110..83bba886a44cb 100644
--- a/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
@@ -154,8 +154,8 @@ void test_P1361() {
# if !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) && \
!defined(TEST_HAS_NO_FILESYSTEM)
assert_is_formattable<std::chrono::utc_time<std::chrono::microseconds>, CharT>();
- //assert_is_formattable<std::chrono::tai_time<std::chrono::microseconds>, CharT>();
- //assert_is_formattable<std::chrono::gps_time<std::chrono::microseconds>, CharT>();
+ assert_is_formattable<std::chrono::tai_time<std::chrono::microseconds>, CharT>();
+ assert_is_formattable<std::chrono::gps_time<std::chrono::microseconds>, CharT>();
# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) &&
// !defined(TEST_HAS_NO_FILESYSTEM)
@@ -188,7 +188,7 @@ void test_P1361() {
assert_is_formattable<std::chrono::sys_info, CharT>();
assert_is_formattable<std::chrono::local_info, CharT>();
- //assert_is_formattable<std::chrono::zoned_time, CharT>();
+ assert_is_formattable<std::chrono::zoned_time<std::chrono::microseconds>, CharT>();
# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB)
#endif // TEST_HAS_NO_LOCALIZATION
diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
index 934de7ca4dcf2..9a63bf759f8e3 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
@@ -122,9 +122,9 @@ void test_P1361() {
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::microseconds>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::sys_time<std::chrono::microseconds>>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::utc_time<std::chrono::microseconds>>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::tai_time<std::chrono::microseconds>>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::gps_time<std::chrono::microseconds>>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::utc_time<std::chrono::microseconds>>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::tai_time<std::chrono::microseconds>>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::gps_time<std::chrono::microseconds>>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::file_time<std::chrono::microseconds>>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::local_time<std::chrono::microseconds>>);
@@ -149,10 +149,10 @@ void test_P1361() {
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::hh_mm_ss<std::chrono::microseconds>>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::sys_info>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::local_info>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::sys_info>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::local_info>);
- //static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::zoned_time>);
+ static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::zoned_time<std::chrono::microseconds>>);
#endif // TEST_HAS_NO_LOCALIZATION
}
|
You can test this locally with the following command:git-clang-format --diff 0751418024442ac97b8ff484c01f9386aa5723b8 572036b74f8767a4fb55a411bde22bc66fda15fd --extensions cpp -- libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cppView the diff from clang-format here.diff --git a/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
index 2ee4c40724..2989a0cd66 100644
--- a/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
@@ -157,7 +157,7 @@ void test_P1361() {
assert_is_formattable<std::chrono::tai_time<std::chrono::microseconds>, CharT>();
assert_is_formattable<std::chrono::gps_time<std::chrono::microseconds>, CharT>();
-# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) &&
+# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) && \
// !defined(TEST_HAS_NO_FILESYSTEM)
assert_is_formattable<std::chrono::file_time<std::chrono::microseconds>, CharT>();
diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
index 15397577e4..cba40818fe 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.locking/enable_nonlocking_formatter_optimization.compile.pass.cpp
@@ -127,7 +127,7 @@ void test_P1361() {
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::utc_time<std::chrono::microseconds>>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::tai_time<std::chrono::microseconds>>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::gps_time<std::chrono::microseconds>>);
-# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) &&
+# endif // !defined(TEST_HAS_NO_EXPERIMENTAL_TZDB) && !defined(TEST_HAS_NO_TIME_ZONE_DATABASE) && \
// !defined(TEST_HAS_NO_FILESYSTEM)
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::file_time<std::chrono::microseconds>>);
static_assert(!std::enable_nonlocking_formatter_optimization<std::chrono::local_time<std::chrono::microseconds>>);
|
f6833af to
11629b0
Compare
These were forgotten when these types were implemented.
11629b0 to
572036b
Compare
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.
These were forgotten when these types were implemented.