[libcxx-commits] [PATCH] D154489: [libc++][tests] Fix a test exercising incorrect overload

Piotr Fusik via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 5 02:59:09 PDT 2023


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

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154489

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


Index: libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
===================================================================
--- libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
+++ libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.move.mode.pass.cpp
@@ -19,24 +19,21 @@
 #include <cassert>
 
 #include "make_string.h"
-#include "test_allocator.h"
 #include "test_macros.h"
 
 #define STR(S) MAKE_STRING(CharT, S)
-#define SV(S) MAKE_STRING_VIEW(CharT, S)
 
 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));
-    assert(buf.view() == SV("testing"));
+    const std::basic_stringbuf<CharT> buf(std::move(s));
+    assert(buf.str() == STR("testing"));
   }
   {
     std::basic_string<CharT> s(STR("testing"));
-    const std::basic_stringbuf<CharT, std::char_traits<CharT>, test_allocator<CharT>> buf(
-        std::move(s), std::ios_base::out);
-    assert(buf.view() == SV("testing"));
+    const std::basic_stringbuf<CharT> buf(std::move(s), std::ios_base::out);
+    assert(buf.str() == STR("testing"));
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154489.537278.patch
Type: text/x-patch
Size: 1290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230705/18d51b1e/attachment.bin>


More information about the libcxx-commits mailing list