[libcxx-commits] [libcxx] [libc++][test] Adjust expected hexfloat format (PR #95011)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 10 10:05:28 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 1de6011c34b185235cd65c2e3fb030015d182968 518546b964a9c9ab0ea01cdd51e4ef6319f50ea7 -- libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp
index caca4bf71d..ad54a8bd69 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp
@@ -48,11 +48,11 @@ protected:
     virtual std::string do_grouping() const {return std::string("\1\2\3");}
 };
 
-const std::string hexfloat_fmt(const double& v, const std::ios& ios){
-    std::ostringstream oss;
-    oss.copyfmt(ios);
-    oss << std::noshowpos << std::hexfloat << v;
-    return oss.str();
+const std::string hexfloat_fmt(const double& v, const std::ios& ios) {
+  std::ostringstream oss;
+  oss.copyfmt(ios);
+  oss << std::noshowpos << std::hexfloat << v;
+  return oss.str();
 }
 
 void test1()
@@ -725,7 +725,7 @@ void test1()
                                 {
                                     cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), ios, '*', v);
                                     std::string ex(str, base(iter));
-                                    assert(ex == "-" + hf );
+                                    assert(ex == "-" + hf);
                                     assert(ios.width() == 0);
                                 }
                                 ios.width(25);
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp
index b210d9428d..f7e23069ba 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp
@@ -48,11 +48,11 @@ protected:
     virtual std::string do_grouping() const {return std::string("\1\2\3");}
 };
 
-const std::string hexfloat_fmt(const long double& v, const std::ios& ios){
-    std::ostringstream oss;
-    oss.copyfmt(ios);
-    oss << std::noshowpos << std::hexfloat << v;
-    return oss.str();
+const std::string hexfloat_fmt(const long double& v, const std::ios& ios) {
+  std::ostringstream oss;
+  oss.copyfmt(ios);
+  oss << std::noshowpos << std::hexfloat << v;
+  return oss.str();
 }
 
 void test1()
@@ -166,7 +166,7 @@ void test1()
                                 {
                                     cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), ios, '*', v);
                                     std::string ex(str, base(iter));
-                                    assert(ex == "-" +  hf + padding);
+                                    assert(ex == "-" + hf + padding);
                                     assert(ios.width() == 0);
                                 }
                                 ios.width(25);

``````````

</details>


https://github.com/llvm/llvm-project/pull/95011


More information about the libcxx-commits mailing list