1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template <class charT, class traits = char_traits<charT> >
12 // class basic_filebuf
14 // basic_filebuf& operator=(basic_filebuf&& rhs);
18 #include "test_macros.h"
19 #include "platform_support.h"
23 std::string temp
= get_temp_file_name();
26 assert(f
.open(temp
.c_str(), std::ios_base::out
| std::ios_base::in
27 | std::ios_base::trunc
) != 0);
29 assert(f
.sputn("123", 3) == 3);
30 f
.pubseekoff(1, std::ios_base::beg
);
31 assert(f
.sgetc() == '2');
36 assert(f2
.sgetc() == '2');
38 std::remove(temp
.c_str());
40 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
43 assert(f
.open(temp
.c_str(), std::ios_base::out
| std::ios_base::in
44 | std::ios_base::trunc
) != 0);
46 assert(f
.sputn(L
"123", 3) == 3);
47 f
.pubseekoff(1, std::ios_base::beg
);
48 assert(f
.sgetc() == L
'2');
53 assert(f2
.sgetc() == L
'2');
55 std::remove(temp
.c_str());