From f328e6329207f62ca0e1427a4ba039190698b1b2 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 00:27:33 +0800 Subject: [PATCH 01/21] remove `_Off != 0 || _Way != ios_base::cur` --- stl/inc/__msvc_filebuf.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 7e420846cfa..27648e275f4 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -652,7 +652,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer } if (!_Myfile || !_Endwrite() - || ((_Off != 0 || _Way != ios_base::cur) && _CSTD _fseeki64(_Myfile, _Off, _Way) != 0) + || _CSTD _fseeki64(_Myfile, _Off, _Way) != 0 || _CSTD fgetpos(_Myfile, &_Fileposition) != 0) { return pos_type{off_type{-1}}; // report failure } From 273f8cedc7f7933d6f323efbb5d2e4f7a68f08b4 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 00:50:35 +0800 Subject: [PATCH 02/21] formatting --- stl/inc/__msvc_filebuf.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 27648e275f4..f06907a888c 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -651,8 +651,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer _Off -= static_cast(sizeof(_Elem)); // back up over _Elem bytes } - if (!_Myfile || !_Endwrite() - || _CSTD _fseeki64(_Myfile, _Off, _Way) != 0 + if (!_Myfile || !_Endwrite() || _CSTD _fseeki64(_Myfile, _Off, _Way) != 0 || _CSTD fgetpos(_Myfile, &_Fileposition) != 0) { return pos_type{off_type{-1}}; // report failure } From aefc30ab7d032eb4e34e27bda57e5cd2d6910390 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:12:23 +0800 Subject: [PATCH 03/21] Create test.cpp --- .../GH_003572_fstream_seekp_0_cur/test.cpp | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp new file mode 100644 index 00000000000..2e5926d449c --- /dev/null +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include + +int main() { + using namespace std; + + fstream f("test.txt", ios::in | ios::out | ios::trunc); + + f << "123"; + + auto check = [&](string_view content) { + char buffer[4]{}; + f.seekg(0); + f.read(buffer, 3); + assert(f && buffer == content); + }; + + f.seekg(0); + (void) f.get(); + f.seekp(f.tellp()); + f << "*"; + check("1*3"); + + f.seekg(0); + (void) f.get(); + f.seekp(0, std::ios::cur); + f << "!"; + check("1!3"); + + f.seekg(0); + (void) f.get(); + f.seekp(1, std::ios::cur); + f << "!"; + check("1!!"); + + f.seekg(0); + (void) f.get(); + f.seekp(-1, std::ios::cur); + f << "!"; + check("!!!"); +} From 00d669178a51586cc6ca8a3412e32c922383a489 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:14:51 +0800 Subject: [PATCH 04/21] Create env.lst --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst new file mode 100644 index 00000000000..34a48eec90c --- /dev/null +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst From 2066810cf95cce7b0e39658a50ce011149b97a41 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:16:50 +0800 Subject: [PATCH 05/21] Update test.lst --- tests/std/test.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/std/test.lst b/tests/std/test.lst index 822cf153b82..094f4c7d4fe 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -223,6 +223,7 @@ tests\GH_003105_piecewise_densities tests\GH_003119_error_category_ctor tests\GH_003246_cmath_narrowing tests\GH_003570_allocate_at_least +tests\GH_003572_fstream_seekp_0_cur tests\GH_003617_vectorized_meow_element tests\GH_003676_format_large_hh_mm_ss_values tests\GH_003735_char_traits_signatures From 02668efe2521343e565820e7b98e01ab3c355798 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:42:39 +0800 Subject: [PATCH 06/21] formatting From d6db4f7bcaa6f593caee8acbe7802d686d0d21ed Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:09:02 +0800 Subject: [PATCH 07/21] formatting From bffd1f325482387c40a8b8eac10f2e69b743755a Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:19:49 +0800 Subject: [PATCH 08/21] formatting From 373cb4d755e57674378ca238988b07e1436ef0f0 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:35:29 +0800 Subject: [PATCH 09/21] Delete env.lst --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst deleted file mode 100644 index 34a48eec90c..00000000000 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -RUNALL_INCLUDE ..\usual_matrix.lst From 92c3546a0db3f0616ba047584b9a7ee68d516919 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:35:47 +0800 Subject: [PATCH 10/21] Delete test.cpp --- .../GH_003572_fstream_seekp_0_cur/test.cpp | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp deleted file mode 100644 index 2e5926d449c..00000000000 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#include -#include - -int main() { - using namespace std; - - fstream f("test.txt", ios::in | ios::out | ios::trunc); - - f << "123"; - - auto check = [&](string_view content) { - char buffer[4]{}; - f.seekg(0); - f.read(buffer, 3); - assert(f && buffer == content); - }; - - f.seekg(0); - (void) f.get(); - f.seekp(f.tellp()); - f << "*"; - check("1*3"); - - f.seekg(0); - (void) f.get(); - f.seekp(0, std::ios::cur); - f << "!"; - check("1!3"); - - f.seekg(0); - (void) f.get(); - f.seekp(1, std::ios::cur); - f << "!"; - check("1!!"); - - f.seekg(0); - (void) f.get(); - f.seekp(-1, std::ios::cur); - f << "!"; - check("!!!"); -} From 0d7890b3d73db49e9b8dab78186eb6de36ab3f12 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:44:41 +0800 Subject: [PATCH 11/21] Create env.lst --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst new file mode 100644 index 00000000000..34a48eec90c --- /dev/null +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst From 3aa878ceb89332a71c50cc01fa54398c80aad67f Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:45:24 +0800 Subject: [PATCH 12/21] Add files via upload --- .../GH_003572_fstream_seekp_0_cur/test.cpp | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp new file mode 100644 index 00000000000..25f57d0e331 --- /dev/null +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include + +int main() { + using namespace std; + + fstream f("test.txt", ios::in | ios::out | ios::trunc); + + f << "123"; + + auto check = [&](string_view content) { + char buffer[4]{}; + f.seekg(0); + f.read(buffer, 3); + assert(f && buffer == content); + }; + + f.seekg(0); + (void) f.get(); + f.seekp(f.tellp()); + f << "*"; + check("1*3"); + + f.seekg(0); + (void) f.get(); + f.seekp(0, std::ios::cur); + f << "!"; + check("1!3"); + + f.seekg(0); + (void) f.get(); + f.seekp(1, std::ios::cur); + f << "!"; + check("1!!"); + + f.seekg(0); + (void) f.get(); + f.seekp(-1, std::ios::cur); + f << "!"; + check("!!!"); +} \ No newline at end of file From a17f51c6aea2ec7fd5a289b7f146a2228b5fae9d Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:55:28 +0800 Subject: [PATCH 13/21] . --- .../GH_003572_fstream_seekp_0_cur/test.cpp | 45 +------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp index 25f57d0e331..56f3b36e277 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -1,44 +1 @@ -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#include -#include - -int main() { - using namespace std; - - fstream f("test.txt", ios::in | ios::out | ios::trunc); - - f << "123"; - - auto check = [&](string_view content) { - char buffer[4]{}; - f.seekg(0); - f.read(buffer, 3); - assert(f && buffer == content); - }; - - f.seekg(0); - (void) f.get(); - f.seekp(f.tellp()); - f << "*"; - check("1*3"); - - f.seekg(0); - (void) f.get(); - f.seekp(0, std::ios::cur); - f << "!"; - check("1!3"); - - f.seekg(0); - (void) f.get(); - f.seekp(1, std::ios::cur); - f << "!"; - check("1!!"); - - f.seekg(0); - (void) f.get(); - f.seekp(-1, std::ios::cur); - f << "!"; - check("!!!"); -} \ No newline at end of file + From dd892231c66bb71e9371ce559e01338afe575af8 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:55:54 +0800 Subject: [PATCH 14/21] .. --- .../GH_003572_fstream_seekp_0_cur/test.cpp | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp index 56f3b36e277..49931c38240 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -1 +1,44 @@ - +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include + +int main() { + using namespace std; + + fstream f("test.txt", ios::in | ios::out | ios::trunc); + + f << "123"; + + auto check = [&](string_view content) { + char buffer[4]{}; + f.seekg(0); + f.read(buffer, 3); + assert(f && buffer == content); + }; + + f.seekg(0); + (void) f.get(); + f.seekp(f.tellp()); + f << "*"; + check("1*3"); + + f.seekg(0); + (void) f.get(); + f.seekp(0, std::ios::cur); + f << "!"; + check("1!3"); + + f.seekg(0); + (void) f.get(); + f.seekp(1, std::ios::cur); + f << "!"; + check("1!!"); + + f.seekg(0); + (void) f.get(); + f.seekp(-1, std::ios::cur); + f << "!"; + check("!!!"); +} From a068e86210ead13cd7112bde0c7421fbd336c47f Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 17:01:22 +0800 Subject: [PATCH 15/21] . --- tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp index 49931c38240..f17b4cc80e0 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include int main() { using namespace std; From bdc64a44547fbb99669b49f80f21e518fc119fb3 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:12:55 +0800 Subject: [PATCH 16/21] . From 5b379da59d6b2839a0f59e055e57411e8ffa3443 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:19:13 +0800 Subject: [PATCH 17/21] Delete env.lst --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst deleted file mode 100644 index 34a48eec90c..00000000000 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -RUNALL_INCLUDE ..\usual_matrix.lst From 76966edca2c6e85eb68136f8134e642eb9a06381 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:19:46 +0800 Subject: [PATCH 18/21] Add files via upload --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst new file mode 100644 index 00000000000..19f025bd0e6 --- /dev/null +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst From 2aa3d11671514fde2c243081074ade7ed583658b Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:45:33 +0800 Subject: [PATCH 19/21] Update env.lst --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst index 19f025bd0e6..642f530ffad 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_matrix.lst +RUNALL_INCLUDE ..\usual_latest_matrix.lst From d9a8fdf40b7e42bf7a6e4d45e8db56a745096bd3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 20 Jun 2023 20:29:21 -0700 Subject: [PATCH 20/21] Code review feedback. --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 2 +- .../std/tests/GH_003572_fstream_seekp_0_cur/test.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst index 642f530ffad..2de7aab2959 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_latest_matrix.lst +RUNALL_INCLUDE ..\usual_17_matrix.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp index f17b4cc80e0..d9f9db88ddf 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -3,6 +3,8 @@ #include #include +#include +#include int main() { using namespace std; @@ -15,7 +17,8 @@ int main() { char buffer[4]{}; f.seekg(0); f.read(buffer, 3); - assert(f && buffer == content); + assert(f); + assert(buffer == content); }; f.seekg(0); @@ -26,19 +29,19 @@ int main() { f.seekg(0); (void) f.get(); - f.seekp(0, std::ios::cur); + f.seekp(0, ios::cur); f << "!"; check("1!3"); f.seekg(0); (void) f.get(); - f.seekp(1, std::ios::cur); + f.seekp(1, ios::cur); f << "!"; check("1!!"); f.seekg(0); (void) f.get(); - f.seekp(-1, std::ios::cur); + f.seekp(-1, ios::cur); f << "!"; check("!!!"); } From 5eb42940f5f51b127f4a88da652b1d472b54f076 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 21 Jun 2023 17:59:49 -0700 Subject: [PATCH 21/21] Avoid string_view so the test is C++14 --- tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst | 2 +- tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst index 2de7aab2959..19f025bd0e6 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_17_matrix.lst +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp index d9f9db88ddf..72d15f50bcb 100644 --- a/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp +++ b/tests/std/tests/GH_003572_fstream_seekp_0_cur/test.cpp @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include #include -#include int main() { using namespace std; @@ -13,12 +13,12 @@ int main() { f << "123"; - auto check = [&](string_view content) { + auto check = [&f](const char(&content)[4]) { char buffer[4]{}; f.seekg(0); f.read(buffer, 3); assert(f); - assert(buffer == content); + assert(memcmp(buffer, content, 4) == 0); }; f.seekg(0);