[libcxx-commits] [PATCH] D140650: [NFC][libc++][test] Improves code reuse.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 24 04:34:30 PST 2022


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This applies D140115 <https://reviews.llvm.org/D140115> to the new tuple tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140650

Files:
  libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
  libcxx/test/support/format.functions.common.h


Index: libcxx/test/support/format.functions.common.h
===================================================================
--- libcxx/test/support/format.functions.common.h
+++ libcxx/test/support/format.functions.common.h
@@ -10,6 +10,8 @@
 
 // Contains the common part of the formatter tests for different papers.
 
+#include <algorithm>
+#include <charconv>
 #include <format>
 
 #include "make_string.h"
Index: libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
===================================================================
--- libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
+++ libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
@@ -11,28 +11,7 @@
 #include <concepts>
 #include <format>
 
-#include "make_string.h"
-
-#define STR(S) MAKE_STRING(CharT, S)
-#define SV(S) MAKE_STRING_VIEW(CharT, S)
-
-template <class T>
-struct context {};
-
-template <>
-struct context<char> {
-  using type = std::format_context;
-};
-
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
-template <>
-struct context<wchar_t> {
-  using type = std::wformat_context;
-};
-#endif
-
-template <class T>
-using context_t = typename context<T>::type;
+#include "format.functions.common.h"
 
 enum class color { black, red, gold };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140650.485195.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221224/58707697/attachment.bin>


More information about the libcxx-commits mailing list