[libcxx-commits] [libcxx] 1406f09 - [libc++][tests] Fix a test exercising incorrect overload

Piotr Fusik via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 10 21:12:15 PDT 2023


Author: Piotr Fusik
Date: 2023-08-11T06:12:11+02:00
New Revision: 1406f099de94dfb776f4aa427261f8cbbd39d93a

URL: https://github.com/llvm/llvm-project/commit/1406f099de94dfb776f4aa427261f8cbbd39d93a
DIFF: https://github.com/llvm/llvm-project/commit/1406f099de94dfb776f4aa427261f8cbbd39d93a.diff

LOG: [libc++][tests] Fix a test exercising incorrect overload

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154489

Added: 
    

Modified: 
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
index ac5a46c4f3768c..120a8ea965b575 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
@@ -29,13 +29,23 @@ template <class CharT>
 static void test() {
   {
     std::basic_string<CharT> s(STR("testing"));
-    const std::basic_stringbuf<CharT, std::char_traits<CharT>, test_allocator<CharT>> buf(std::move(s));
+    const std::basic_stringbuf<CharT> buf(std::move(s));
     assert(buf.view() == SV("testing"));
   }
   {
     std::basic_string<CharT> s(STR("testing"));
+    const std::basic_stringbuf<CharT> buf(std::move(s), std::ios_base::out);
+    assert(buf.view() == SV("testing"));
+  }
+  {
+    std::basic_string<CharT, std::char_traits<CharT>, test_allocator<CharT>> s(STR("testing"));
+    const std::basic_stringbuf<CharT, std::char_traits<CharT>, test_allocator<CharT>> buf(std::move(s));
+    assert(buf.view() == SV("testing"));
+  }
+  {
+    std::basic_string<CharT, std::char_traits<CharT>, test_allocator<CharT>> s(STR("testing"));
     const std::basic_stringbuf<CharT, std::char_traits<CharT>, test_allocator<CharT>> buf(
-        std::move(s), std::ios_base::out);
+        std::move(s), std::ios_base::in);
     assert(buf.view() == SV("testing"));
   }
 }


        


More information about the libcxx-commits mailing list