From bc21af6a43db45bf0d0192afab0a079ecf400aa2 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 24 Dec 2022 13:33:21 +0100 Subject: [PATCH] [NFC][libc++][test] Improves code reuse. This applies D140115 to the new tuple tests. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D140650 --- .../format.tuple/format.functions.tests.h | 23 +------------------ libcxx/test/support/format.functions.common.h | 2 ++ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h b/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h index 159a617234a5..64d3ce4dedd6 100644 --- a/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h +++ b/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h @@ -11,28 +11,7 @@ #include #include -#include "make_string.h" - -#define STR(S) MAKE_STRING(CharT, S) -#define SV(S) MAKE_STRING_VIEW(CharT, S) - -template -struct context {}; - -template <> -struct context { - using type = std::format_context; -}; - -#ifndef TEST_HAS_NO_WIDE_CHARACTERS -template <> -struct context { - using type = std::wformat_context; -}; -#endif - -template -using context_t = typename context::type; +#include "format.functions.common.h" enum class color { black, red, gold }; diff --git a/libcxx/test/support/format.functions.common.h b/libcxx/test/support/format.functions.common.h index fa107ba5dc44..14faf3acd0d5 100644 --- a/libcxx/test/support/format.functions.common.h +++ b/libcxx/test/support/format.functions.common.h @@ -10,6 +10,8 @@ // Contains the common part of the formatter tests for different papers. +#include +#include #include #include "make_string.h" -- 2.34.1